New Game does not read the seed input or set GameState.run_seed #2

Closed
opened 2026-08-15 11:36:19 +01:00 by liamjd · 0 comments
Owner

scripts/main_menu.gd:

func _on_new_game_pressed() -> void:
	pass

The %SeedInput LineEdit collects a value that is never read, and GameState.run_seed is never written. The New Game button does nothing.

Two parts:

1. Resolve the seed text to an int. Agreed rule:

  • empty → random (randi()), matching the "random" placeholder
  • valid integer (String.is_valid_int()) → use it literally
  • anything else → hash(text), so word seeds like europa work

Avoid SpinBox for this: it stores its value as a float, so seeds above 2^53 lose precision, and it cannot express "blank means random".

2. Write it to GameState.run_seed, then change scene.

There is no game scene yet, so this issue can land as far as populating GameState and logging the resolved seed. The scene change follows once a game scene exists.

Depends on the run_seed default being fixed first, otherwise the two changes conflict.

`scripts/main_menu.gd`: ```gdscript func _on_new_game_pressed() -> void: pass ``` The `%SeedInput` `LineEdit` collects a value that is never read, and `GameState.run_seed` is never written. The New Game button does nothing. Two parts: **1. Resolve the seed text to an int.** Agreed rule: - empty → random (`randi()`), matching the "random" placeholder - valid integer (`String.is_valid_int()`) → use it literally - anything else → `hash(text)`, so word seeds like `europa` work Avoid `SpinBox` for this: it stores its value as a float, so seeds above 2^53 lose precision, and it cannot express "blank means random". **2. Write it to `GameState.run_seed`, then change scene.** There is no game scene yet, so this issue can land as far as populating `GameState` and logging the resolved seed. The scene change follows once a game scene exists. Depends on the `run_seed` default being fixed first, otherwise the two changes conflict.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder#2
No description provided.