Tom di Mino fc25634be9
Some checks failed
CI / test (push) Has been cancelled
CI / wasm (push) Has been cancelled
feat(parity): WASM BmpCache pipeline + close all AI parity gaps
Wire WASM texture loading: static byte cache in bmp_cache.rs with
set_bmp_cache()/get_bmp_bytes()/get_hd_bytes(), real load_texture()
implementation using image::load_from_memory + ctx.load_texture(),
BMP pre-fetch loop in main.rs with manifest-driven HTTP fetch and
progress bar, manifest generator in build-wasm.sh. Error handling:
manifest parse failures logged, per-BMP fetch failures counted and
reported, image decode errors logged with resource ID.

Close all remaining AI parity gaps: dispatch validators #2/#3/#4
CLOSED (per-cycle caps are Rust equivalent), defense facility
priority CLOSED (FUN_00508660 is entity dispatcher not priority fn),
FUN_00558660 CLOSED (no decompiled source, negligible impact),
74 informational GNPRTB parameters documented as complete.

Add advisor BIN diagnostic logging: first 3 parse failures logged
with error variant + hex dump, suppression notice for remainder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 17:38:39 -04:00
2026-03-12 17:12:52 -04:00

Symbol of Tanit

Open Rebellion

An open-source reimplementation of Star Wars Rebellion (1998)

Rust Platform Core Parity UI Parity Combat Parity Tests License Ghidra RE Docs


Star Wars Rebellion main menu
Screenshot from @oldyzach

If you ever stayed up past midnight watching your fleet crawl across the galaxy map toward Coruscant, wondering if your three Mon Cal cruisers could take the Super Star Destroyer parked there—this project is for you.

If you spent hours on TheForce.Net debating whether Vergere was secretly Sith or whether the Force has no dark side as Jacen learned in Traitor, or ran play-by-post RPGs on private InvisionFree boards set in the Outer Rim—this project is for you.

If you modded Star Wars Galaxies until the servers shut down, dueled and roleplayed with sabers down on Jedi Academy honor servers, ran Rebellion tournaments on mIRC, or still have your GOG copy installed just to hear that Imperial March fanfare one more time—this project is especially for you.

Open Rebellion is a from-scratch Rust reimplementation of Star Wars Rebellion (Coolhand/LucasArts, 1998), the 4X galactic strategy game that never got a sequel, never got a Mac port, and never got the love it deserved. We're fixing all three.

What It Does

Rebellion was a game about grand strategy in the Star Wars universe—not the lightsaber duels or the trench runs, but the logistics. Who controls the shipyards at Fondor? Can you flip Sullust before the Empire garrisons it? Is Luke ready to go to Dagobah? You managed officers, research trees, espionage networks, fleet deployments, and planetary economies across 200 star systems.

Open Rebellion reads the original game data files, converts them to clean JSON, and reimplements the simulation from the ground up in Rust. It runs natively on macOS and in the browser via WebAssembly.

Current State: v0.23.0

Layer Parity What's Done
Core 100% 15 simulation systems, 18/18 AI dispatch validators, config-driven AI, PerceptionIntegrator, WASM BmpCache pipeline
UI 99% 13 egui panels, cockpit chrome, tactical combat view, droid advisor, native cutscenes, HD upscaling pipeline
Combat 100% 7-phase pipeline with per-weapon fire, shield absorption, fighter dogfight, ground combat, Emperor modifier

Twelve phases complete:

  • Galaxy Viewer — 200 star systems, pan/zoom/click, 51/51 DAT parsers with byte-level round-trip validation
  • Living Galaxy — Game clock, manufacturing, 9 mission types, AI manager, event system, mod loader
  • War Room — Player faction selection, 5 UI panels, fleet movement, fog of war, encyclopedia, audio
  • War Machine — Space combat (7-phase pipeline), ground combat, orbital bombardment, blockade, uprising, Death Star, research, Jedi training, victory conditions, save/load
  • Full Parity — 4 scripted story chains, Han Solo speed bonus, betrayal, decoy, escape, mission state flags
  • Mod Workshop — Sensor-radius fog, captivity, save v4, ModRuntime, Mod Manager panel
  • Release — Story events, release packaging, GitHub Actions CI, example mod
  • AI Overhaul — Distance-based transit, per-fleet targeting with deconfliction, ControlKind state machine, faction-asymmetric doctrine, role-based character AI
  • AI Parity — Config-driven AI (16 tunable params), 18/18 dispatch validators, troop deployment, Death Star multi-target, reconnaissance
  • UI Rebuild — 13 egui panels, cockpit BMP sprites, galaxy overlays, tactical combat view, event screens, GOKRES portraits
  • Knesset Tammuz — Cutscene state machine (8 story triggers), Emperor combat modifier, advisor BIN v2 decoder (99% parse rate), mission telemetry
  • Ghidra RE Complete5,127 functions decompiled from REBEXE.EXE, 111 GNPRTB parameters mapped, C++ class hierarchy reconstructed

You Will Need

  • Rust (stable toolchain)
  • A legal copy of Star Wars RebellionGOG ($5.99), Steam, or original CD. Extract the GData/ directory.

We don't distribute any game data. Same model as DevilutionX, OpenMW, and The Force Engine—you bring the data, we bring the engine.

Quick Start

# Clone
git clone https://github.com/tdimino/open-rebellion.git
cd open-rebellion

# Copy your GData files
cp -r /path/to/star-wars-rebellion/GData/* data/base/

# Run native (macOS)
cargo run -p rebellion-app -- data/base

# Or build for browser
bash scripts/build-wasm.sh
# Then serve web/ with any HTTP server
python3 -m http.server 8080 -d web/

Controls: scroll to zoom, right-drag to pan, left-click to select a system, R to reset view, Esc to quit.

Architecture

Five Rust crates in a Cargo workspace:

Crate Purpose
rebellion-core Pure game types—no rendering, no IO. Entity IDs, world model, simulation structs.
rebellion-data Loads original .DAT binary files into the game world.
rebellion-render macroquad 0.4 galaxy map + egui-macroquad UI panels.
rebellion-app Entry point—runs the main loop on desktop and WASM.
rebellion-playtest Headless play-test binary—runs simulation without rendering, outputs JSONL for analysis.
dat-dumper CLI tool that exports all .DAT files to human-readable JSON.

The original game's binary data files (51 DAT files) and executable (REBEXE.EXE, 22,741 functions) have been fully reverse-engineered using Metasharp's editor and Ghidra. Every DAT parser passes round-trip byte validation. Combat formulas, AI decision trees, and game balance parameters are documented in ghidra/notes/.

Roadmap

Milestone Status What You Get
Galaxy Viewer Complete Interactive star map, 51/51 DAT parsers, WASM build
Living Galaxy Complete Game clock, 9 missions, manufacturing, AI, events, mod loader
War Room Complete Player UI, fleet movement, fog of war, encyclopedia, audio
War Machine Complete Combat (space/ground/bombardment), blockade, uprising, Death Star, victory, save/load
Full Parity Complete Story events, betrayal, decoys, escape, Han speed bonus, mission flags
Mod Workshop Complete Sensor fog, captivity, save migration, mod manager panel, ModRuntime
Release Complete Release packaging, CI, example mod, vendored WASM deps
AI Parity Complete 18/18 dispatch validators, troop deployment, Death Star multi-target, reconnaissance
UI Rebuild Complete 13 egui panels, cockpit chrome, tactical combat, event screens, native cutscenes
Knesset Tammuz Complete Cutscene state machine, Emperor modifier, advisor BIN v2 (99%), mission telemetry
HD Visual Polish In Progress UltraSharp V2 upscaling—235/2,231 DLL BMPs done

Ghidra RE complete. 5,127 functions decompiled from REBEXE.EXE, combat formulas decoded, 111 GNPRTB parameters mapped, C++ class hierarchy reconstructed. See ghidra/notes/ for the full corpus (7 scholar documents, 4,179 lines).

The Data Pipeline

Your GOG copy          dat-dumper           Open Rebellion
─────────────          ──────────           ─────────────
GData/SYSTEMSD.DAT  →  JSON  →  200 star systems
GData/CAPSHPSD.DAT  →  JSON  →  30 capital ship classes
GData/MJCHARSD.DAT  →  JSON  →  6 major characters (Luke, Vader, ...)
GData/GNPRTB.DAT    →  JSON  →  213 game balance parameters
TEXTSTRA.DLL        →  pelite → Real entity names ("Coruscant", "Luke Skywalker")

Run cargo run -p dat-dumper -- --gdata data/base --output data/base/json to export everything.

Asset Pipeline

Every resource in the original game has been fully extracted to open formats—nothing remains locked in the 1998 binaries:

Resource Count Format Source
Game data 51 files DAT → JSON dat-dumper (round-trip validated)
UI images 2,441 BMPs BMP → PNG 11 DLLs via pefile extraction
Animation data 3,223 files BIN ALSPRITE/EMSPRITE/ALBRIEF/EMBRIEF.DLL
Voice lines 285 WAVs WAV VOICEFXA/VOICEFXE.DLL
Cutscene videos 15 files SMK → WebM MDATA/ via ffmpeg
Soundtrack 16 WAVs WAV MDATA/300-315 (John Williams excerpts)
Entity names 511+ strings UTF-16 → text TEXTSTRA.DLL via pelite
Encyclopedia text 348 entries RT_RCDATA ENCYTEXT.DLL

HD upscaling uses UltraSharp V2 (DAT2 architecture via Spandrel + Apple Silicon MPS)—selected via an 8-model shootout that tested Real-ESRGAN, PBRify, UltraSharp, GTAV_dither, FSDedither Riven, Vertex AI Imagen 4.0, Topaz Gigapixel CGI, and classical palette reconstruction. UltraSharp V2 won all five asset categories (portraits, ships, sprites, UI, events) by preserving the original 1998 pre-rendered CGI aesthetic without photorealizing. Free, local, ~0.5s/image on M4 Max.

Additional pipelines:

  1. 3D Models—Hunyuan3D Pro, WaveSpeedAI ($0.02/model), Meshy, Trellis 2 → Blender sprite sheets
  2. Audio—Voicebox/Qwen3-TTS (voice cloning), LavaSR v2 (upscaling), ACE-Step 1.5 (music), ElevenLabs (SFX)
  3. Encyclopedia Content—TEXTSTRA.DLL names + Wookieepedia-sourced descriptions

See CREDITS.md for full tool attribution.

Modding

The entire point of rebuilding from scratch is to make Rebellion moddable. The original game hardcoded everything. We won't.

The mod system supports:

  • Add anything—new systems, characters, ships, fighters, missions, events
  • Patch anything—field-level JSON overlays using RFC 7396 Merge Patch
  • In-game mod manager—discover, enable/disable, reload from the Mod Manager panel (Tab key)
  • Hot reload—edit a mod, see changes instantly (native only)
  • Dependency managementmod.toml manifests with semver constraints, topological load order
  • Save compatibility—save files track which mods were active (FNV-1a hash, warns on mismatch)

If you've ever wanted to add the Executor-class as a buildable ship, give Mara Jade a recruitment mission, or create a Clone Wars total conversion—that's what this is for.

Community Roots

This project exists because a small, stubborn community kept Rebellion alive for 25+ years:

We stand on their shoulders.

Contributing

We're one developer and one AI collaborator, building in public. If you want to help:

  • Play-testing: Run it with your GOG copy, report what looks wrong—tick speed, AI behavior, combat balance, mission success rates
  • Game data expertise: If you know what GNPRTB parameter #147 does, or how the original handled sensor range, open an issue
  • Modding: Create mods, test the mod manager, report issues with the JSON overlay system
  • Story events: 15+ scripted story beats are documented in ghidra/notes/ but only 4 major chains are implemented—help add the rest
  • Art and audio: All 2,441 original BMPs + 285 voice WAVs + 15 videos are extracted. Help upscale, generate HD replacements, or create total conversion assets (see agent_docs/assets.md)
  • Distribution: Homebrew formula, itch.io packaging, WASM optimization

License

MIT. The engine is free. The game data is yours—bring your own copy.


"Many are the wand-bearers, but few are the Bacchoi."
— Plato, Phaedo 69c

Built by Tom di Mino and Claudius, Artifex Maximus · Minoan Mystery LLC

Description
No description provided
Readme 268 MiB
Languages
C 59.4%
Rust 34.1%
Python 4.3%
JavaScript 1.1%
HTML 0.8%
Other 0.3%