Skip to content

About

Olympia G2 — second-generation standalone play-by-mail game engine (HTML reports, tunnels)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Olympia G2

G2 is the second-generation Olympia play-by-mail (PBM) strategy game engine (~53K lines of C). It builds on G1, adding HTML reports and tunnels, and is the ancestor of the later G3 and TAG engines.

Sibling engine repositories:

This repository is a standalone extraction of the G2 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 G2 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 commit. New game features, gameplay tweaks, and scope expansion are out of bounds. See BUILD_HISTORY.md for the full modernization record.

Targets

  • olympia-g2 — the main game engine
  • mapgen-g2 — the map generator (inputs Map/Land/Cities/Regions, outputs gate/loc/road)

Building

Requires CMake (>= 4.1), Ninja, and a Clang or GCC toolchain.

cmake --preset debug
cmake --build --preset debug
# Binaries: build/debug/olympia-g2, build/debug/mapgen-g2

Presets (see CMakePresets.json): debug (default), release, asan-ubsan (AddressSanitizer + UndefinedBehaviorSanitizer for olympia-g2).

Without presets:

mkdir build && cd build && cmake .. && cmake --build .

Running / golden tests

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-g2.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 snapshot

The scripts auto-detect the repo root and look for binaries at build/<preset>/<target> (override the preset with OLYMPIA_PRESET=release ...).

Layout

  • olympia/ — the G2 engine sources and headers
  • mapgen/ — the map generator
  • lib/ — shared support code (entity lists, tiles, roads, allocation, …)
  • tests/ — golden-test fixtures and golden files
  • run/ — run/test driver scripts and scratch run directories
  • doc/ — assorted G2 design/reference notes
  • CLAUDE.md — working guidance (build, test, conventions)
  • BUILD_HISTORY.md — full phase-by-phase modernization record
  • AUTHORS.md — authors and credits

Authors

See AUTHORS.md. Olympia was created by Rich Skrenta; this repository is maintained and modernized by Michael Henderson.

License

GNU Affero General Public License v3 — see LICENSE. The original Olympia sources are public domain.

About

Olympia G2 — second-generation standalone play-by-mail game engine (HTML reports, tunnels)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages