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(clouds): describe the capability split and the classic default
Richard Louie Orilla021890406362
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bc156ca2c..8f90c659b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,18 @@ found and fixed — EA's own, not port damage.**---+## Volumetric hazard clouds++- Options > Graphics has a Cloud style choice, Classic or Volumetric, that switches live.+ Classic, the original toxin and radiation effects, stays the default; Volumetric is an+ opt-in while its cost in a crowded battle is measured.+- Volumetric draws the toxin, beta, gamma and nuclear fields as moving smoke with the+ hazards' actual radii and lifetimes. Low smoke follows the terrain and stirs around+ visible infantry; nuclear fields fade in across their whole area with darker billows,+ rising embers and heat shimmer. Gameplay damage and simulation are unchanged.+- It needs a renderer that supports it, today the SDL GPU renderer on Linux and macOS.+ Elsewhere the choice is hidden. A field it cannot admit keeps the Classic effect.+## A rank ladder for every army- Three chevrons are now a whole army's ladder. An American unit climbs 28 promotions from E-1 Private to General of the Army, a Chinese one 19 from Private to General, a GLA one 20 from Recruit to Supreme Liberator. Every unit starts unranked with a bare health bar and no bonus; from the first promotion on, each grade wears its own insignia beside the health bar and floats it up over the unit's head the moment it is earned. Hover the portrait for the rank's name and how far the next one is: "Next rank 340/420 XP".@@ -2340,16 +2352,3 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- Internet play. LAN works: two separate PCs have played each other on one network. Matches over the internet wait on Reforged's own lobby server, which is still on paper.- A frame through Direct3D 11 still costs a little more than it does through the old renderer: 7.6ms against 6.3ms in a screen full of inferno cannon fire. `-d3d9` on the command line puts the old renderer back on its own.- You need to own the game; no game data ships here.--## Volumetric hazard clouds on Linux (2026-10-18)--- Cloud style appears on the Graphics page, with live Classic / Volumetric- choices. The shared demo renderer now draws the game's toxin, beta, gamma and- nuclear fields using the approved colors, actual hazard radii and lifetimes.-- Low smoke follows terrain and responds visually to passing infantry. Nuclear- fields fade in across their full area, with darker billows, rising embers and- heat distortion. The renderer has bounded caches and preserves Classic effects- when a field cannot be admitted; gameplay damage and simulation are unchanged.-- The preview has per-cloud color, brightness and transparency controls, with- structures, props and baseline water for judging visibility. The approved preset- uses 67% toxin, 77% beta and 74% gamma transparency; nuclear remains at 0%.diff --git a/docs/hazard-clouds.md b/docs/hazard-clouds.mdnew file mode 100644index 000000000..4fc64cbd7--- /dev/null+++ b/docs/hazard-clouds.md@@ -0,0 +1,59 @@+# Volumetric hazard clouds++**Options → Graphics → Cloud style** selects **Classic** or **Volumetric**. Classic, the original+toxin and radiation ground effects, is the default; Volumetric is an opt-in. Switching applies live+and persists as `CloudStyle = 0` or `CloudStyle = 1` in Options.ini. The choice is independent of+the particle and smoke-shadow settings.++## How it is split++- **Neutral core**, built on every platform: `Platform/HazardCloud.h` (the renderer API: field and+ body types, palettes, the abstract `HazardCloud::Layer`, `HazardCloud::Supported()` and+ `HazardCloud::CreateLayer()`), `Platform/HazardCloudPolicy.h` (which templates are which hazard,+ build-up, validity), `HazardCloudFlow` (the planar smoke-transport simulation; no graphics device),+ `HazardCloud.cpp` (approved palettes, cache estimate), and the field tracking in+ `W3DParticleSys.cpp`.+- **SDL GPU backend**, built where the SDL GPU renderer is (Linux and macOS):+ `PosixDevice/Render/SdlHazardCloud*.cpp`. `Supported()` is true when the device in use is the SDL+ GPU device and it provides a sampleable scene depth plus the R16F/RGBA16F/RGBA32F formats the+ clouds use. Its shaders go through `SDL3_Create_Shader`, so Metal gets them transpiled from SPIR-V.+- **No backend**, everywhere else (Windows today): `HazardCloudUnsupported.cpp`, where `Supported()`+ is false and `CreateLayer()` returns null. A Direct3D 11 backend replaces this file and implements+ `HazardCloud::Layer`.++Without a supported backend the selector is hidden and the ground fields behave exactly as before+this change: the extended field tracking (fields keyed by height and owner, owner binding for+nuclear pulses, the sparse-emitter grace rule, skipping systems still in their initial delay) runs+only when the backend supports clouds. The answer is taken once per device and cached; when it+changes, the field tables are cleared before their key ordering changes.++## What Volumetric draws++Approved green toxin, blue beta, purple gamma and amber nuclear palettes use transparency defaults+of 67%, 77%, 74% and 0%. Effects read their actual emission radius and hazard lifetime. Toxin+billows form outward; nuclear haze fades into its full footprint. Formation is capped to one quarter+of short hazard lifetimes. Visible infantry stir the smoke; hidden, stealthed or shrouded infantry+leave no wakes. Nothing here changes damage, weapons, movement, gameplay randomness or simulation+state: Classic and Volumetric runs of the same scenario give the same game-state CRC.++Everything the clouds read from the game (field owners and their remaining lifetime, infantry+positions, visibility and shroud) is taken in `updateGroundFields` at the sync point, through+`W3DParticleSystemManager::takeReadsForRender`; the draw reads only those copies and the render+terrain heights.++The client admits at most eight visible cloud layers within a 192 MiB atlas-cache budget.+Over-budget fields, unknown effects and missing GPU resources keep the Classic effect. Clouds draw+after opaque geometry and water in the main scene; reflection and custom passes leave the+main-view caches and wakes alone. Caches and wakes reset on map or device changes.++The support model follows height-map terrain or an elevated plane. Cliffs and crossing decks have no+dedicated fixture or automatic geometry fallback: one height per XY sample cannot represent+several support surfaces within a field. Exactly coincident owners of the same palette cannot be+told apart by position.++## Tests++```sh+cmake --build build-linux --target generals test_hazard_cloud_policy test_gameengine sdl_gpu_frame_selfcheck+ctest --test-dir build-linux --output-on-failure -R '^(test_hazard_cloud_policy|test_gameengine|sdl_gpu_frame_selfcheck)$'+```diff --git a/docs/linux.md b/docs/linux.mddeleted file mode 100644index 2825fd37c..000000000--- a/docs/linux.md+++ /dev/null@@ -1,53 +0,0 @@-# Linux hazard clouds--On Linux, **Options → Graphics → Cloud style** selects **Classic** or **Volumetric**. Volumetric is the default; switching applies-live and persists as `CloudStyle = 0` or `CloudStyle = 1` in Options.ini. The choice-is independent of the existing particle and smoke-shadow settings. Other platforms keep their-existing ground fields and hide this selector.--The game shares its volume renderer with the [isolated preview](cloud-preview.md).-Approved green toxin, blue beta, purple gamma and amber nuclear palettes use-transparency defaults of 67%, 77%, 74% and 0%, respectively. The exact linear RGB,-brightness and transparency values are retained in-[preferred.ini](../GeneralsMD/Code/Tools/cloud_preview/presets/preferred.ini) and the-matching compiled defaults. Preview palette files affect only the preview.-Increasing transparency reduces optical thickness and self-shadowing; 100% hides-smoke while nuclear heat and embers remain visible.--Supported effects read their actual emission radius and hazard lifetime. Toxin-billows form outward; nuclear haze fades into its full footprint. Formation is-capped to one quarter of short hazard lifetimes. Visible infantry stir the smoke;-hidden, stealthed or shrouded infantry contribute no new wakes. These effects do-not change damage, weapons, movement, gameplay RNG or simulation state.--The client admits at most eight visible cloud layers within a 192 MiB atlas-cache-budget. Over-budget fields, unknown effects and unavailable GPU resources keep-Classic fallback. Rendering runs after opaque geometry and water in the main-scene; reflection and custom passes leave the main-view cloud caches and wakes-alone. Caches and wakes reset on map or device changes.--The support model follows height-map terrain or an elevated plane. Cliffs and-crossing decks have no dedicated production fixture or automatic geometry-fallback; one height per XY sample cannot represent multiple support surfaces-within a field. The overlap fixture separates its owners: position-based emitter-association cannot distinguish exactly coincident owners of the same palette.--From an already configured Linux Release build with existing dependencies:--```sh-cmake --build build-linux --target generals cloud_preview \- test_hazard_cloud_policy test_gameengine-ctest --test-dir build-linux --output-on-failure \- -R '^(test_hazard_cloud_policy|test_gameengine)$'-```--`cloud_preview` is excluded from the default build and is available only when-Python 3 was found at configuration. The game does not depend on its scene-controller, palette editor or generated inspection map. See the-[preview guide](cloud-preview.md) for controls and standalone CPU checks, and the-[production runtime guide](../GeneralsMD/Code/Tools/cloud_preview/runtime-check.md)-for preparing a retail file-link root with `replay-check.sh --keep` and running-real hazard fixtures. The runtime harness records executable/input hashes, logs,-CRCs and captures in each new output directory. Inspect the captures and measure-representative scenes separately: a passing harness does not establish image-quality, crowded-battle performance or Windows/macOS runtime compatibility.diff --git a/docs/porting/windows-impact.md b/docs/porting/windows-impact.mdindex 16da4f9e2..9ec906324 100644--- a/docs/porting/windows-impact.md+++ b/docs/porting/windows-impact.md@@ -444,18 +444,12 @@ These do not belong to one change.| **A `Debug` or `_INTERNAL` build of this tree does not compile on x64, and did not before this port started.** | **Windows, 2026-09-29: done for x64 Debug; `_INTERNAL` not built.** The build and what it then found are fixed: a Debug CI run on the Windows CI VM (`windows-ci.ps1 -Config Debug`): the build, ctest 50 of 50 with order_cameos_selfcheck skipped (no numpy there), the GPU tests, and E1 0@1200 playing back to 0xE5C34BF3, Release's pin. Before that, as found on 2026-09-27: `windows-ci.ps1 -Config Debug` on 2026-09-27 stops in `wwdebug` at `Debug.h:244`. A port change spelled `SimpleProfiler`'s four counters `Int64`, which wwdebug's files do not declare; `__int64` was the compiler's own. Only wwdebug compiles `DEBUG_PROFILE`, because only it lacks `RELEASE_DEBUG_LOGGING`. Three Debug-only test links fail too: `GameEngineDebug.lib` (gametext_csf, test_premain_strings, test_premain_unicode), `debugdebug.lib` (test_debug), and `DebugLog` (test_wwdownload). The fix is in this tree now. `GameCommon.h:59` defines `DUMP_PERF_STATS` in every `_DEBUG` or `_INTERNAL` build. `PerfTimer.h` compiled `GetPrecisionTimer` under that define, and its body was an `__asm RDTSC` block — `USE_QPF` was never defined, so the assembly was the live branch, not the dead one. This project is x64 only (`CMakeLists.txt:48-52` refuses anything else) and **MSVC does not accept `__asm` on x64 at all**. `-DPERF_TIMERS=ON` reaches the same code in a Release build. Found by B2, which has replaced the block with the clock shim, so the configurations should build again — but nobody has confirmed either the breakage or the fix on a Windows machine, and the conclusion rests on reading the preprocessor rather than on a compiler's answer. **It also means an early claim that "every remaining `__asm` block is inside `#if 0`" was wrong**; it has been corrected. The only other `__asm` in the tree, `WWMath/vp.cpp`, is expanded solely inside `#if defined(__ICL)` and is genuinely dead. || **`#pragma pack` layout is assumed, not measured, on MSVC.** | **Windows, 2026-09-27: checked.** The B4 and L1 `sizeof`/`offsetof` asserts compile under MSVC (rows 208, 248, 267). B4 adds `sizeof`/`offsetof` asserts. They will be checked by a clang build only. If MSVC disagrees on any packed struct, the asserts fire there and the build fails loudly — which is the good outcome, but it happens on someone else's machine, later. |-## Linux hazard cloud proposal (2026-10-19)+## Volumetric hazard clouds (2026-10-22)-The production volume implementation and preview target compile on Linux. The-new particle recognition, owner/lifetime tracking, terrain caches and infantry-wakes are enabled only on Linux. Other platforms retain their original ground-fields; shared option metadata and no-op resource hooks still compile there.-`SdlRenderMatrix.h` is a small, pure matrix helper. Scene-depth capture and-vertex texture bindings are generic prerequisites; no other rendering feature is included. Windows and-macOS compilation and runtime validation remain open.--The independent review restored non-Linux field-key grouping, owner selection,-emitter grace periods and initial-delay behavior. An `unifdef` MSVC/macOS view-comparison against reference/3.1.0 confirms that the key, owner lookup and fade-function bodies retain their original source after preprocessing. This textual-check does not establish compiler or runtime compatibility.+Windows compiles the neutral cloud core (`Platform/HazardCloud.h`, `HazardCloudPolicy.h`,+`HazardCloudFlow`, `HazardCloud.cpp`) and links `HazardCloudUnsupported.cpp`, so+`HazardCloud::Supported()` is false there: the Cloud style selector is hidden and the ground fields+take upstream's original keys, owner choice, grace period and initial-delay behaviour, because every+extended rule in `W3DParticleSys.cpp` is conditioned on that capability. The SDL backend+(`SdlHazardCloud*.cpp`) is built only where the SDL GPU renderer is. A Direct3D 11 backend would+replace `HazardCloudUnsupported.cpp` and implement `HazardCloud::Layer`.