ITADN
yeager/OpenCaptive
yeager/OpenCaptive · 文件
文件最后提交记录最后更新时间
README.md

OpenCaptive

Current release: v1.1.89

A modern C/SDL3 reimplementation of Captive (1990) and Liberation: Captive 2 (1993) by Antony Crowther, published by Mindscape.

OpenCaptive is a verified reimplementation. All 255 work items are complete: data formats, creature stats, combat, audio, map/city generation, viewport rendering, save/load, NPC systems, and presentation paths are validated against original binaries across DOS, Amiga, Atari ST, and CD32 platforms.

Downloads

Pre-built packages for all platforms are available on the Releases page. Maintainers can also run the Release GitHub Actions workflow manually with a version such as 1.1.89; tag-based releases remain supported.

PlatformPackage
Linux x86_64.deb, .rpm, .AppImage, .tar.gz
macOS arm64.dmg (app bundle)
Windows x64Inno Setup installer (.exe)
AndroidAPK (.apk)
iOS arm64Sideloadable IPA (.ipa)

About the games

Captive (1990)

A sci-fi first-person dungeon crawler. You play as a prisoner controlling four battle droids remotely through a briefcase computer. Your droids fight through procedurally generated space bases across 10 planets, battling 25 creature types and solving puzzles to secure your freedom. Originally released for Amiga and Atari ST, later ported to DOS.

Liberation: Captive 2 (1993)

The sequel expands into a cyberpunk city setting with hundreds of interactive buildings, detective-style gameplay, and on CD32 — voice acting and a CD-quality soundtrack. Developed by Byte Engineers. Features procedural city generation, 3D textured rendering, and a reputation system.

Credits

  • Game design and programming: Antony Crowther
  • Published by: Mindscape International
  • Liberation developed by: Byte Engineers
  • OpenCaptive: Daniel Nylander

Features

Both games

  • Hash-verified original data discovery and format decoding
  • Original-resolution presentation paths with verified viewport rendering
  • OPL2 FM synthesis (AdLib emulation) for music and sound effects
  • Optional HQ MIDI output filter (--hq-midi)
  • 19 languages (English, Swedish, German, French, Spanish, Italian, and 13 more)
  • Save/load with multiple slots
  • Optional display enhancements: scanlines, CRT curvature, bilinear filtering, integer scaling
  • Optional xBRZ framebuffer upscaling at 2x, 3x or 4x (--hd-upscale)
  • Optional widescreen presentation (--widescreen), using a 16:9 output or the configured widescreen_width; native game frames remain unchanged
  • Gamepad and keyboard controls

Captive

  • 10-mission campaign with procedural dungeon generation
  • 25 creature types across 8 categories with documented source references
  • 38-item weapon catalog with documented damage tables
  • 112-entry viewport descriptor table extracted from CAPPO.EXE
  • 63 MIDI music tracks across 14 categories
  • 49 AdLib SFX sequences with bytecode interpreter (4 voices, 70 Hz)
  • Intro cutscene playback (ANM format)
  • Holamap planet selection between missions
  • Droid configuration, body part damage, energy system

Liberation

  • Procedural city generation (64×64 grid, 9 building types, 8 visual themes)
  • 3D textured viewport with perspective projection and z-buffer
  • NPC dialogue, shops, bars, police and reputation systems
  • CD audio music playback (10 Red Book tracks from CD32 disc)
  • Speech/voice sample playback
  • Original Amiga/CD32 indexed color palette for city rendering
  • Day/night cycle, taxi system and industrial hazards
  • Building-interior flow, mission briefings and endgame cutscenes
  • Crime system, city destruction, NPC pedestrians and police chase

Start menu

  • Game cards with SHA-256 data verification status (checkmark/cross)
  • Continue game from existing saves
  • Settings panel (24 options: display, audio, language, data path and gameplay)
  • WINDOW SIZE provides presets; changing SCALE explicitly selects a custom native-size window and is preserved when launching from the menu
  • Audio output can be set to 22,050, 44,100 or 48,000 Hz; the choice applies when the next game session starts and is shared by SFX and MIDI playback
  • About/Credits screen
  • Controls reference (F1)
  • In-game F10 runtime popup: change display effects and toggle cheats in real time (God Mode and Infinite Energy work in both games)
  • Data Scanner (D key) — reports verified game files per game
  • Scanner results are cached by file identity and metadata, so unchanged files are not hashed again; the initial scan runs incrementally in the background, while D opens the visible progress view
  • If multiple verified versions of a game are available, launch opens a localized version-selection popup
  • With cross_save=1 or --cross-save-export, Captive F5 saves also create a portable .ocsv file beside the normal save (opencaptive.ocsv or the matching quicksave slot).

Building

Requires CMake 3.20+, a C17 compiler, SDL3, SDL3_ttf, and zlib.

cmake -S . -B build -DCMAKE_C_COMPILER=cc -G Ninja
ninja -C build

Testing

ctest --test-dir build -j4 --output-on-failure

59 tests covering format decoders, game logic, combat, save/load, map generation, audio, rendering, UI, and release-version consistency.

Running

./build/opencaptive --data ~/.opencaptive

Default data paths

PlatformDefault path
Linux / macOS~/.opencaptive
Windows<install dir>\data

Place your game data files (ZIP archives, loose files, ADF disk images) in the data directory. Files are identified by SHA-256 content hash — filenames don't matter. Nested ZIPs, ADF disk images, and ISO tracks are scanned automatically. The scanner reuses cached results for unchanged files and rescans only files whose size, timestamp, or identity changed.

Command-line options

FlagDescription
--data <path>Path to game data directory
--game captive|liberationStart specific game directly
--platform dosCaptive runtime platform (the current playable renderer)
--scale <N>Window scale factor, 1-5 (default: 3)
--lang <code>Language code (en, sv, de, fr, es, it, ja, ko, zh, ...)
--fullscreenStart in fullscreen mode
--verify-data captive|liberationVerify game data and exit
--hd-upscaleApply xBRZ upscaling to native game frames
--upscale-factor <N>xBRZ factor: 2, 3 or 4 (implies --hd-upscale)
--widescreenExpand the game presentation horizontally to 16:9
--hq-midiEnable the enhanced MIDI output filter
--replay-recordRecord Captive inputs to opencaptive.ocrp on exit
--replay-output <file>Select the output file for replay recording
--replay-play <file>Play back a recorded Captive replay
--versionShow version and exit
--helpShow help and exit

Controls

Movement

KeyAction
W / UpMove forward
S / DownMove backward
A / LeftTurn left
D / RightTurn right

Combat and items

KeyAction
SpaceFire weapon
EnterUse item / Interact
TabCycle droids
IInventory

System

KeyAction
F5Save game (also exports .ocsv when cross-save export is enabled)
F9Load game
F6Cycle save slots
MMinimap
Shift+MCity map (Liberation)
HHelp screen
ESCPause menu
F1Controls reference
F10Runtime options popup: display effects, overlays, and cheats

Supported game data

Captive

25 required files identified by SHA-256 content hash, including the two boot resources and the complete first-person atlas. Supported sources:

  • DOS version (CAPPO.EXE, PL5 graphics, CAP_A.BIN sound driver)
  • Amiga ADF disk images (880KB) — verified by --verify-data; native Captive runtime loading is not yet exposed as a playable source
  • Atari ST disk images — format support is available for analysis; no separate Atari runtime source is currently exposed
  • ZIP archives (nested scanning supported)

Liberation: Captive 2

7 required files identified by SHA-256 content hash. Supported sources:

  • CD32 ISO 9660 data track (MODE1/2352)
  • Amiga OCS/AGA floppy ADF images
  • ZIP archives containing the above

Project structure

src/
  engine/     Game engine (start menu, combat, save/load, inventory,
              shop, puzzle, map generation, droid UI, terminal, spawner)
  game/       Liberation runtime (city navigation, dialogue, shops,
              building interaction, combat, NPC dialogue, save)
  render/     SDL3 renderer, 3D viewport, HUD, holamap, compositor
  audio/      OPL2 emulator, AdLib SFX, MIDI player, music, CDDA, speech
  data/       Format decoders (PL5, ANM, RNC, ArcD, CTV, AmSp, VGM,
              x3g, Img, FNT), VFS, SHA-256, i18n, ISO9660, ADF
  custom/     Optional features (replay, cross-save)
include/      Public headers
tests/        60 test source files (59 CTest targets)
docs/         Format documentation, disassembly notes
po/           Translation files (19 languages)
data/         Bundled fonts (DejaVu Sans Mono Bold)
assets/       Icons (SVG, ICO, ICNS)
tools/        Standalone utilities (hash_find, hash_extract)

Reverse engineering

The following components have been cross-referenced against the original binaries:

ComponentSourceMethod
Combat formulasCAPPO.EXE at 0x5380Disassembly
Creature stats (25 types)CAPPO.EXE DS:0xA1BFDisassembly
Weapon damage (38 weapons)CAPPO.EXE DS:0x9A42, 0x1A006Disassembly
SFX mappings (10 events)CAPPO.EXE INT 61h sitesDisassembly
Combat PRNGCAPPO.EXE at 0x9815Disassembly
MapGen cellular automatonCAPPO.EXE at 0x39CC-0x3C21Disassembly
Generator placementCAPPO.EXE at 0x1C3CDisassembly
Item pricingCAPPO.EXE at 0x1A220+Disassembly
CityGen grid (64x64)Amiga CityGen 1.12 (10,824 bytes)Disassembly
BuildingGenAmiga BuildingGen (23,252 bytes)Disassembly
PlotGen / ArcDAmiga PlotGen at 0x302-0x520Disassembly
Game data assetsAll platformsSHA-256 content hash

Wiki

Full documentation is available on the wiki:

References

License

MIT License — see LICENSE.