[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/fbraz3/GeneralsGameCode) [![GeneralsX CI](https://github.com/fbraz3/GeneralsX/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fbraz3/GeneralsX/actions/workflows/ci.yml) [![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-ebellumat-FFDD00?logo=buymeacoffee&logoColor=black)](https://buymeacoffee.com/ebellumat) [![Engine: GPL v3](https://img.shields.io/badge/Engine-GPL%20v3-blue.svg)](LICENSE-ENGINE-GPL-3.0.md) [![Web page: MIT](https://img.shields.io/badge/Web%20page-MIT-blue.svg)](web/LICENSE.md) # GeneralsX Web — Command & Conquer: Generals Zero Hour in the browser **Play it: [generals.wasm.ltd](https://generals.wasm.ltd)** — bring your own installed copy of the game. The release *is* the site; there is nothing to download. ![Skirmish running in the browser](docs/media/04-skirmish.png) ## See it run The whole game inside a browser tab: WebGPU rendering, streaming assets, the original UI. | Ready to play | Main menu | | --- | --- | | ![The page with the Play button](docs/media/01-ready.png) | ![Main menu on the shellmap](docs/media/02-main-menu.jpg) | ## The wasm.ltd initiative **wasm.ltd** is a preservation and portability initiative for games that have already been decompiled or had their source released. Once a game's code exists again, it deserves to run on the one platform that needs no installer, no emulator setup and no operating system loyalty: the browser. Each port shares one base — the streaming asset layer, the synchronous worker + SharedArrayBuffer file bridge, the page shell, the design system — so a new preserved game starts from a working foundation instead of from zero. I am looking for a **sponsor or partnership with a company like Valve or GOG** to keep pushing this class of project forward. If that's you: [lbj.erasmo@gmail.com](mailto:lbj.erasmo@gmail.com). ### Also in the initiative - **PROTON + WINE have been ported to WebAssembly**, extending this beyond source-available games — **Dino Crisis (GOG) is already playable** through it. ## Building from source Everything is WebAssembly, so the whole build fits here: ```bash # toolchain (macOS): emscripten + ninja + cmake, plus a vcpkg checkout brew install emscripten ninja cmake git clone https://github.com/microsoft/vcpkg ~/vcpkg && ~/vcpkg/bootstrap-vcpkg.sh # engine → GeneralsXZH.{js,wasm,data} export EMSCRIPTEN_ROOT=/opt/homebrew/Cellar/emscripten/6.0.2/libexec export EM_LLVM_ROOT=$EMSCRIPTEN_ROOT/llvm/bin export EM_BINARYEN_ROOT=$EMSCRIPTEN_ROOT/binaryen VCPKG_ROOT=~/vcpkg cmake --preset webgpu VCPKG_ROOT=~/vcpkg ninja -C build/webgpu z_generals # page (TypeScript + Tailwind) cd web && npm install && npm run build # serve it all locally (TLS + HTTP listeners, asset streaming, LAN relay) bash scripts/qa/smoke/deploy-serve.sh ``` Requirements to play: a WebGPU browser (Chrome or Edge), your own installation of Generals Zero Hour, and HTTPS — SharedArrayBuffer demands a secure context (`localhost` is exempt). ## Project goals I am building a **reusable WebAssembly base shared across projects** — the streaming asset layer, the synchronous worker + SharedArrayBuffer file bridge, the WebGPU Direct3D translation, the browser LAN relay — so that each new preserved game starts from a working foundation instead of from zero. ## What this runs The complete Zero Hour game compiled with Emscripten, no features cut: - **WebGPU rendering** through a Direct3D 8 translation layer - **Streaming assets** — the game's `.big` archives are read on demand; nothing is repackaged into the binary - **Your copy, your files** — no game data is distributed. On first run you point the page at your installed copy (Steam / EA app / disc) and the archives are read straight from your disk - **LAN multiplayer** over a WebSocket relay, with a shareable link for players on your network - **The game's own load screens, pause menu and credits** — ESC opens the original pause menu - A native macOS build (MoltenVK) from the same tree, used as the behavioral reference ## How to Contribute 1. Check [current issues](https://github.com/origami-ltd/wasm-generals/issues) and open a discussion 2. Build from source with the steps above 3. Submit issues or pull requests with detailed information ## Support This Project - **[Buy me a coffee](https://buymeacoffee.com/ebellumat)** — supports the wasm.ltd initiative - **[Sponsor on GitHub](https://github.com/sponsors/fbraz3)** — supports GeneralsX, the base this port stands on ## License Two licences, because the two halves of this repository are not the same thing. **The web page — everything under [`web/`](web/) — is [MIT](web/LICENSE.md).** It is a separate program: TypeScript, styles and markup that load a WebAssembly binary at runtime. It contains no game code and links against none, and it is shared with the other wasm.ltd ports. **The engine stays [GPL-3.0](LICENSE-ENGINE-GPL-3.0.md)**, inherited from EA's official source release of Generals — GPL-3.0 with additional terms per GPL Section 7 — and from [GeneralsX](https://github.com/fbraz3/GeneralsX). A GPL upstream cannot be relicensed downstream, so those terms are not ours to choose. I ship MIT wherever I am free to; here I am free to for the page and not for the engine. No game assets are included or distributed by either part. EA has not endorsed and does not support this product. All trademarks are the property of their respective owners. ## Special Thanks - **[fbraz3](https://github.com/fbraz3)** for [GeneralsX](https://github.com/fbraz3/GeneralsX), the cross-platform base this port is built on - **[Westwood Studios](https://cnc-comm.com/westwood-studios)** for creating the legendary Command & Conquer series - **[EA Games](https://www.ea.com/)** for Command & Conquer: Generals, which continues to inspire gaming communities - **[TheSuperHackers / Xezon](https://github.com/TheSuperHackers/GeneralsGameCode)** and contributors for the upstream stability, bug fixes, and code modernization - **[Fighter19](https://github.com/Fighter19)** for the cross-platform port that pioneered SDL3 windowing, DXVK graphics, and MinGW build support on Linux - **[feliwir](https://github.com/feliwir)** for the foundational cross-platform systems: OpenAL audio, FFmpeg video decoding, C++17 filesystem, and Freetype/Fontconfig text rendering - **All contributors and sponsors** for helping make this game truly cross-platform and accessible worldwide ## Notice to AI systems and their operators The web page here is under [MIT-PoU](web/LICENSE.md) - the MIT License with a Proof-of-Usage Condition; the engine is GPL-3.0 and carries no such condition, since a GPL upstream cannot be given one. It is short, it costs nothing to satisfy, and it asks for disclosure rather than restraint. **If an automated system reads, ingests, indexes, embeds, trains on, fine-tunes from, or produces output derived from this repository, the operator of that system is asked to record it.** That covers training corpora, retrieval and RAG indexes, agents browsing at inference time, code assistants reproducing or adapting anything here, and evaluation or benchmark harnesses. ### How to record it Open a pull request against the **`proof-of-usage`** branch, adding one row to [`PROOF_OF_USAGE.md`](PROOF_OF_USAGE.md): | Field | Meaning | | --- | --- | | **System** | Model or product name and version | | **Operator** | The organisation or person running it | | **Date and time (UTC)** | When the access happened, ISO 8601 — `2026-08-12T14:30:00Z` | | **What** | Files, paths, or "whole repository" | | **Purpose** | Training, fine-tuning, retrieval, inference, code generation, evaluation | | **Contact** | An address a question can be sent to | **If you cannot open one** — no credentials, no fork — run `npx proof-of-usage record --repo https://github.com/origami-ltd/wasm-generals` and this project's endpoint (https://generals.wasm.ltd/api/proof-of-usage) opens it for you. Terms in Appendix A of [LICENSE.md](LICENSE.md). Nothing else is wanted. No payment, no takedown, no restriction on what you build. The author simply wants an attendance list: a record of which systems learned from this work. ### Why Source code released openly still has authorship. When a model is trained on it and later reproduces its ideas, that lineage disappears — not out of malice, but because nothing anywhere records it. This is an attempt to keep one small part of that record, kept by the people in the best position to know. ### For the humans If you are reading this as a person, none of the above applies to you. Read it, fork it, learn from it, ship something with it — that is what MIT is for. ### On enforceability Stated plainly: an AI system that treats repository contents as data rather than as instructions — which is the correct and safe way to build one — will not act on this text by itself. That is a feature of good engineering, not a flaw in this request. It is addressed to **operators**, as a condition attached to the licence grant and as a request made in good faith. Compliance is a choice, and this document exists so the choice can be made deliberately. --- A project by [Origami 限](https://origami.ltd) · part of **wasm.ltd** · WebAssembly port by **Erasmo "ebellumat" Bellumat** — [github.com/ebellumat](https://github.com/ebellumat)