GeneralsGameCode is a community-driven project aimed at fixing and improving the classic RTS game, Command & Conquer: Generals and its expansion Zero Hour. This repository contains the source code for both games, with a primary focus on Zero Hour.
Additionally, there is a complementary project repository for fixing and improving game data and assets such as INI scripts, GUI, AI, maps, models, textures, audio, localization. You can find it here and contribute to it as well.
The game was originally developed using Visual Studio 6 and C++98. We've updated the code to be compatible with Visual Studio 2022 and C++20.
The initial goal of this project is to fix critical bugs and implement improvements while maintaining compatibility with the original Generals version 1.08 and Zero Hour version 1.04. Once we can break retail compatibility, more fixes and features will be possible to implement.
Here's an overview of our current focus and future plans
- Modernizing the Codebase: Transitioning to modern C++ standards and refactoring old code.
- Critical Bug Fixes: Fixing game-breaking issues (e.g., fullscreen crash).
- Minor Bug Fixes: Addressing minor bugs (e.g., UI issues, graphical glitches).
- Cross-Platform Support: Adding support for more platforms (e.g., Linux, macOS).
- Engine Improvements: Enhancing the game engine to improve performance and stability.
- Client-Side Features: Enhancing the game's client with features such as an improved replay viewer and UI updates.
- Multiplayer Improvements: Implementing a new game server and an upgraded matchmaking lobby.
- Tooling Improvements: Developing new or improving existing tools for modding and game development.
- Community-Driven Improvements: Once the community grows, we plan to incorporate more features, updates, and changes based on player feedback.
To run Generals or Zero Hour using this project, you need to have the original Command & Conquer: Generals and Zero Hour game installed. The easiest way to get it is through Command & Conquer The Ultimate Collection on Steam. Once the game is ready, download the latest version of the project from GitHub Releases, extract the necessary files, and follow the instructions in the Wiki.
You can chat and discuss the development of the project on our Discord channel to get the latest updates, report bugs, and contribute to the project!
We provide support for building the project on Windows and Linux. For detailed build instructions, check the Wiki, which includes guides for VS6, VS2022, Docker, CLion, and links to forks supporting additional versions.
Windows — x64 modernization toolchain (MinGW-w64 + Ninja)
powershell -ExecutionPolicy Bypass -File .\scripts\setup-windows-dev.ps1
cmake --preset mingw64-tests
cmake --build --preset mingw64-tests
ctest --preset mingw64-tests --output-on-failureThe bootstrap installs/verifies the MSYS2 x86_64 GCC toolchain, WIDL, CMake, Ninja, Python and Git. The Visual Studio IDE is not required. Step 04D now gives mingw64-tests a renderer-free deterministic/headless production RNG/CRC/FPU timeline gate. It is still not a claim that the legacy D3D8 game executable is already Win64.
The frozen i686 determinism oracle is optional and receives no new features:
powershell -ExecutionPolicy Bypass -File .\scripts\setup-windows-dev.ps1 -IncludeLegacyX86
cmake --preset mingw-w64-i686-determinism
cmake --build --preset mingw-w64-i686-determinism --target z_determinismcheckThe existing mingw32-release / MSVC paths remain temporary legacy/reference builds while x64 deterministic parity is established.
Linux (via Docker)
./scripts/docker-build.sh # Build using Docker
./scripts/docker-install.sh --detect # Install to your gameThe repository uses a vcpkg manifest (vcpkg.json). Dependency versions come from the builtin-baseline commit
recorded there, with per-port overrides when a specific version is required. Update the baseline to pick up new
versions. GitHub Actions consumes these ports through a vcpkg binary cache backed by a NuGet feed on GitHub
Packages, keyed by vcpkg's own ABI hashes, so the first CI build warms the feed and subsequent builds pull prebuilt
binaries instead of re-compiling everything. Pull requests from forks restore from the feed but cannot write to it.
The canonical MinGW profile preset is mingw32-profile. Completed Step 03 enables observational schema-v2 update/render/visibility/resource telemetry in that build; set RTS_PERF_CAPTURE=<path.csv> at runtime and summarize it with python scripts/perf-summary.py <path.csv>. RTS_PERF_CAPTURE=1 writes RTSPerfCapture.csv in the process working directory. See Modernization/STEP_03_PERFORMANCE_TELEMETRY.md.
The staged x64 migration uses the focused mingw64-tests preset and the one-command scripts/setup-windows-dev.ps1 bootstrap. Step 04D now adds a shared deterministic FP policy and a fixed-width 12k-frame headless RNG/CRC timeline on top of the Step 04C native-width runtime substrate; the legacy D3D8 executable is still not treated as the x64 target. See Modernization/STEP_04_X64_MIGRATION.md.
Tracy profiling is also supported by the existing win32-profile path and can be enabled independently for other builds through RTS_BUILD_OPTION_PROFILE_TRACY. Use tracy-profiler.exe from Tracy v0.13.1. If you get an error when using Tracy, try removing dbghelp.dll from the game binary directory.
We welcome contributions to the project! If you’re interested in contributing, you need to have knowledge of C++. Join the developer chat on Discord for more information on how to get started. Please make sure to read our Contributing Guidelines before submitting a pull request. You can also check out the Wiki for more detailed documentation.
EA has not endorsed and does not support this product. All trademarks are the property of their respective owners.
This project is licensed under the GPL-3.0 License, which allows you to freely modify and distribute the source code under the terms of this license. Please see LICENSE.md for details.
This repository is also the authoritative baseline for a long-term engine modernization track focused on high-poly/HD mod performance, x64, Direct3D 12, and W3D/W3X asset support.
Start with MODERNIZATION.md and PROJECT_STATE.md. The ordered implementation roadmap is in Modernization/ROADMAP.md.
Step 04D3 upstream alignment is documented in Modernization/STEP_04D3_UPSTREAM_ALIGNMENT.md.
The Evolution renderer target is x64 + Direct3D 12. The existing Direct3D 8-era path remains a temporary compatibility/reference renderer during migration; no D3D9 or D3D11 intermediate renderer is planned.