Threadbare version
main
Affected scene
No response
Description
Instantiating a townie (scenes/game_elements/characters/npcs/townie.tscn) into a scene and then calling randomize_character() on them changes the seed of the base random number generator. This means that any random method will be predictable from now on. For instance, in townie system exploration #2129 I'm adding a group of townies to Fray's End to listen the retelling, and then trying to pick one of them randomly with _townies.pick_random(). Because the base seed is set, the same townie is always picked.
The CharacterRandomizer should use its own instance of RandomNumberGenerator, to make the townie look&feel predictable, not the entire game!
Checklist
Threadbare version
main
Affected scene
No response
Description
Instantiating a townie (
scenes/game_elements/characters/npcs/townie.tscn) into a scene and then callingrandomize_character()on them changes the seed of the base random number generator. This means that any random method will be predictable from now on. For instance, in townie system exploration #2129 I'm adding a group of townies to Fray's End to listen the retelling, and then trying to pick one of them randomly with_townies.pick_random(). Because the base seed is set, the same townie is always picked.The CharacterRandomizer should use its own instance of RandomNumberGenerator, to make the townie look&feel predictable, not the entire game!
Checklist