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
docs: rewrite the README around the launcher and v1.0.3
Olcay Seygancfb54e05a350
diff --git a/README.md b/README.mdindex 5e35fc8bc..a4f47196c 100644--- a/README.md+++ b/README.md@@ -1,89 +1,141 @@<div align="center">-### COMMAND AND CONQUER · GENERALS+# Zero Hour Reforged-# ZERO HOUR: REFORGED+Command & Conquer: Generals Zero Hour, rebuilt from the source EA opened and played as a game again.-**Zero Hour, rebuilt from the source EA opened.**-----+[](https://github.com/olcayseygan/CnCGeneralsZH-Reforged/releases/latest)+++[Download](https://github.com/olcayseygan/CnCGeneralsZH-Reforged/releases/latest) · [Every change](CHANGELOG.md) · [Build it](#build-it)+</div>----EA opened the source of Generals and Zero Hour. The game itself never went away and still runs on-Steam.+EA released the source of Generals and Zero Hour in 2025. The game itself never left the shelf: it is+still sold, and it still runs on Steam.++Reforged is that source moved to Visual Studio 2022 and worked on as a game. About 580 engine source+files were ported. Around sixty bugs were found and fixed that EA shipped in 2003 and nobody noticed+for twenty-two years. And the computer opponent builds a base now, which it never could.-**Reforged** is that source moved to Visual Studio 2022 and changed as a game: ~580 engine source-files ported, and around sixty original defects found and fixed. Not port damage. EA's own, shipped-in 2003 and never noticed.+No unit or weapon is rebalanced. You need your own copy of Zero Hour, because no game data ships+here.-You need to own the game; no game data ships here. Nothing changes unit stats, weapons or balance.+## Play it++1. Have Zero Hour installed from Steam or the EA app.+2. Download `CnCGeneralsZHReforged-Setup-<version>.exe` from the+ [latest release](https://github.com/olcayseygan/CnCGeneralsZH-Reforged/releases/latest) and run+ it. The installer is not code signed, so Windows SmartScreen asks once before it starts.+3. The launcher finds your Zero Hour folder and lists every file it is about to write before it+ writes any. Each file it replaces is backed up first. Press Install, then Play.++The launcher carries no game files of its own. It downloads the build, checks every file against a+signed list, and keeps both the game and itself up to date from there. A Steam copy still starts+through Steam. Uninstall on the launcher's settings page puts back the files your game had before.+When the game crashes, the launcher sends the report without asking you for anything.## Then and now| | 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` |-| **Long route search** | `55,000` cells · `256 ms` | `10,000` cells · `25 ms` |-| **Pathfinding, per match** | `11.8 s` | `1.6 s` |-| **Skirmish AI** | urgent orders and one power plant | builds its base |-| **Attack-move** | drives past the enemy without firing | engages, rearms, resumes |-| **Base textures** | Zero Hour's downscaled copies | 481 originals at 4× the resolution |-| **Infantry shadows** | a flat blob | cast from the pose — arms, head, weapon |-| **When it crashes** | silence | symbolized report, file and line |--## What you actually notice--- **The frame rate cap is gone — and the game did not get faster.** The picture runs uncapped while- the rules keep their own steady clock. A bad moment now costs you a dropped frame instead of a- slow-motion match.-- **The computer opponent builds a base.** One wrong value meant the skirmish AI only ever built- what its script marked urgent, plus a single power plant. Every skirmish anyone has played against- this code since 2003 was against an opponent that could not build.-- **Attack-move actually attacks.** Four separate fixes, one of them found by putting probes into a- live match: aircraft were being *penalised* for emptying their rack and flying home to rearm.-- **Long orders stopped hitching.** EA's coarse pathfinder pass never ran, so every long move- searched the whole map — and every wall, fence and building permanently held one of the search's- scratch records.-- **Your whole base's production, on one strip.** A single row above the command bar carries- everything you are building anywhere, ordered by time left. Click a picture to jump the camera- there.-- **Soldiers cast real shadows**, built from the pose instead of a flat blob. Scud trails, falling- bombs, smoke clouds and all 128 tree types cast too — the tree shadows had never been drawn at all.-- **It fits your monitor.** Widescreen resolutions are back in the options menu, zoom-to-cursor- works, and buildings snap to the pathfinder's own grid with the blocked squares crossed out.-- **It does not crash.** Poison clouds, mine clearing, garrison kills, full transports blowing up,- and quitting the game — all traced and fixed.+| Frame rate | the picture waits on the game's clock | uncapped, and the rules keep their own |+| Worst logic turn | `2,976 ms` | `243 ms` |+| A 23-cell route | `55,000` cells searched in `256 ms` | `10,000` cells in `25 ms` |+| Route searching over a match | `11.8 s` | `1.6 s` |+| Skirmish opponent | urgent orders and one power plant | builds, scouts, expands and retreats |+| Base game textures | Zero Hour's downscaled copies | 481 originals at four times the resolution |+| Infantry shadows | a flat blob | cast from the pose |+| A screen of fire and smoke | 459 draw batches, `11.6 ms` a frame | 177 batches, `6.7 ms` |+| Language | English | English or Türkçe |+| A crash | silence | a report with file and line, sent by the launcher |++## What a match feels like now++### An opponent that plays fair and plays well++One wrong value kept the skirmish AI building only what its script marked urgent, plus a single power+plant. Every skirmish played against this code since 2003 was against an opponent that could not+build a base. It builds one now. It also scouts instead of reading your start position off the lobby,+walks a rifleman into oil derricks instead of shelling them, and on Hard it takes a losing team out+of a fight.++Easy, Medium and Hard differ in what the computer is allowed to decide. No level gets extra money,+cheaper units, faster building or longer sight. Measured over 32 headless matches with the seats swapped both ways,+Hard beats Easy 15-0.++### Orders that happen++Attack-move fights what it meets. Aircraft make their pass, fly home, rearm and pick your order back+up. Long moves stopped hitching once EA's coarse route search, which never ran, finally did its job.+A group sent across the map travels as a crowd and passes the slow vehicle in front, where it used to+queue behind it in one long column.++### Controls you pick++Options > Controls has Modern and Legacy. Modern is this game: left selects, right orders, and grid+hotkeys run the command bar. Legacy is the game as it shipped in 2003, letters on the buttons and+Ctrl held for force fire. Under either one, hold the button on the radar and drag, and the camera+follows the cursor across the map.++A single strip above the command bar carries everything your base is building, soonest first. Click+a picture and the camera goes there. Shift on a build button queues five, Ctrl twenty.++### Network games the host sets up++The lobby has a settings page. Peace time runs three to fifteen minutes. The unit limit shares 840+units between the players. Superweapons can be allowed, limited to one or banned, and Pro Rules takes+a fixed list of units and tricks out of every network match. Your ally's mouse shows on your map as a+pool of their colour with their name on it. Two copies of the game on one machine can play each other+over the LAN screen.++### A picture that holds up++The game draws through Direct3D 11 by default, with glow and edge smoothing over the battlefield.+`-d3d9` brings back the old renderer. Soldiers cast shadows from their pose and all 128 tree types+cast theirs. Eighty-nine kinds of explosion light the ground around them, and every smoke and fire+sprite is drawn: 101,000 of them at 8.3 ms a frame.++Wide screens get a command bar in three pieces instead of one stretched strip, and text that grows+with the monitor. On an ultrawide the view opens sideways, so a wider screen shows more battlefield.++### Türkçe++Options > Gameplay > Language. Menus, the command bar, briefings, tooltips and the credits come to+3,853 lines of Turkish, written against one glossary of more than 1,400 terms. Voices and videos stay+as your install has them.> [!NOTE]-> **[CHANGELOG.md](CHANGELOG.md) is the full record** — all 119 changes, what was tried and-> reverted, and what is still missing.+> [CHANGELOG.md](CHANGELOG.md) is the whole record: every change with the numbers behind it, and the+> work that was tried and taken back out.-## How it was proved+## How it was tested-No CI, no debugger on the machine. The game tests itself instead:+There is no CI and no debugger on the machine this is built on. The game tests itself instead.-- **It plays itself.** Eight computer opponents, started from one command line.-- **Headless, a 23-minute skirmish plays out in 38 seconds** — identically, every run.-- **It plays itself over a network too**, two copies and one real connection. That is what caught- every multiplayer replay falsely accusing itself of desync since 2003.-- **Every fix was proved by putting the bug back** and watching the exact test go red.-- **Defects deliberately left alone are pinned by a test** that documents the behaviour, so a future- change to them is a decision and not an accident.+- 38 automated test suites run on every build.+- Headless, a 23-minute skirmish plays out in 38 seconds, the same way on every run.+- An AI change is argued with 20 headless matches on the same seeds, win rate and match length+ before and after.+- A graphics change is argued in pixels: the same frame of the same match from two builds, and the+ pixels between them counted.+- Two copies over one real connection caught every multiplayer replay falsely reporting a desync+ since 2003.+- Every fix was proved by putting the bug back and watching its test fail.++What did not work stays written down. The first group movement rework and tree shadows cast from+stencil volumes were both built and measured, then reverted, and CHANGELOG says why.---## Build it-Win32 x86 only — the code is full of 32-bit inline assembly, and an x64 configure is rejected on-purpose. Visual Studio 2022 with the Desktop C++ workload is all you need.+Win32 x86 only. The code is full of 32-bit inline assembly, and an x64 configure is refused on+purpose. Visual Studio 2022 with the Desktop C++ workload is enough.```consolecmake -S GeneralsMD/Code -B build -G "Visual Studio 17 2022" -A Win32@@ -91,52 +143,53 @@ cmake --build build --config Releasectest --test-dir build -C Release --output-on-failure```-`build.example.bat` wraps all three — copy it to `build.bat` and fill in the paths for your machine.+`build.example.bat` wraps all three. Copy it to `build.bat` and fill in the paths for your machine.-To play, put your Steam install's Zero Hour `*.big` files next to the built `generals.exe` in-`GeneralsMD/Run/`, and the **base game's** `*.big` files in `Run/ZH_Generals/` — Zero Hour is not-standalone and mounts both. No disc, no registry keys, no retail installer.+The build copies `generals.exe` into `GeneralsMD/Run/`, which is the only place the game starts. Put+your Zero Hour `*.big` files next to it and the base game's `*.big` files in `Run/ZH_Generals/`,+since Zero Hour is not standalone and mounts both.> [!IMPORTANT]-> Some third-party sources are not committed — EA stripped them. Drop in zlib 1.1.4, LZH-Light 1.0,-> a minimal DirectX 8 SDK, the GameSpy SDK and d3d8to9 before the first build. STLport, the 3DSMax 4-> SDK, NVASM, the Miles and Bink SDKs and the SafeDisk API are **not** needed to build the game —-> sound and video run through the DLLs your own install already ships.+> EA stripped some third-party sources, and they are not committed here either. Drop in zlib 1.1.4,+> LZH-Light 1.0, a minimal DirectX 8 SDK and the GameSpy SDK before the first build. STLport, the+> 3ds Max 4 SDK, NVASM, the Miles and Bink SDKs and SafeDisc are not needed: sound and video run+> through the `mss32.dll` and `binkw32.dll` your own install already has. The stub DLLs of the same+> names in `build/Release/` are link libraries only, and copying one into `Run/` silences the game.++The launcher is a separate Electron project,+[olcayseygan/zhr-launcher](https://github.com/olcayseygan/zhr-launcher).<details>-<summary><b>Tuning — a few things are off by default</b></summary>+<summary>Settings the options screen does not show</summary><br>-All of these live in `Options.ini`, in your Zero Hour Data folder. Back it up first.+Almost everything is on the six pages of the options screen now. These still live only in+`Options.ini`, in your Zero Hour Data folder.-| Key | What it does |+| Line | What it does ||:--|:--|-| `Bloom = 60` | bright things bleed light into the air; `BloomThreshold` sets how much of the picture joins in |-| `StaticGameLOD = Custom` + `MaxParticleCount = 10000` | four times the High preset — much denser explosions and smoke |-| `DynamicLOD = no` | the game never silently downgrades quality mid-match |-| `GridBuildPlacement = No` | restores free building placement |-| `NudgeBuildPlacement = No` | a blocked building stays red under the cursor instead of sliding to the nearest spot that fits |--The rest of the quality switches, all worth turning on: `UseShadowVolumes`, `UseShadowDecals`,-`UseCloudMap`, `UseLightMap`, `ShowSoftWaterEdge`, `ExtraAnimations`, `HeatEffects`, `ShowTrees`,-`BuildingOcclusion`, `TextureReduction = 0`, `AntiAliasing = 4`.+| `ShowAllyCursors = no` | stops sending your mouse position to allies and stops drawing theirs |+| `EdgeScrollInWindowedMode = yes` | scrolls at the screen edge in a window too |-The new shadows and the opening camera are `GameData.ini` keys instead —-`UseShadowVolumesForSkins = No` puts the old flat infantry blobs back, and `StartAtMaxZoom = No`-restores the retail opening view.+On the command line, `-d3d9` starts the old renderer and `-dx11post off` gives the Direct3D 11 picture+without its finishing passes.</details>## Not there yet-- Random maps generate and play, but have no menu entry and no reroll button yet.-- Online and LAN play are untested.+- LAN and online play between separate machines have not been tested. Two copies on one machine play+ each other fine.+- A Direct3D 11 frame still costs more than the old renderer's, 13.6 ms against 8.6 ms on a screen+ full of Inferno Cannon fire. `-d3d9` is the way back.+- Random maps generate and play, and they are out of the skirmish list until the generator stops+ dealing seeds that should not be played. `-randommap <seed>` starts one.---<details>-<summary><b>EA's original README</b></summary>+<summary>EA's original README</summary><br>@@ -192,7 +245,7 @@ This repository is for preservation purposes only and is archived without suppor<div align="center"><sub>-GPL v3 with additional terms — see [LICENSE.md](LICENSE.md).+GPL v3 with additional terms, see [LICENSE.md](LICENSE.md).Preservation release © Electronic Arts.</sub>