tweak(random): Replace InitGameLogicRandom with InitRandom for consistent client and audio seeds#2339
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Include/Common/RandomValue.h | Removed InitGameLogicRandom function declaration |
| Core/GameEngine/Source/Common/RandomValue.cpp | Removed InitGameLogicRandom function implementation (16 lines) |
| Core/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp | Replaced InitGameLogicRandom with InitRandom for seed initialization |
| Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp | Replaced InitGameLogicRandom with InitRandom for seed initialization |
| Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp | Replaced two InitGameLogicRandom calls with InitRandom for skirmish and single-player modes |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp | Replaced two InitGameLogicRandom calls with InitRandom for skirmish and single-player modes |
Last reviewed commit: a7ba441
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: GeneralsMD/Code/GameEngine/Source/GameNetwork/GameSpyGameInfo.cpp
Line: 566-567
Comment:
This file still calls `InitGameLogicRandom` which was removed in this PR, causing a compilation error
```suggestion
InitRandom( TheGameSpyGame->getSeed() );
DEBUG_LOG(("InitRandom( %d )", TheGameSpyGame->getSeed()));
```
How can I resolve this? If you propose a fix, please make it concise. |
|
Broke da build! but looks like it's due to core files being altered :P |
|
Yes, Generals isn't updated yet but the core files are, so that project won't compile. |
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp
Show resolved
Hide resolved
So if I understand this correctly, then this means Client and Audio now also have random seeding on every match start, whereas before they just kept evolving from match to match? Could there be any reason why EA chose to do that intentionally? |
There was a problem hiding this comment.
I do not know what this is good for but looks okay anyway. Needs Rebase and Replicate.
Yes.
Not that I can see. If you check the code for the replays, you can see that they started to use
Will update later. |
…tent client and audio seeds (TheSuperHackers#2339)
This PR removes function
InitGameLogicRandom, and changes all use cases toInitRandom. The former only sets the logical seed values (important for the CRC), while the latter also sets the client and audio seed values. I think setting all 3 types of seed values improves consistency. This change is not user-facing.I checked 2000+ of Joker's (short) replays and this change did not introduce any new mismatches, as expected.
TODO: