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.
You need the original Command & Conquer: Generals and Zero Hour game data to play. The easiest way is through Command & Conquer The Ultimate Collection on Steam.
For the experimental rolling Windows x64, macOS Apple Silicon, and Linux x86_64 bgfx builds from this fork, see Installing and Playing.
Windows: Download the latest build from GitHub Releases, extract into your game directory, and follow the Wiki instructions.
macOS / Linux: Steam does not offer a macOS or Linux download. See Getting the Game Files for three ways to obtain the retail data (copy from Windows, SteamCMD, or CrossOver).
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, Linux, and macOS. For detailed build instructions, check the Wiki, which includes guides for VS6, VS2022, Docker, CLion, and links to forks supporting additional versions.
Windows (Visual Studio 2022)
cmake --preset win32
cmake --build build/win32 --config ReleaseLinux (via Docker)
./scripts/docker-build.sh # Build using Docker
./scripts/docker-install.sh --detect # Install to your gamemacOS (Apple Silicon / Intel)
Requires Xcode command line tools and Homebrew. Uses bgfx (Metal), SDL3, and OpenAL.
xcode-select --install
brew install cmake ninja dylibbundler ffmpeg sdl3 openal-soft
scripts/build/macos/build-macos-generalsmd.shThis builds and deploys to ~/TheSuperHackers/GeneralsZH/. Before launching, you need
the retail game data — see Getting the Game Files.
scripts/build/macos/fetch-game-data.sh # open-source INI/UI/Art data
# copy retail .big files into ~/TheSuperHackers/GeneralsZH/
# copy retail Data/Cursors/*.ani into ~/TheSuperHackers/GeneralsZH/Data/Cursors/
# copy retail Data/Scripts/*.scb into ~/TheSuperHackers/GeneralsZH/Data/Scripts/
~/TheSuperHackers/GeneralsZH/run.sh # launchThe repository uses a vcpkg manifest (vcpkg.json) paired with a lockfile (vcpkg-lock.json). When you add or upgrade
dependencies, run vcpkg install --x-manifest-root . --triplet <triplet> with VCPKG_FEATURE_FLAGS=versions so the
lockfile picks up the new versions and include the updated lockfile in your change. GitHub Actions consumes these ports
through VCPKG_BINARY_SOURCES=clear;files,<workspace>/vcpkg-bincache,readwrite (paired with an actions/cache entry for
that folder), so the first CI build warms the cache and subsequent builds pull prebuilt binaries instead of
re-compiling everything.
Tracy profiling is supported in the CMake preset win32-profile.
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.