Recruitment location is now independent — a Corellian operative could
be waiting at Nar Shaddaa. Homeworld-controlled is one condition among
many, not the default. Both mode explanation expanded.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Not all neutral. Alliance-leaning, Empire-leaning, and Neutral
affinities based on homeworld control + archetype. Neutral characters
(especially Fringers) can be recruited by either side.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Leia's homeworld marked as "(destroyed)" — she carries permanent -5%
- Imperial cog brightened from dark #2E7D32 to game-accurate #00CC00
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrites the Homeworld Expansion page to cover both character creation
modes: Academy (design upfront) and Recruitment (discover mid-game).
Adds faction affinity, 7 recruitment conditions, neutral candidate
race mechanic, and "Both" combined mode.
Also restores dark Tanit to original aspect ratio (567x662).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Alternative to Academy Mode: 6–10 recruitment candidates spawn across
the galaxy with pre-rolled archetypes and conditions. Neutral candidates
create faction races. Force-sensitive recruits are rare strategic assets.
Three modes: Academy (create at start), Recruitment (discover mid-game),
or Both (1 created + 4–6 candidates). ~350 LOC estimate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Dark Tanit restored to original 567x662 (was squished to 512x512)
- Imperial cog colorized to dark green (#2E7D32)
- Faction icons removed from 4 guide pages (scenario, combat, galaxy, economy)
— kept only on Factions, Homeworld, and Victory (sparingly)
- Nav reordered: Scholar Docs → Combat → Setup → Expansions → Indexes → Game Guide
(dev-focused content first, game guide last)
- Homeworld archetype table: added Loyalty column
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Game Guide: scenario, factions, characters, tech trees, missions
(5 new pages with faction symbols, written as readable game guide)
- Fixed image paths: absolute /open-rebellion/assets/ for GitHub Pages
- Fixed em dashes: all spaced " — " → connected "—" per style guide
- Added .gitignore for site/ build output
- SWG/Rome TW/CK inspiration note on Homeworld page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Parity badges: Core 95% · UI 80% · Combat 60% (replaces single 95%)
- Tests badge: 283 passing (was 266)
- Current State section rewritten with parity table + 9 phases
- Ghidra RE links to live docs site at tdimino.github.io/open-rebellion/
- New badge linking to Ghidra RE documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 5 of documentation overhaul. Publishes the 14 Ghidra RE scholar
documents (original analysis, not decompiled code) via mkdocs-material
at tdimino.github.io/open-rebellion/.
- mkdocs.yml: Material theme, slate/amber dark mode, search, code copy
- 14 scholar docs synced from gitignored ghidra/notes/ via build script
- Theme-aware Tanit: dark (worldwarwatcher cyan glow) / light (claude-code-minoan black+gold)
- Faction symbols from Wookieepedia: Rebel starbird, Imperial cog,
Jedi Order, Old Republic (KOTOR), EU/Legends badge, LucasArts logo
- GitHub Actions workflow for auto-deploy on push to ghidra-site/
- Custom CSS for dark/light logo switching
To preview locally: bash ghidra-site/scripts/build-ghidra-site.sh && cd ghidra-site && python3 -m mkdocs serve
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase E: Diplomacy missions now flip system control when popularity
crosses 0.6 with a 0.1 lead. This creates more controlled territory,
giving the AI more diverse attack targets and spreading battles across
the galaxy instead of concentrating at a few systems.
Also includes two fog-of-war research documents:
- Researcher: industry survey (Civ/Stellaris/HOI4/Kohan II), 3 approaches
- Nomos blueprint: Skotia cognitive architecture with confidence decay,
sensor model, scout-before-attack pattern, ~490 LOC estimate
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Port FUN_0053e190 aggression scaling: GalaxyState now computes
control_ratio (our/total systems) and aggression (0.1–0.9 linear).
- max_fronts scaled by aggression: weak faction opens 1 front,
dominant faction opens up to config max
- Pass 2 aggression-aware: high aggression piles onto existing attacks,
low aggression distributes reinforcements across ALL undefended systems
- Proportional redistribution: round-robin by fewest incoming
reinforcements (no more all-to-first-system)
All 3 P0 gaps now DONE. Core pipeline: 5/6 functions at DONE status.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI assigns idle characters to Ship/Troop/Facility research based on
their primary skill (ship_design, troop_training, facility_design ≥ 30).
Ports FUN_004927c0 from the original game's master turn processing.
- New AIAction::DispatchResearch variant with tech_type and tick cost
- evaluate_research() checks each tree, skips if project already active
- Wired into both simulation.rs (headless) and main.rs (interactive)
- Telemetry: DispatchResearch events with character name and tech type
- Parity tracker updated: FUN_004927c0 now DONE
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Externalize all 16 hardcoded AI/movement/production constants into
GameConfig (tuning.rs) so the autoresearch loop can mutate parameters
via JSON. Each field documented as parity or augmentation.
- New: crates/rebellion-core/src/tuning.rs (~160 LOC)
- GameConfig with 4 sub-configs: AiConfig, MovementConfig,
ProductionConfig, ScoringConfig
- All Serialize/Deserialize with #[serde(default)]
- Thread &GameConfig through AISystem::advance(), score_attack_target(),
fleet_transit_ticks_with_config(), run_simulation_tick()
- Add --config <path> to rebellion-playtest binary
- Default config at configs/autoresearch/default.json
- Update autoresearch_loop.py to write and pass config files
- 283 tests pass, zero warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 4 (Galactic Daguerreotype): 20 portraits (10F/10M, 9 species)
via Nano Banana Pro with 14 reference images from original game DLLs.
Prompt template, species distribution, post-processing pipeline,
4 output formats, SmolVLM validation, ~$4 cost. Designed by Kotharat.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
control_changed event: emitted when uprising flips system control.
Includes system name, from/to control state, and cause.
campaign_snapshot: emitted every 250 ticks with:
alliance_systems, empire_systems, neutral_systems, fleets, in_transit.
Enables time-series analysis of galaxy control progression.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLAUDE.md: updated to v0.13.0 with per-fleet targeting, ControlKind,
distance transit, force distribution, observability suite, autoresearch,
280 tests. Added ai-parity-tracker.md to agent docs index.
roadmap.md: added AI Overhaul section (COMPLETE) with full delivery list.
Updated Immediate Next Steps: telemetry, config-driven AI, combat spread,
autoresearch execution, custom character addon.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Plan (docs/plans/2026-03-21-feat-ai-attack-target-variety-plan.md):
7 phases: per-fleet targeting, deconfliction, two-pass deployment,
battle repeat penalty, retarget cooldown, movement state access,
Death Star exemption. Grounded in Ghidra RE of 6 original functions.
13 edge cases from SpecFlow analysis. Metrics-based acceptance criteria.
Parity tracker (agent_docs/systems/ai-parity-tracker.md):
Maps every decompiled AI function to our implementation.
6 core pipeline functions, 7 sub-functions, 9 behavioral properties.
Status: DONE/FAITHFUL/AUGMENTED/PARTIAL/MISSING per row.
Augmentations table documents every deviation from original.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
eval_game_quality.py (rewritten with 8 sub-metrics):
- combat_quality: ratio × spread (penalizes single-system concentration)
- control_dynamism: how much the map changes (uprising-driven)
- mission_diversity: distinct mission types used
- fleet_engagement: attack ratio (penalizes reinforce-only)
- faction balance from explicit faction field (not dual_ai flag)
- Degenerate detection: single-system combat, no attacks, fast victory
- Visual bar chart output for each sub-metric
autoresearch_loop.py (Karpathy self-improvement):
- Prebuild release binary, run 3 seeds per iteration
- Mutate one parameter within bounds per iteration
- Aggregate: median - 0.5 * stddev (penalizes variance)
- Accept if improvement >= 0.01 threshold
- 12+ iterations/hour with debug binary, faster with release
- Outputs: best.json, history.json, per-iteration JSONL
Current baseline correctly flagged as DEGENERATE (all 991 battles at Yavin).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Characters now assigned by their strengths:
- Jedi-potential characters (jedi_probability > 50) reserved for Force training
- High-diplomacy characters prioritized for diplomacy missions
- Major characters with unrecruited allies → recruitment missions
- Remaining majors fall back to diplomacy
Previously all commanders were sent on generic diplomacy/recruitment.
Now the AI preserves Force-sensitive characters for Jedi progression.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Production doctrine:
- AI now builds capital ships first (priority 1), then fighters, then yards
- best_capital_ship_class() selects strongest hull for the faction
- Falls back to fighters when no capital ship class available
- Queue depth increased from 1 to 3 items
Build completion wiring (BUG FIX):
- CompletionEvents were logged but never applied to GameWorld
- New apply_build_completion() adds ships to fleets, facilities to systems
- Creates new fleets when no friendly fleet present at build system
HQ garrison defense:
- First fleet assigned to defend HQ instead of attacking
- Prevents the "position swap" where both factions send all fleets away
- Incoming attackers now meet a defender → combat fires
Results (seed 42, 5000 ticks, dual-AI):
991 space battles (was 0), 678 fleet arrivals, 6 ships manufactured,
3 blockades, 9 fleets (was 3). Game is producing real combat.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two fixes for victory-at-tick-12:
1. MIN_VICTORY_TICK = 200: grace period before victory conditions
can trigger, giving factions time to build forces. In the original
game, fleet transit across the galaxy takes many turns; this serves
the same purpose.
2. Expanded controlling_faction derivation: now checks troops,
special_forces, and production_facilities (was only checking
fleets + defense/manufacturing facilities).
Research confirmed: original game also starts with only 2 controlled
systems (Coruscant + Yavin) and the AI had full map visibility (no
fog-of-war for the computer). Our omniscient AI is faithful to the
original.
Campaign now runs to tick 200 with 680 events (267 AI actions,
234 missions, 9 story events, 2 Jedi advances) before victory.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These methods are behind #[cfg(not(target_arch = "wasm32"))] but
main.rs calls them unconditionally. Add no-op WASM stubs to fix
CI WASM build failure.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HIGH: DeathStarSabotaged effect was discarded (let _ = ticks_delayed).
Now calls death_star_state.add_sabotage_delay() to actually delay construction.
MEDIUM: UprisingSubdued never removed uprising from UprisingState.
Now calls uprising_state.clear_uprising(system). Also fixed faction-
asymmetric popularity shift (was always pro-Empire, now uses
controlling_faction to determine direction).
MEDIUM: REPL JSON output used hand-rolled format! strings vulnerable
to injection. Replaced with serde_json::json!() macro.
Added: DeathStarState::add_sabotage_delay(), UprisingState::clear_uprising()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Complete reverse engineering of the original Star Wars Rebellion AI:
6-function pipeline (galaxy evaluation → system iteration → strength
assessment → validation → entity dispatch → movement orders).
Key findings:
- AI is event-driven/distributed, not monolithic
- Galaxy-wide 7-bucket system categorization (FUN_00519d00)
- Per-system garrison strength counting ships+troops+facilities
- Faction encoded as bits 6-7 of offset +0x24 on every entity
- Two-pass system evaluation with ~20 tunable thresholds
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added REPL mode section to play-testing.md: output format, special
commands (tick N, help, quit), LLM integration pattern. Also documented
--exec mode. Updated CLAUDE.md status to v0.12.0.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Persistent REPL that loads world once, reads commands from stdin,
executes against live state, outputs JSON for LLM parsing.
Commands: all 16 from shared registry + "tick N" (advance with events)
+ "help" + "quit". State persists across commands — enables multi-turn
campaigns driven by Claude, GPT, or any LLM agent.
Example:
echo "show_game_stats\ntick 10\nlist_active_fleets" | \
rebellion-playtest data/base --repl --seed 42
Output format: {"command":"...","tick":N,"result":"..."}
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two bugs prevented all fleet movement:
1. controlling_faction was never set (always None for all 200 systems)
2. evaluate_fleet_deployment used popularity thresholds that never triggered
Fixes:
- Post-seed pass derives controlling_faction from fleet/facility presence
- Fleet targeting now uses controlling_faction instead of popularity
- Defense gate uses actual enemy fleet presence instead of popularity
Result: first campaign with combat — fleet arrivals, blockades, and
victory at tick 12 (balance tuning needed, but all systems fire).
Before: 5000 ticks, 0 combat, 0 fleet moves, 0 blockades
After: 12 ticks to victory, 3 fleet arrivals, 2 blockades
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two missing mission types from the parity audit, closing the gap to
11/11 original mission types implemented:
- SubdueUprising: SUBDMSTB.DAT (13 entries), skill: diplomacy,
effect: UprisingSubdued (shifts popularity toward controlling faction)
- DeathStarSabotage: DSSBMSTB.DAT (12 entries), skill: espionage,
effect: DeathStarSabotaged (delays construction by 50 ticks)
Also includes first headless campaign results (playtest-seed42.jsonl):
- 5000 ticks, dual-AI, seed 42
- 8,936 events in 0.8s, no panics, no victory reached
- AI is mission-heavy but doesn't deploy fleets (balance finding)
275 tests, 0 warnings, 0 errors.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>