C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
34 stars 9 forks source link

Allow setting a fixed random seed #282

Closed QuintillusCFC closed 2 years ago

QuintillusCFC commented 2 years ago

Setting a fixed random seed is very helpful for investigating performance, as well as bugs, as it allows reproducible behavior.

We're at a stage where this is useful, and should be added.

I'll add a commit that has the first stage of this. For some reason I have to set the seed in 3 places, which isn't ideal, so more investigation is needed. It also should preferable be configurable somewhere other than being hard-coded.

WildWeazel commented 2 years ago

Perhaps a... RandomComponent? Actually it'd probably go in game preferences or something that would be bundled with the save.

QuintillusCFC commented 2 years ago

That probably makes sense longer term. For now, with no way to set it in the UI, I've gone with a slightly improved version of what I added while debugging, that allows setting it to a fixed value with one line of code.

That is in accordance with my general goal here of, "allow debugging tasks to be done, and then get back to the actual issues I started on 26 days ago that got sidetracked". And hopefully soon make another Carthage Preview release...