HomeWildfire Games

Initialize the AIManager AISeed immediately in C++ rather than too late and in…

Description

Initialize the AIManager AISeed immediately in C++ rather than too late and in JS.

Fixes #4907
Differential Revision: https://code.wildfiregames.com/D1178
Reviewed By: mimo
Refs D1159, rP15973

Event Timeline

Observation:
In atlas we get a warning now rather than silently using 0 for the AISeed:

WARNING: CSimulation2Impl::InitRNGSeedAI: No seed value specified - using 0

Autostarted games in Gamesetup.cpp pass 0 if no command line AISeed is given and thus doesn't trigger the warning.

The warning is good:
The simulation should still yell about missing values, since it should only contain the code for computation, no values at all ideally (separation of concerns).
(If some caller would require to synchronize the seed, the mistake to not pass a synchronized AI seed will trigger this warning rather than silently using a possibly non-synchronized default)

How to address the warning in atlas:
The AI seed could actually be random in autostarted games and atlas if not specified, since it doesn't influence map generation.
In autostarted multiplayer games, the AISeed is consumed from the simstate passed by the server (see CCmpAIManager::SerializeState).