Add photorealistic officer portraits

This commit is contained in:
2026-06-18 12:43:19 +09:00
parent c3a09d6577
commit 644bab582e
14 changed files with 61 additions and 7 deletions

View File

@@ -16,6 +16,7 @@
- `scripts/core/battle_state.gd`: Battle rules, unit state, turns, AI, and victory checks.
- `scripts/scenes/battle_scene.gd`: Rendering, input handling, and HUD wiring.
- `audio/bgm/*.wav` and `audio/sfx/*.wav`: Placeholder music loops and interface/action stingers.
- `art/portraits/*.png`: Generated officer portrait textures used by dialogue presentation.
- `data/campaign/campaign.json`: Campaign chapter ranges, scenario order, and scenario paths.
- `data/defs/*.json`: Officers, classes, terrain, items, and skills.
- `data/scenarios/*.json`: Scenario definitions.

View File

@@ -458,7 +458,7 @@ Conditions may include `after_event` to stay inactive until a one-shot event has
`unit_reaches_tile` checks living deployed units against a zero-based `pos` coordinate. Use `officer_ids` for persistent named officers or `unit_ids` for scenario-specific units; the validator requires one of those filters so destination objectives do not accidentally trigger from any unit. Victory destination cells are drawn as objective markers on the battle map.
`post_battle_dialogue` plays once after victory and before the victory result panel opens. Lines may be plain strings or objects with `speaker`, non-empty `text`, optional `portrait` resource paths such as `res://art/portraits/cao_cao.png`, and optional `side` values of `left` or `right` for portrait placement. If `side` is omitted, it defaults to `left`. If `portrait` is omitted, `BattleState` uses a matching officer definition's default portrait path when the line's `speaker` matches the officer `name`. If no usable portrait is loaded, the battle scene falls back to a speaker-initial panel.
`post_battle_dialogue` plays once after victory and before the victory result panel opens. Lines may be plain strings or objects with `speaker`, non-empty `text`, optional `portrait` resource paths such as `res://art/portraits/cao_cao.png`, and optional `side` values of `left` or `right` for portrait placement. Portrait paths must stay inside the project, point to existing readable image files, and keep at least a 512x512 source resolution. If `side` is omitted, it defaults to `left`. If `portrait` is omitted, `BattleState` uses a matching officer definition's default portrait path when the line's `speaker` matches the officer `name`. If no usable portrait is loaded, the battle scene falls back to a speaker-initial panel.
`post_battle_choices` are shown on the victory result panel after first-time scenario rewards are applied. Each choice needs a unique stable lowercase `id`, a non-empty `label`, and a `set_flags` object whose keys are stable lowercase flag ids. Choices may also grant positive `gold`, known `items`, `join_officers`, and `leave_officers`. When rewards are saved but the player has not selected a choice yet, `CampaignState.pending_post_battle_choice_scenario_id` records that scenario id so reloading the game returns to the victory choice panel instead of skipping the branch. The selected choice is saved to `CampaignState.flags`, `CampaignState.applied_post_battle_choices`, and campaign membership only when the player presses its result-panel button; completed-scenario replays do not show choices again. Save-load migration for older saves uses flags as a conservative choice signal, so avoid designing multiple choices in one scenario that can all match the same saved flag state.

View File

@@ -5,7 +5,7 @@ This project targets Godot 4.6 as the active editor baseline.
## Current Risk Profile
- The project is a simple Godot 4 `Node2D` application with data-driven JSON content.
- There are no addons, imported art assets, shaders, TileMaps, 3D physics scenes, or export presets yet.
- There are no addons, shaders, TileMaps, 3D physics scenes, or export presets yet. The first generated portrait PNGs are plain project files and can be loaded by the dialogue UI before editor import metadata exists.
- The current renderer is explicitly set to `gl_compatibility`, so new-project rendering defaults in Godot 4.6 should not silently change the existing project renderer.
- `project.godot` advertises `config/features=PackedStringArray("4.6")`.
- Godot 4.6 script UID sidecar files (`*.gd.uid`) are part of the migrated project metadata and should stay versioned.
@@ -62,6 +62,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -File tools\check_godot46_readines
- Enemy turn advances and AI acts, including damage-aware physical target selection.
- Victory and defeat panels still appear.
- Briefings show victory/defeat text plus first-clear reward previews, while post-battle dialogue and post-battle choices still block progression until a choice is saved.
- Opening and post-battle dialogue can show generated officer portraits from `art/portraits`, with speaker initials only used when no portrait is available.
- Next battle loads with saved roster, inventory, joined officers, and campaign flags.
- New Campaign clears the save and returns to the opening scenario.

View File

@@ -132,7 +132,7 @@
## Milestone 5: Presentation
- Portrait pipeline. Officer definitions can provide default portrait paths, dialogue lines can override them, and missing art falls back to speaker initials.
- Portrait pipeline. Officer definitions can provide default portrait paths, dialogue lines can override them, missing art falls back to speaker initials, and the first seven AI-generated photorealistic officer portraits are in `art/portraits`.
- Unit sprites and animations. Board movement now has a short slide animation, and board units show low-HP warning rings plus small status pips for active support, debuff, poison, seal, snare, and disarm effects.
- Battle effects. First floating combat text now covers damage, recovery, misses, support effects, poison ticks, item pickups, level-ups, and promotions. Hover target preview badges summarize attacks, tactics, and items, and the board can overlay enemy threat ranges with physical damage and hostile tactic hints.
- Music and sound. Basic placeholder BGM and SFX now play for menus, battle flow, unit actions, tactics, items, and result states.