Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

godgame_re

A faithful, cross-platform (macOS / Linux / Windows) engine reimplementation of the classic 1989 Bullfrog god game Populous (DOS version), written in C++17 on SDL2. The simulation — settlement growth, walkers, combat, the six divine powers, campaign progression, save games, level passwords — was transcribed routine-by-routine from a disassembly of the original engine, keeping its constants, tables and quirks, and is verified by a test suite against behaviour traced from that disassembly. Rendering, audio and the menu UI are faithful reimplementations rather than transcriptions, and a small number of deliberate differences (timing model, input conveniences, synthesized sound effects) remain.

This repository contains no game assets. You need your own copy of the original game (it is still sold, e.g. on GOG); the engine decodes the original DATA/*.DAT files at runtime.

Grassland Snow & Ice Rock & Lava
Grassland world Snow world Lava world

The four landscape tile sets of the original (grassland, desert, snow & ice, rock & lava) are selected per campaign level from the level's trait record, exactly as in the DOS engine.

Quick start

git clone <this repo> && cd godgame_re
# copy the contents of your game's DATA directory into gamedata/
cp /path/to/your/populous/DATA/* gamedata/

cmake -S . -B build && cmake --build build -j
./build/godgame

See gamedata/README.md for the exact file list; you can also point the POP_DATA environment variable at your data directory.

Building

Prerequisites everywhere: a C++17 compiler, CMake ≥ 3.16 and SDL2.

macOS

brew install cmake sdl2
cmake -S . -B build && cmake --build build -j
./build/godgame

Linux / Unix

Install the dependencies with your package manager:

sudo apt install build-essential cmake libsdl2-dev     # Debian / Ubuntu
sudo dnf install gcc-c++ cmake SDL2-devel              # Fedora
sudo pacman -S gcc cmake sdl2                          # Arch
pkg install cmake sdl2                                 # FreeBSD

then build and run:

cmake -S . -B build && cmake --build build -j
./build/godgame

Windows

Visual Studio + vcpkg (from a Developer Command Prompt, with vcpkg installed and VCPKG_ROOT set):

vcpkg install sdl2:x64-windows
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake
cmake --build build --config Release
build\Release\godgame.exe

MSYS2 / MinGW (UCRT64 shell):

pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-SDL2
cmake -S . -B build -G "Ninja" && cmake --build build
./build/godgame.exe

On every platform the game finds its data by checking POP_DATA, then gamedata/ relative to the working directory, then relative to the executable — so running it from the repository root always works.

Playing

  • Arrow keys scroll the map; left-click/drag raises land, right-click/drag lowers it.
  • The control panel and all keyboard commands use the original bindings from KEYS.DAT (divine powers, zoom, minimap query, game speed, …).
  • Esc opens the GAME SETUP menu (save/load, custom game options).
  • Campaign levels, passwords, the deity score screen and .GAM save games all work as in the original.

Useful flags / environment variables:

--level N          start at campaign level N (also: POP_LEVEL=N)
--selfplay         the computer plays the blue (human) side too — the GAME
                   SETUP menu's PC VS PC mode, enabled from the start
--highres          start in the hi-res upscale mode (needs an optional
                   gamedata/HIGHRES.DAT; H toggles live, also POP_HIRES=1)
--windowed         run in a desktop window; the default is fullscreen,
                   letterboxed with black borders to the 320:200 aspect
--upscale=FILTER   whole-screen magnification filter applied to the finished
                   320x200 frame (not per-asset). FILTER is one of:
                   hq2x hq3x hq4x    (hqx, third_party/hqx)
                   scale2x scale3x scale4x  (EPX / AdvMAME, src/scalers)
--scale N          window scale factor (with --windowed)
--shot FILE.bmp    render one frame headless to a BMP (testing/CI)
--frames N         with --shot: simulate N ticks first

Hi-res upscale mode

If a gamedata/HIGHRES.DAT pack is present (bring-your-own, like all game data — it is built from upscaled repaints of the original art and is never part of this repository), --highres starts the game at 4x resolution and H toggles it live at any time. The classic 320x200 indexed framebuffer stays authoritative for all game logic; hi-res elements carry their own alpha (black source pixels are transparent) and everything without a hi-res counterpart (minimap, gauges) is block-expanded, so both modes always compose the identical frame. Without the pack the flag prints a note and the game runs classic.

Whole-screen upscale filters (--upscale)

Unlike --highres (which swaps in higher-resolution art per asset and needs a data pack), --upscale runs a screen-space magnification filter over the finished 320x200 frame every present — no extra data, works out of the box. The whole composed image (terrain, sprites, HUD, minimap, pointer) passes through the same edge-directed interpolation.

Two algorithm families are provided to compare:

  • hqx (hq2x / hq3x / hq4x) — Maxim Stepin's high-quality filter (vendored in third_party/hqx, LGPL 2.1+). Smooth, rounded edges.
  • Scale/EPX (scale2x / scale3x / scale4x) — the AdvMAME pixel-art scaler (src/scalers.cpp, original implementation). Sharper, preserves more of the pixel structure.

--upscale and --highres are mutually exclusive (--upscale wins); the H live toggle is disabled while a filter is active. Headless --shot ... --upscale=FILTER writes the magnified frame, so filters can be compared from the command line.

Testing

ctest --test-dir build

The test suite verifies the transcribed object-command interpreter, the object simulation, the save-game format and the password generator against behaviour traced from the original executable. The tests run without game data (one optional check uses gamedata/WORLD.DAT when present).

Legal

This is an independent, unofficial preservation project, not affiliated with or endorsed by Electronic Arts. Populous is a trademark of Electronic Arts; the original game and its assets are copyright © 1989 Bullfrog Productions / Electronic Arts.

  • No original game files, artwork, audio or executables are distributed here.
  • The source code in this repository was produced by studying the author's own copy of the game for interoperability with its data files.
  • To play, you must own the original game.

If you are a rights holder and have concerns about this repository, please open an issue and it will be addressed promptly.

License

The source code in this repository is released under the GNU General Public License v3.0. The license covers only the code in this repository, not the original game or its data files.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages