Queue lab research from local stock

This commit is contained in:
Loïc Wisniewski 2026-08-13 22:04:21 +02:00
commit e9acca569e
7 changed files with 137 additions and 27 deletions

View file

@ -13,6 +13,7 @@ const CHUNK_SIZE: float = 1200.0
const NOISE_SEED: int = 1337
const ASTEROID_FIELD_THRESHOLD: float = 0.15
const PLANET_THRESHOLD: float = 0.33
const GAS_GIANT_THRESHOLD: float = 0.55
const PLANET_NAMES: Array = [
"Kepler's Rest", "Ceres Minor", "Vesta's Shadow", "Ironhold",
@ -61,10 +62,8 @@ static func biome_at_chunk(chunk: Vector2i) -> int:
static func has_planet_at_chunk(chunk: Vector2i) -> bool:
if biome_at_chunk(chunk) != Biome.ASTEROID_FIELD:
return false
var n: float = _get_planet_noise().get_noise_2d(float(chunk.x), float(chunk.y))
return n > PLANET_THRESHOLD
return (biome_at_chunk(chunk) == Biome.ASTEROID_FIELD and n > PLANET_THRESHOLD) or (biome_at_chunk(chunk) == Biome.SPACE and n > GAS_GIANT_THRESHOLD)
static func planet_data_at_chunk(chunk: Vector2i) -> Dictionary:
@ -82,7 +81,7 @@ static func planet_data_at_chunk(chunk: Vector2i) -> Dictionary:
var shape_seed: int = rng.randi()
# A stable per-chunk roll makes gas giants persistent landmarks rather
# than a different resource whenever the scene reloads.
var gas_giant: bool = rng.randf() < 0.28
var gas_giant: bool = biome_at_chunk(chunk) == Biome.SPACE
if gas_giant:
planet_name = GAS_GIANT_NAMES[rng.randi() % GAS_GIANT_NAMES.size()]
return {"local_pos": local_pos, "name": planet_name, "shape_seed": shape_seed,