# Heroes of Three Kingdoms Godot 4 tactical RPG prototype inspired by classic turn-based Romance of the Three Kingdoms games. The current editor baseline is Godot 4.6. ## Current Slice - Twenty-six campaign scenarios. - Grid movement. - Unit selection. - Move, attack, wait, end turn. - Enemy AI with movement, attacks, multiple MP tactic choices, and scenario target priorities. - Hover tile and unit info. - Damage forecast for selected-unit attacks. - Terrain defense and avoid affect physical attack damage and hit chance. - Min/max attack ranges and counterattack forecasts. - MP tactics with low/high damage options, healing options, a skill list menu, damage/healing previews, and target overlays. - Campaign inventory consumables with an item menu, HP/MP recovery preview, and target overlay. - Weapon, armor, and accessory rewards can be stored, displayed, and equipped from the battle HUD. - Scenario-specific pre-battle shop purchases spend campaign gold, save immediately, and sync into the upcoming battle inventory. - Pre-battle Armory equipment changes save immediately and sync roster equipment plus inventory stock. - Pre-battle Roster can move optional officers between sortie and reserve within scenario limits. - Pre-battle Formation lets deployed officers swap starting positions inside scenario-defined cells. - Escort scenarios can include required, non-controllable protected units. - Campaign saves joined officers, future deployments can require prior recruitment, and choices can make officers leave. - Completed saves reconcile officer join/leave rewards on load without replaying gold or items. - Post-battle choices save a scenario-to-choice id ledger for safer future branch migrations. - Reloading during a pending post-battle choice returns to the choice panel instead of skipping the branch. - Qingzhou victory can recruit Dian Wei, backed by a new Warrior class. - Puyang uses Dian Wei as a required joined officer and introduces a Lu Bu branch choice. - Dingtao consumes the Puyang branch flags and rewards a stronger axe. - Wan Castle consumes the imperial escort branch flags and adds a protected Cao Ang escape map. - Xiapi consumes the Wan Castle branch flags and adds a flood-gate siege against Lu Bu. - Xiapi victory recruits Guo Jia, and White Horse starts the northern campaign with a decoy-line battle. - Yan Ford consumes the White Horse branch flags and adds Wen Chou's countercharge before Guandu. - Guandu consumes the Yan Ford branch flags and adds Yuan Shao's main assault. - Wuchao consumes the Guandu branch flags and adds a depot-burning raid. - Cangting consumes the Wuchao branch flags, breaks Yuan Shao's rear guard, and recruits Zhang He. - Ye consumes the Cangting branch flags and lets Zhang He deploy against the Yuan heirs. - Ye Siege consumes the Ye campaign branch flags and stages an inner-gate breach. - Ye Surrender consumes the siege branch flags and settles the city before the Yuan heirs flee north. - Northern Pursuit consumes the Ye surrender branch flags and pushes Yuan Shang's rearguard north from Ye. - Nanpi Pressure consumes the Northern Pursuit branch flags and breaks Yuan Tan's outer line. - Nanpi Surrender consumes the Nanpi Pressure branch flags and settles Yuan Tan's last loyalists. - Bohai Remnants consumes the Nanpi Surrender branch flags and scatters the Yuan brothers' covering force. - Liaoxi Pursuit consumes the Bohai Remnants branch flags and intercepts Yuan envoys seeking Wuhuan support. - White Wolf Mountain consumes the Liaoxi Pursuit branch flags and breaks the first Wuhuan command ridge backing the Yuan exiles. - Liaodong Pursuit consumes the White Wolf Mountain branch flags and forces the Yuan fugitives against Liaodong's border. - Xinye Advance consumes the Liaodong Pursuit branch flags and opens Cao Cao's southern advance into Jing Province. - Changban Pursuit consumes the Xinye Advance branch flags and forces Liu Bei's bridge guard at Changban. - Post-battle choices can save campaign flags that branch later briefing text, shop stock, and scenario events. - Scenario post-battle dialogue can play before the victory result panel. - Basic battle EXP, level-ups, and core first-tier class promotion routes. - Victory results summarize saved player level-ups and promotions. - Scenario events for battle start, battle-begin dialogue, turn start, movement-triggered ambushes, objective updates, and reinforcements. - Scenario briefing before battle. - Victory rewards and consumed inventory saved into a campaign state. - Scenario-defined victory and defeat conditions. - Destination-style victory conditions with objective map markers. - Protected-unit defeat conditions for escort battles. - Turn-limit defeat conditions with turn-limit HUD display. - Next-battle flow after victory. - Campaign completion screen. - New campaign save reset. - Victory and defeat result overlay. - Data-driven scenario setup through JSON definitions and deployments. ## Run 1. Install Godot 4. 2. Open this folder as a Godot project. 3. Run the project. The main scene is `res://scenes/battle_scene.tscn`. Campaign order lives at `res://data/campaign/campaign.json`. Scenarios live under `res://data/scenarios/`, with reusable officers, classes, items, skills, and terrain definitions under `res://data/defs/`. Data files can be checked with `powershell -NoProfile -ExecutionPolicy Bypass -File tools\validate_data.ps1`. Godot 4.6 migration readiness can be checked with `powershell -NoProfile -ExecutionPolicy Bypass -File tools\check_godot46_readiness.ps1`. The migration checklist lives in `docs/GODOT_4_6_MIGRATION.md`. ## Direction The project should grow from a small playable battle into a campaign tactics RPG: - Battle system first. - Scenario and event scripting second. - Progression, equipment, and class depth third. - Portraits, cutscenes, and campaign presentation after the core loop is fun. The code keeps portraits and other visual assets replaceable so generated original assets can be added later without changing battle rules.