Main game scene: seeded terrain grid, camera rig, environment #10
No reviewers
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder!10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "6-main-game-scene-grid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stands up
res://scenes/game.tscn: a seeded terrain grid under an orthographic camera, lit and framed, with four shape presets. No pawns, no building, no UI — this proves the basics work and is the consumer the seed pipeline (#1, #2, #3) was built for.What landed
Terrain —
TerrainGrid(GridMap) with heights quantised into integer levels, aMeshLibrarygenerated at runtime, full-depth tile columns and a top-only collider. Carried over from theOrthographicGamePOC along with the noise normalisation pass, which is load-bearing: fractal Perlin never reaches its nominal range, so sampling straight intoheight_scalegives a near-flat map.Shape presets —
TerrainPresetresources for plains, island, crater and canyon. Shaping happens in normalised −1..1 space before scaling to world units, so shape parameters stay independent ofheight_scale; the POC applied falloff after scaling, which entangled the two. The canyon's centre line meanders via a separate noise generator so it does not read as a dug trench.The POC's
falloff_start = 0.80was not carried over as a tuned value — it was fitted to guarantee reachable pawn spawns, and with no pawns that constraint does not apply.Camera — POC rig: yaw on the rig, pitch on the camera, zoom changes
Camera3D.sizerather than boom length.game.gdcentres it on load; it previously defaulted to the map's corner.Lighting — sky-sourced ambient so shadowed geometry stays readable, which the canyon floor needed badly.
Seed threading
TerrainGriddoes not readGameState.game.gdpassesGameState.run_seedin, keeping the generator testable in isolation and stopping the autoload becoming an implicit dependency of every system that later wants determinism.This forced an ordering change:
TerrainGrid._ready()no longer callsgenerate(), because child_ready()runs before the parent's and it would otherwise build a map before the seed arrived. Both sides carry a comment — "why doesn't this node generate itself?" is exactly the question someone answers by puttinggenerate()back.randomize_seedwas removed as a second, competing source of randomness;GameStatealready randomises on startup.Verification
Seed reaches the generator:
Same seed reproduces, different seed differs:
All four presets verified visually with headed captures —
gl_compatibilityrenders nothing headless, so a clean headless run proves nothing about the picture.Deliberately deferred
terrain_grid.gdas Earth-toned constants, and kind is picked by elevation alone, which makes the crater's floor and exterior share a colourPathfinding (
AStar2D) came across with the POC code but has no consumer until pawns exist.Closes #6