Seed with frame counter instead of SDL_GetTicks

Using SDL_GetTicks() to seed the Gravitron RNG caused many
reproducibility issues while syncing https://tasvideos.org/7575S . To
fix this, add a frame counter, which is a number that is incremented
every frame and never resets, and use it instead.

If someone needs to switch back to SDL_GetTicks() for old TASes, then
provide the -seed-use-sdl-getticks command-line option for them.
This commit is contained in:
Misa
2022-11-14 14:10:24 -08:00
parent e6a3df6ca6
commit 9def8fd704
4 changed files with 21 additions and 2 deletions

View File

@@ -257,6 +257,8 @@ public:
int lastsaved;
int deathcounts;
int framecounter;
bool seed_use_sdl_getticks;
int frames, seconds, minutes, hours;
bool gamesaved;
bool gamesavefailed;