Randomise run_seed on startup instead of defaulting to 123 #4
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!4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "1-run-seed-default"
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?
GameState.run_seeddefaulted to a fixed123. Nothing wrote to it, so any code reading it would have generated an identical world every run while looking entirely correct — stable across launches, reproducible, plausible. A seed path that was never plumbed through would have been indistinguishable from one that worked, and the eventual debugging would have started in the terrain generator rather than here._ready()now randomises it, so an unset seed is honestly random: a broken seed path shows up as a map that changes when it shouldn't, which is a failure you notice.Zero is no longer a sentinel — the autoload's
_ready()runs before the main scene loads, so the field is never observably0. The comment says so, to stop anyone writing a deadif run_seed == 0guard.Verification
Three launches, reading the autoload on frame 3 (reading it in
_initialize()returns0— the tree has not run yet, which looks exactly like the randomisation failing):Note
The
print()in_on_new_game_pressed()is temporary scaffolding confirming the value reachesGameState. It is replaced when the seed input is wired up in #2.Closes #1