Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(gamelogic): leave script counters and flags out of the crc again
Olcay Seygan722c160c5b4b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2b0dc354e..a2fcfda2d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -464,6 +464,7 @@ found and fixed — EA's own, not port damage.**- The readout in the top right corner now carries the frame number, and in a network game how many frames the room can still play before it has to wait on somebody, out of the input delay it is running with, plus the frame rate the slowest machine has set for everyone. "ready 4/7 room 29fps" is a healthy match; ready sitting at 0 is the stall you are about to feel.- Two players who each lost the other's last packet no longer freeze until the disconnect screen. Each asked the other to send it again, and each only resent what it had already played, which was nothing, so on a link with a tenth of a second of delay and one packet in twenty lost the match stopped for good one second in. Now the packet goes again and the match carries on.- A desynced match stops at once instead of playing on as two games.+- Two players on different factions can play a LAN or VPN match again. 3.0.0 and 3.0.1 put every USA against GLA, China against USA and China against GLA game out of sync in its first second, while two players of the same side played on: the mismatch check had started counting the map scripts' timers and flags, and some of those scripts follow each player's own faction, so the two machines never agreed on them. The check leaves them out again, as Zero Hour always did.- A single lost packet no longer freezes the match for twenty seconds. The game now asks for themissing frame back after a fifth of a second instead of waiting out the disconnect timer, sonobody sits in front of a vote screen for a player who never went anywhere.diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cppindex 11c1e6322..c8d56a332 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp@@ -8765,19 +8765,12 @@ void ScriptEngine::AdjustDebugVariableData(const AsciiString& variableName, Int// ------------------------------------------------------------------------------------------------void ScriptEngine::crc( Xfer *xfer ){- // The map script's counters, timers and flags, so a script that drifted between machines is- // caught on the frame it drifts rather than when its effect reaches an object. Names are left- // out: they are fixed by the map and allocated in evaluation order. The end-game timers are- // left out too, since each machine starts them for its own player's victory or defeat.- xfer->xferInt( &m_numCounters );- for( Int i = 0; i < m_numCounters; ++i )- {- xfer->xferInt( &m_counters[ i ].value );- xfer->xferBool( &m_counters[ i ].isCountdownTimer );- }- xfer->xferInt( &m_numFlags );- for( Int i = 0; i < m_numFlags; ++i )- xfer->xferBool( &m_flags[ i ].value );+ // Nothing, as in retail. The script counters and flags are not the same on every machine: the+ // scripts a network game runs follow the local player: MultiplayerScripts.scb sets the _FACTION+ // counter from <Local Player>'s faction, and the music, speech and victory timers key off it. Two+ // players of different factions hold different values from the first frames on, and none of it+ // reaches an object (retail never CRCed it). CRCing them+ // (v3.0.0) put every mixed-faction network game out of sync at the first CRC frame.} // end crc