G3 is the third-generation Olympia play-by-mail (PBM) strategy game engine (~54K lines of C) — the GitHub-era version with refinements over G2, and the ancestor of the TAG engine.
Sibling engine repositories:
This repository is a standalone extraction of the G3 engine from the original multi-engine Olympia monorepo. It builds on its own with CMake.
The code is legacy K&R-style C originally targeting 32-bit systems. A modernization effort is underway to make it compile cleanly on 64-bit systems.
Important
This is a modernization project, not a development project — no new features. The goal is to bring the existing G3 engine to clean C11 on 64-bit while preserving its exact behavior. Golden output is the contract: every change must keep the golden tests passing (byte-identical), and any behavior change must be deliberate, justified, and re-baselined in the same change (PR). New game features, gameplay tweaks, and scope expansion are out of bounds. See BUILD_HISTORY.md for the full modernization record.
olympia-g3— the main game enginemapgen-g3— the map generator (inputsMap/Land/Cities/Regions, outputsgate/loc/road)island-g3— the island generator
Requires CMake (>= 4.1), Ninja, and a Clang or GCC toolchain.
cmake --preset debug
cmake --build --preset debug
# Binaries: build/debug/{olympia-g3,mapgen-g3,island-g3}Presets (see CMakePresets.json): debug (default), release, asan-ubsan
(AddressSanitizer + UndefinedBehaviorSanitizer on all three targets).
Without presets:
mkdir build && cd build && cmake .. && cmake --build .mkdir build32 && cd build32
cmake -DBUILD_32BIT=ON .. # requires gcc-multilib
cmake --build .Build first (default debug preset), then:
# mapgen: generates gate/loc/road (inputs to the olympia run below)
./run/mapgen/mapgen.sh
# olympia: extracts fixtures, runs a turn, saves the database
./run/olympia-g3.sh
# compare the olympia run output against the golden snapshot
./tests/olympia/golden_check.sh # YES = match
./tests/olympia/golden_check.sh --update # refresh the snapshotThe scripts auto-detect the repo root and look for binaries at
build/<preset>/<target> (override the preset with OLYMPIA_PRESET=release ...).
olympia/— the G3 engine sources and headersmapgen/— the map and island generatorslib/— shared support code (entity lists, tiles, roads, allocation, …)tests/— golden-test fixtures and golden filesrun/— run/test driver scripts and scratch run directoriesdoc/— assorted G3 design/reference notes and the modernization playbookCLAUDE.md— working guidance (build, test, conventions)BUILD_HISTORY.md— full phase-by-phase modernization recordAUTHORS.md— authors and credits
See AUTHORS.md. Olympia was created by Rich Skrenta; this repository is maintained and modernized by Michael Henderson.
GNU Affero General Public License v3 — see LICENSE. The original Olympia sources are public domain.