Shared simulation layer: ai2 Option<AIState> for dual-AI in both
interactive and headless modes. Fixed hardcoded MissionFaction::Empire
— now derives from ai_state.faction. mark_available releases characters
from both AI states.
New features:
- --exec CLI subcommand on playtest binary (16 commands from shared registry)
- --dual-ai fully wired in playtest binary (persistent second AIState)
- ModRuntime::discover() at startup, Mod Manager shows real mods
- ToggleMod/ReloadMods handlers functional
- system_name field on JSONL export (resolve_system_names before write)
- Command palette consumes shared commands.rs registry
Reviewer fixes:
- Persistent ai2_state across frames (was recreated each tick — HIGH)
- mark_available on both ai/ai2 (was ai-only — MEDIUM)
- #[serde(default)] not #[serde(skip)] on defense_facility_classes
(skip broke mod JSON round-trip — Codex CRITICAL)
- mods_dir path aligned: parent().parent() matches data loader
275 tests, 0 warnings, 0 errors.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codex reviewer caught that adding a new field to GameWorld breaks
bincode deserialization of existing v4 saves (positional format).
Since defense_facility_classes is reference data loaded from
DEFFACSD.DAT, skip it in serialization and always repopulate on load.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shared command registry, dual AI mode, victory check, game log export,
distinct inspection commands, bombardment defense class lookup from
DEFFACSD.DAT. 275 tests passing (~97% parity).
- commands.rs: 16 CommandDef entries shared between palette and CLI
- 3 new PanelAction variants (ListActiveMissions, ListActiveFleets, ShowEventCount)
- ToggleDualAI wired: spawns second AIState for opposite faction
- ForceVictoryCheck: immediate VictorySystem::check() with result logging
- ExportGameLog: MessageLog::export_jsonl() with Serialize derives
- DefenseFacilityClassDef loaded from DEFFACSD.DAT, bombardment uses real stats
- Fixed 3 inspection commands that were aliased to ShowGameStats
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- game_events.rs: add EVT_FOG_REVEALED constant ("fog_revealed")
- simulation.rs: use EVT_FOG_REVEALED instead of EVT_EVENT_FIRED for fog reveals
- main.rs: document AdvanceTicks limitation (clock-only, systems catch up next frame)
From v0.8.0 code review (Claude + Codex, 2 critical + 3 important findings).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added Asset Pipeline section documenting the fully extracted game:
- 2,441 BMPs, 3,223 animation files, 285 voice WAVs, 15 decoded videos,
16 soundtrack WAVs, 51 DAT files, 511+ text strings, 348 encyclopedia entries
- Six AI-powered upscaling/generation pipelines listed
- Contributing section updated to reflect complete extraction
Every resource in Star Wars Rebellion (1998) is now on disk in open formats.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 15 videos decoded (VP9+Opus, 640x324/480, 271MB total) to
assets/references/ref-videos/. Updated dll-resource-catalog.md and
game-media.md with decoded status, actual resolution (640x324, not
320x200 as estimated), and ffmpeg command.
Every extractable resource in Star Wars Rebellion (1998) is now on disk:
- 2,441 BMP images (all 11 visual DLLs)
- 3,223 BIN animation/data files
- 285 voice WAV files (153 Alliance + 132 Empire)
- 15 WebM videos (decoded from Smacker)
- 16 WAV soundtrack files
- 51 DAT game data files
- 511+ text string resources
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extracted from MetasharpNet editor (COMMON.DLL, STRATEGY.DLL, TACTICAL.DLL,
GOKRES.DLL). Organized by function: main menu, galaxy chrome, tactical HUD,
buttons, facility indicators, status panels, droid advisors, backgrounds,
Death Star controls, weapon gauges.
INDEX.md includes per-category upscaling strategy (Vertex AI vs Gemini edit)
and total conversion notes for faction-specific vs neutral elements.
Note: EMSPRITE.DLL contains animated droid advisor sprites (C-3PO/R2-D2)
beyond the static images in Resources/.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Badge: 92% parity + 259 tests (was "War Machine Complete")
- Current state: all 6 phases listed with delivered features
- Roadmap: Full Parity and Mod Workshop marked complete/in-progress
- Modding: accurate description (patch-only, no additive yet)
- Contributing: updated needs (play-testing, story events, distribution)
- Ghidra RE: corrected to 111 GNPRTB params (was 97)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Gemini Method A (edit endpoint) tested on 5 images:
- Capital ships: HIGH fidelity (Mon Cal, Nebulon-B kept)
- Portraits: LOW (modernized to photorealistic, discarded)
- Fighters: LOW (hallucinated extra ships, discarded)
- Planets: MEDIUM (non-canonical detail, discarded)
New: scripts/vertex-upscale.py for non-generative Imagen 4.0 upscale
(Vertex AI, no hallucination). Pending gcloud auth refresh.
assets.md updated with both upscaling approaches, prompt refinement
notes for reducing hallucination, and per-category recommendations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 scripted story event chains:
- Luke Dagobah Training (0x221→0x210): Force XP trigger, Yoda training
- Vader/Luke Final Battle (0x220): two-phase ready, mandatory mission
- Bounty Hunter Attack (0x212): Han capture, 15% random after tick 100
- Jabba's Palace (0x380-0x383): 4 gate events, Luke/Leia/Chewbacca rescue
Character abilities:
- Han Solo speed bonus: hyperdrive_modifier consulted by fleet_ticks_per_hop()
- Betrayal system: loyalty threshold via UPRIS1TB, is_unable_to_betray immunity
- Decoy system: FDECOYTB lookup during mission resolution
- Escape system: ESCAPETB stub with CharacterEscaped effect
- Mission state flags: on_mission/on_hidden_mission/on_mandatory_mission
World model:
- 10 new Character fields promoted from DAT (is_unable_to_betray, is_jedi_trainer,
is_known_jedi, hyperdrive_modifier, enhanced_loyalty, mission flags, location)
- Character location tracking: current_system + current_fleet from fleet scan
- is_known_jedi → force_tier = Aware at load time
Event system:
- 6 new EventCondition variants (CharacterHasForceLevel, FactionControlsSystem, etc.)
- 6 new EventAction variants (SetMandatoryMission, ModifyForceTier, etc.)
- 15 Ghidra RE event ID constants (0x12c–0x370)
Integration:
- BetrayalSystem wired into main loop (after uprising, before Death Star)
- Story events registered at startup via define_story_events()
- StartJediTraining extracted from fired events with character-exists guard
- dispatch_guarded() blocks on_mission + on_mandatory_mission characters
- SaveState v3 with BetrayalState
Knesset Shapash: 4 daborot (Tanit, Nikkal, Anat, Pidray), 23 tasks.
2 parallel code reviewers found 4 bugs — all fixed before commit.
237 tests passing, 0 failures.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Critical fixes from Codex GPT-5.4 review:
- Fleet arrivals now update System.fleets (remove from origin, add to dest)
- 6 new systems wired into main loop: blockade, uprising, Death Star,
research, Jedi training, victory — all calling advance() each tick
- All 6 new states added to SaveState (save version bumped to 2)
- Mission effects now mutate world: FacilitySabotaged removes facility,
CharacterKilled/Captured/Rescued update character arena + fleets
- Jedi XP persists via accumulated_xp in JediTrainingRecord
- Blockade halts manufacturing via advance_with_blockade()
- Uprising incident cooldown bug fixed (first incident always fires)
Documentation overhaul:
- simulation.md pruned from 346→132 lines (lean index)
- 7 per-system detail docs in agent_docs/systems/
- architecture.md updated with all 14 simulation modules
- game-domain.md: missions marked as implemented, effects table added
- 3 "how to add" guides: new system, new mission type, new event type
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both HTML files serve from scripts/ — relative paths need ../assets/
prefix to resolve correctly from the browser's perspective.
Also: removed boot delay in reference-viewer.html, added console log.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
From Tehom's code review (4th parallel reviewer):
1. Phase 3 gate inverted: was ACTIVE && PHASES_ENABLED, now correctly
ACTIVE && !PHASES_ENABLED. Fleet eval checks armed ships but does NOT
set PHASES_ENABLED until after weapon fire completes. Matches C++
ordering from FUN_00544030.
2. Alt-shield path: 0x71..=0x72 → exact 0x71 only (reviewer-corrected)
3. Bombardment comment: clarified that minimum-1 only applies when
result after division is 0, not when raw_power is 0
4. Fighter losses now populated: capture initial fighter counts before
combat phases, compute losses as initial - surviving, populate
FighterLossEvent with squads_before/squads_after
5. Combat cooldown: 5-tick per-system cooldown prevents infinite
re-trigger on draws. Uses HashMap<SystemKey, u64> in main loop.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Critical fixes from 4 parallel code reviews:
1. Assassination/Abduction/Rescue targeted the mission agent instead of
the victim — added target_character: Option<CharacterKey> to ActiveMission
2. Death Star ConstructionCompleted re-emitted every tick after completion —
now self-clears under_construction in advance()
3. Victory screen dim layer invisible — Order::Background → Order::Foreground
4. UprisingIncident fired every tick in danger zone — added 10-tick cooldown
via incident_cooldowns HashMap
5. MstbTable::lookup() silently truncated on negative interpolation —
added .max(0.0) clamp before u32 cast
6. GnprtbParams struct doc described wrong 4-level difficulty mapping —
corrected to 8-level (0=dev through 7=multiplayer)
Also fixed: UprisingState::new() missing incident_cooldowns field init.
Cargo check passes clean. All pre-existing tests unaffected.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Voice cloning (Voicebox/Qwen3-TTS), audio upscaling (LavaSR v2),
music generation (ACE-Step 1.5), and SFX (ElevenLabs + AudioLDM2).
All tools installed and verified on M4 Max.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Credits AI image generation (Gemini, waifu2x, PBRify, Upscayl),
3D model generation (Hunyuan3D, WaveSpeedAI, Meshy, Trellis 2),
audio tools (Qwen3-TTS, Voicebox, LavaSR, ElevenLabs, ACE-Step),
game engine deps, RE tools, and community references.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Complete rewrite of the War Machine implementation plan incorporating
all Ghidra RE results and 7 scholar documents:
- Phase A (Ghidra RE) marked COMPLETE with results summary
- Phase B restructured with 24 tasks across 4 daborot
- Karme starts first (world model expansion blocks combat)
- Every task references specific scholar docs and function addresses
- Accuracy notes from reviewer corrections included
- File ownership matrix prevents merge conflicts
- 111 GNPRTB parameters (corrected from 97)
- Key references table for each daborit (10 docs, 6,049 lines)
- Prerequisite: 15 new CapitalShipClass fields, ShipInstance,
GnprtbParams, MstbTable types
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Keep @ prefix (auto-load) for architecture.md and roadmap.md — needed
on every session. Remove @ from simulation, dat-formats, game-domain,
modding, ghidra-re, assets — loaded on demand when relevant.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes identified by three cross-referencing reviewer agents:
1. annotated-functions.md: Shield alt-path family is exactly 0x71,
not range 0x71-0x72 (C checks `== 0x71`, not range)
2. annotated-functions.md: Ground combat validates troops (0x14-0x1b),
not characters (0x08-0x0f) — comment corrected
3. annotated-functions.md: Death Star alive_flag prose clarified —
bit0 semantics may differ between entity types
4. cpp-class-hierarchy.md: Weapon fire phase gate is inner mask 0x04/bit2
(via FUN_0053a640), not bit0 — bit0 is the outer wrapper gate
5. rust-implementation-guide.md: CombatPhaseFlags comments clarified
to distinguish outer wrapper gate (ACTIVE) from inner vtable mask
(WEAPON_TYPE = 0x04)
6. rust-implementation-guide.md: Added XOR-mask write pattern note for
shield_weapon_packed field (C uses `(new ^ old) & 0xf ^ old`)
7. entity-system.md: Autoscrap mission type code is 0x15 (21), not 0
8. mission-event-cookbook.md: Rescue case 7 ranges corrected —
third range is 0x01-0xff, not 0x10-0x20
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documentation audit via claude-md-manager skill. Fixed all stale content:
- README.md: Milestone table updated (Living Galaxy + War Room → Complete,
War Machine → Next). STRATEGY.DLL reference corrected to REBEXE.EXE.
TEXTSTRA.DLL marked as parsed. Mod system tense changed to present.
- CHANGELOG.md: Added [Unreleased] Ghidra RE entry — 5,127 functions,
7 scholar docs, 97 GNPRTB params, bombardment formula, class hierarchy.
Version history table updated with v0.3.0+RE row.
- architecture.md: Replaced deleted draw_info_panel with current rendering
pipeline (CameraView, fog overlay, fleet overlays, composable egui).
Added MovementSystem and FogSystem to simulation loop.
- game-domain.md: Function count 109 → 5,127
- roadmap.md: Function count 109 → 5,127, added scholar doc reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Renders GLBs to 8-direction orthographic PNG sprites with transparent
backgrounds. Tested end-to-end: WaveSpeedAI Star Destroyer GLB →
Blender 5.0.1 → 256x256 RGBA sprites in ~10s.
Usage: blender --background --python scripts/render-sprite-sheets.py
Supports: --model, --resolution, --angles, --elevation, --input, --output
Eevee engine for speed, compatible with Blender 4.x and 5.x.
Also installed: BlenderSpriteGenerator addon (~/tools/blender-addons/)
and Blender 5.0.1 via Homebrew. Spritehandler 2 skipped (no ARM support).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Every function >100 bytes in the game is now decompiled.
Coverage: 5,127 / 22,741 functions (22.5% by count, ~95% by code volume)
The remaining ~17,600 functions are <100 bytes — CRT stubs, thunks,
single-line wrappers, and compiler-generated code.
Total RE corpus: 5,127 C files + 4 scholar docs (4,179 lines) +
7 reference docs + 8 Jython scripts = 11MB
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Every project documentation file updated to reflect the exhaustive
Ghidra RE of REBEXE.EXE (~4,900 decompiled functions):
- CLAUDE.md: v0.3.0 status, War Machine UNBLOCKED, RE COMPLETE
- agent_docs/ghidra-re.md: Full rewrite — RE status table, GNPRTB
params, game object layout, entity family bytes, C++ class hierarchy,
scholar documents, 8 Jython scripts documented
- agent_docs/roadmap.md: War Machine "UNBLOCKED", immediate next steps
= Knesset Tiamat launch, tech debt updated with combat prerequisites
- agent_docs/game-domain.md: Combat marked "RE COMPLETE" with pointers
- ghidra/INDEX.md: Updated structure, scholar docs, key discoveries
- ghidra/notes/INDEX.md: Full inventory by game system, GNPRTB functions,
validation functions with field offsets and ranges
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Microsoft Trellis 2 — image-to-3D with decimation_target for polygon
control (set 5000 for low-poly game assets). API confirmed working,
needs credits to test generation.
Endpoint: POST https://api.3daistudio.com/v1/3d-models/trellis2/generate/
Auth: Bearer THREEDAI_API_KEY
Cost: 15 credits/generation
Usage: uv run scripts/generate-rebellion-models.py --provider trellis --image-url URL
Now 4 providers: Hunyuan (fal.ai), WaveSpeedAI, Meshy, Trellis 2.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WaveSpeedAI Hunyuan3D v3.1 Rapid — 16x cheaper than fal.ai Pro.
Tested: Star Destroyer generated in ~25s, 872KB GLB.
API: POST https://api.wavespeed.ai/api/v3/wavespeed-ai/hunyuan-3d-v3.1/text-to-3d-rapid
Auth: Bearer token, WAVESPEED_API_KEY in secrets.env
Usage: uv run scripts/generate-rebellion-models.py --provider wavespeed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Documentation Consolidation
All project docs updated to reflect RE completion:
- roadmap.md: War Machine changed from "BLOCKED" to "UNBLOCKED"
- game-domain.md: Combat marked "RE COMPLETE" with pointers to ghidra/notes/
- ghidra-re.md: Updated with 109+ function count and annotated reference
- ghidra/notes/INDEX.md: Full inventory (115 C files, 8 scripts, 7 docs)
## New RE Findings
### Combat GNPRTB Parameter Registry (FUN_0055cb60)
Second Rosetta Stone: 71 combat-specific GNPRTB entries mapped:
- 0x1400-0x1417: 25 base combat parameters
- 0x1420-0x1445: 46 per-side (Alliance/Empire) combat variants
- DAT_006bb6e8 = parameter 0x1400 (bombardment base divisor)
### GNPRTB Cross-References (DumpGNPRTBXrefs.py)
Traced all 26 general + 71 combat GNPRTB parameters to the
functions that read them. Character skill modifiers use params
0xa01-0xa04 via FUN_004ef750/FUN_004ef100.
### Annotated Function Reference (1,662 lines)
Scholar agent produced comprehensive annotations:
- Entity base object struct layout (vtable, combat flags, hull,
shield/weapon packed nibbles, loyalty, regiment strength)
- Renamed variables across all combat functions
- Cross-referenced game rules and validation ranges
## Files
- 115 decompiled C files (6 new GNPRTB-related)
- annotated-functions.md (1,662 lines from scholar agent)
- DumpGNPRTBXrefs.py (GNPRTB parameter tracer script)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
waifu2x-ncnn-vulkan installed at ~/tools/waifu2x/ (20250915 release,
universal binary, tested on M4 Max). PBRify_UpscalerV4 and UltraSharpV2
.pth models downloaded to ~/tools/upscale-models/ (134MB each, Kim2091).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>