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
refactor(gameengine): rename the fork to Zero Hour Reforged
Olcay Seyganb95e04b5e2ac
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 64ade3736..2c2098417 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,4 +1,4 @@-# Command and Conquer: Generals: Zero Hour: Reborn+# Command and Conquer: Generals: Zero Hour: ReforgedEA opened the source of Generals and Zero Hour, the game that is still on sale and still runs onSteam. This build is that source with the bugs the game shipped with fixed and everything below added.@@ -962,7 +962,7 @@ found and fixed — EA's own, not port damage.**- The main menu buttons are there when the menu is. On the first visit they used to stay hidden, pointer and all, until you nudged the mouse or pressed a key, so a freshly started game looked stuck on the background battle.- The zip installs itself and takes itself back off. `install.bat` asks where the game is, offeringwhatever the registry says, and copies the build there; anything it is about to write over goes- into a zip in `ZHReborn-Uninstall` first, and anything it adds that was not there is written down+ into a zip in `ZHReforged-Uninstall` first, and anything it adds that was not there is written downso it can be deleted rather than restored. `uninstall.bat`, left in that same folder, puts theinstall back the way it found it. Installing a second time on top does not bury the first backup:it keeps the copy of the files as the retail game had them, not as the previous build left them.diff --git a/GeneralsMD/Code/CMakeLists.txt b/GeneralsMD/Code/CMakeLists.txtindex fd033f972..50bfd4a18 100644--- a/GeneralsMD/Code/CMakeLists.txt+++ b/GeneralsMD/Code/CMakeLists.txt@@ -744,12 +744,12 @@ target_sources(test_gameengine PRIVATE ${TESTS}/test_gameengine_stubs.cpp)set_target_properties(test_gameengine PROPERTIES CXX_STANDARD 17)# simulation_uses_no_runtime_trig reads the engine's own sources back off disk to prove nothing in# GameLogic or Common has gone back to calling sinf().-# fxlist_reborn_ini_parses_and_keeps_its_light runs the fork's own FXList file through the real+# fxlist_reforged_ini_parses_and_keeps_its_light runs the fork's own FXList file through the real# INI parser, so it needs the tracked master rather than whatever sits in Run/.# the_options_menu_buttons_all_wear_one_font reads the tracked layout master, not Run/'s copy.target_compile_definitions(test_gameengine PRIVATEGAMEENGINE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/GameEngine"- FXLIST_REBORN_INI="${CMAKE_CURRENT_SOURCE_DIR}/Data/INI/FXListReborn.ini"+ FXLIST_REFORGED_INI="${CMAKE_CURRENT_SOURCE_DIR}/Data/INI/FXListReforged.ini"OPTIONS_MENU_WND="${CMAKE_CURRENT_SOURCE_DIR}/Data/Window/Menus/OptionsMenu.wnd")# The three hand-written self-checks predate the harness; run them from ctestdiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarAmericaCenter.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarAmericaCenter.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarAmericaCenter.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarAmericaCenter.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarAmericaLeft.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarAmericaLeft.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarAmericaLeft.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarAmericaLeft.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarAmericaRight.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarAmericaRight.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarAmericaRight.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarAmericaRight.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarChinaCenter.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarChinaCenter.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarChinaCenter.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarChinaCenter.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarChinaLeft.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarChinaLeft.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarChinaLeft.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarChinaLeft.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarChinaRight.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarChinaRight.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarChinaRight.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarChinaRight.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarGLACenter.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarGLACenter.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarGLACenter.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarGLACenter.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarGLALeft.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarGLALeft.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarGLALeft.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarGLALeft.tgadiff --git a/GeneralsMD/Code/Data/Art/Textures/RebornBarGLARight.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedBarGLARight.tgasimilarity index 100%rename from GeneralsMD/Code/Data/Art/Textures/RebornBarGLARight.tgarename to GeneralsMD/Code/Data/Art/Textures/ReforgedBarGLARight.tgadiff --git a/GeneralsMD/Code/Data/INI/FXListReborn.ini b/GeneralsMD/Code/Data/INI/FXListReforged.inisimilarity index 99%rename from GeneralsMD/Code/Data/INI/FXListReborn.inirename to GeneralsMD/Code/Data/INI/FXListReforged.iniindex 2fb26e04e..e43a42e1b 100644--- a/GeneralsMD/Code/Data/INI/FXListReborn.ini+++ b/GeneralsMD/Code/Data/INI/FXListReforged.ini@@ -1,5 +1,5 @@;//////////////////////////////////////////////////////////////////////////////-;FILE: FXListReborn.ini ////////////////////////////////////////////////////////+;FILE: FXListReforged.ini //////////////////////////////////////////////////////;//////////////////////////////////////////////////////////////////////////////;; Muzzle and detonation light. EA's explosions throw particles and sound but nodiff --git a/GeneralsMD/Code/Data/Install_Final.bmp b/GeneralsMD/Code/Data/Install_Final.bmpindex 64125f7a6..78006dc04 100644Binary files a/GeneralsMD/Code/Data/Install_Final.bmp and b/GeneralsMD/Code/Data/Install_Final.bmp differdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cppindex b45dcf0bb..483e5c6af 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp@@ -822,7 +822,7 @@ void GameEngine::init( int argc, char *argv[] )loose copy of FXList.ini because a loose copy shadows the whole 190K shipped file: it goesstale against every patch, it cannot be reviewed, and - since it lands in the INI CRC below -it silently refuses every multiplayer join from a machine that does not have the same one. */- ini.load( AsciiString( "Data\\INI\\FXListReborn.ini" ), INI_LOAD_OVERWRITE, &xferCRC );+ ini.load( AsciiString( "Data\\INI\\FXListReforged.ini" ), INI_LOAD_OVERWRITE, &xferCRC );initSubsystem(TheWeaponStore,"TheWeaponStore", MSGNEW("GameEngineSubsystem") WeaponStore(), &xferCRC, NULL, "Data\\INI\\Weapon.ini");initSubsystem(TheObjectCreationListStore,"TheObjectCreationListStore", MSGNEW("GameEngineSubsystem") ObjectCreationListStore(), &xferCRC, "Data\\INI\\Default\\ObjectCreationList.ini", "Data\\INI\\ObjectCreationList.ini");initSubsystem(TheLocomotorStore,"TheLocomotorStore", MSGNEW("GameEngineSubsystem") LocomotorStore(), &xferCRC, NULL, "Data\\INI\\Locomotor.ini");diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppindex 4dc31328a..aea6cb2e7 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp@@ -1545,7 +1545,7 @@ static const ControlBarPlateSet thePlateSets[] ={{ "America",{- { "RebornBarAmericaLeft.tga", { { 0, 412 }, { 183, 599 } }, 0, 0, 0, 293, 301 },+ { "ReforgedBarAmericaLeft.tga", { { 0, 412 }, { 183, 599 } }, 0, 0, 0, 293, 301 },/* This painting is 170 design units tall for a 180-unit slot, and it is the plate's owncomposition rather than a straight cut of the shipped bar: its grid field lines up withthe command buttons (494-589) exactly where it stands, and its money box does not line@@ -1572,26 +1572,26 @@ static const ControlBarPlateSet thePlateSets[] =runs 224.6 to 614.2, and the fourteen command buttons are 223 to 603: the firstcolumn overhangs the left bezel by a unit and a half while eleven units stand emptyon the right. Six to the right centres the block in the field. */- { "RebornBarAmericaCenter.tga", { { 180, 429 }, { 623, 599 } }, 9, 10, 6, 706, 271 },- { "RebornBarAmericaRight.tga", { { 610, 433 }, { 800, 599 } }, 0, 0, 0, 304, 268,+ { "ReforgedBarAmericaCenter.tga", { { 180, 429 }, { 623, 599 } }, 9, 10, 6, 706, 271 },+ { "ReforgedBarAmericaRight.tga", { { 610, 433 }, { 800, 599 } }, 0, 0, 0, 304, 268,{ { 648, 434 }, { 717, 460 } } },}},{ "China",{- { "RebornBarChinaLeft.tga", { { 1, 417 }, { 196, 598 } }, 0, 0, 0, 315, 295 },- { "RebornBarChinaCenter.tga", { { 176, 433 }, { 617, 597 } }, 0, 0, 0, 718, 269 },- { "RebornBarChinaRight.tga", { { 611, 424 }, { 798, 598 } }, 0, 0, 0, 303, 284,+ { "ReforgedBarChinaLeft.tga", { { 1, 417 }, { 196, 598 } }, 0, 0, 0, 315, 295 },+ { "ReforgedBarChinaCenter.tga", { { 176, 433 }, { 617, 597 } }, 0, 0, 0, 718, 269 },+ { "ReforgedBarChinaRight.tga", { { 611, 424 }, { 798, 598 } }, 0, 0, 0, 303, 284,{ { 639, 430 }, { 686, 463 } } },}},{ "GLA",{- { "RebornBarGLALeft.tga", { { 0, 416 }, { 215, 599 } }, 0, 0, 0, 345, 295 },+ { "ReforgedBarGLALeft.tga", { { 0, 416 }, { 215, 599 } }, 0, 0, 0, 345, 295 },/* No shift: this plate paints its box at design 443.2 to 459.3, middle 451.3, andControlBarScheme.ini already puts GLA's readout at 443 to 462, middle 452.5. */- { "RebornBarGLACenter.tga", { { 168, 437 }, { 617, 599 } }, 0, 0, 0, 720, 261 },- { "RebornBarGLARight.tga", { { 612, 423 }, { 799, 599 } }, 0, 0, 0, 300, 284,+ { "ReforgedBarGLACenter.tga", { { 168, 437 }, { 617, 599 } }, 0, 0, 0, 720, 261 },+ { "ReforgedBarGLARight.tga", { { 612, 423 }, { 799, 599 } }, 0, 0, 0, 300, 284,{ { 631, 428 }, { 705, 465 } } },}},diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex b23d42cf1..02bc5e894 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -483,14 +483,14 @@ TEST(ini_unknown_block_aborts_the_file)remove( TEST_INI );}-/* Data\INI\FXListReborn.ini is the fork's own explosion light: 89 of EA's FXLists, each repeated+/* Data\INI\FXListReforged.ini is the fork's own explosion light: 89 of EA's FXLists, each repeatedwhole with one LightPulse added. Whole, because FXListStore::parseFXListDefinition clears anentry before re-reading it - a half-copied block does not add a light, it deletes an explosion.GameEngine::init loads the file and folds it into the multiplayer INI CRC, so both ways ofgetting it wrong are expensive: a malformed block throws and takes the whole startup down, anda regeneration that loses the LightPulse ships a file that lights nothing and still refusesevery player who does not have that exact copy. */-TEST(fxlist_reborn_ini_parses_and_keeps_its_light)+TEST(fxlist_reforged_ini_parses_and_keeps_its_light){CHECK( bootOnce() );@@ -498,7 +498,7 @@ TEST(fxlist_reborn_ini_parses_and_keeps_its_light)TheFXListStore = NEW FXListStore;/* through the game's own parser, not a lookalike */- CHECK( loadIni( FXLIST_REBORN_INI ) );+ CHECK( loadIni( FXLIST_REFORGED_INI ) );/* the blocks landed in the store, under the names the game looks them up by */CHECK( TheFXListStore->findFXList( "ScudStormMissileDetonation" ) != NULL );@@ -506,7 +506,7 @@ TEST(fxlist_reborn_ini_parses_and_keeps_its_light)CHECK( TheFXListStore->findFXList( "NoSuchFXListIsDeclaredAnywhere" ) == NULL );/* and every block in the file still carries the light it exists for */- FILE *fp = fopen( FXLIST_REBORN_INI, "rb" );+ FILE *fp = fopen( FXLIST_REFORGED_INI, "rb" );CHECK( fp != NULL );Int blocks = 0, lit = 0, open = 0, hasLight = 0;diff --git a/README.md b/README.mdindex 90da8489c..5e35fc8bc 100644--- a/README.md+++ b/README.md@@ -2,7 +2,7 @@### COMMAND AND CONQUER · GENERALS-# ZERO HOUR: REBORN+# ZERO HOUR: REFORGED**Zero Hour, rebuilt from the source EA opened.**@@ -19,7 +19,7 @@EA opened the source of Generals and Zero Hour. The game itself never went away and still runs onSteam.-**Reborn** is that source moved to Visual Studio 2022 and changed as a game: ~580 engine source+**Reforged** is that source moved to Visual Studio 2022 and changed as a game: ~580 engine sourcefiles ported, and around sixty original defects found and fixed. Not port damage. EA's own, shippedin 2003 and never noticed.@@ -27,7 +27,7 @@ You need to own the game; no game data ships here. Nothing changes unit stats, w## Then and now-| | The source EA released | Reborn |+| | The source EA released | Reforged ||:--|:--|:--|| **Frame rate** | 33 fps, with game speed tied to it | uncapped picture, rules on their own clock || **Worst logic turn** | `2,976 ms` | `243 ms` |