Skip to content

CharacterRandomizer makes the whole game predictable #2130

@manuq

Description

@manuq

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

  • I've reviewed and agree to follow the code of conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions