# mentai-baguette/guild_academy architecture

> Architecture diagram of the GitHub repository mentai-baguette/guild_academy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mentai-baguette/guild_academy
- Repository: https://github.com/mentai-baguette/guild_academy

## Overview

1. **Repository shape**
   This is a Unity 6.4 2D RPG project organized around a clean split between **pure game logic** and **Unity-facing adapters**. The main code lives under `Assets/_Project/Scripts/Core` and is wrapped by MonoBehaviours in `Assets/_Project/Scripts/MonoBehaviours`. Content is mostly data-driven via ScriptableObjects and `Resources` assets.

2. **Primary runtime layers**
   The architecture has three important layers:
   - **Core domain logic**: battle, branching, dialogue, dungeon, calendar, party, save, character progression.
   - **Unity presentation/interaction layer**: scene objects, player/NPC controllers, UI, scene transitions, loaders.
   - **Content layer**: ScriptableObjects and resource-backed data files for characters, enemies, skills, dungeons, themes, dialogue, and audio.

3. **Core versus MonoBehaviour boundary**
   The `Core` assemblies contain reusable systems with minimal Unity dependency, intended to be unit-testable. The `MonoBehaviours` assembly bridges those systems to scenes, input, UI, and Unity lifecycle events. This boundary is central to the repo: the core owns rules, while the MonoBehaviours own wiring and user interaction.

4. **Battle subsystem**
   Battle is a self-contained subsystem under `Core/Battle`, with `ATBSystem`, `ActionExecutor`, `DamageCalculator`, `BreakSystem`, `StatusEffectSystem`, `FormationSystem`, `BossPhaseManager`, and enemy AI implementations (`BasicEnemyAI`, `ShionBossAI`). The flow is: ATB gauges fill, a command is selected, damage/status/break logic is resolved, then enemy AI and boss phase changes advance the turn state. `BattleFlowController` orchestrates the sequence.

5. **Battle UI and encounter entry**
   The Unity-side battle entry points are `BattleManager` and `BattleUIManager`. Field triggers likely transition into battle via `EncounterTrigger`, with battle setup data coming from `BattleSetupData` and content assets for enemies/skills. The battle UI is therefore an adapter over the core battle engine rather than the engine itself.

6. **Branching and ending system**
   Story progression is driven by a dedicated branching subsystem: `FlagSystem`, `TrustSystem`, `AcademyRefusalChecker`, `EndingResolver`, `EndingContext`, and `BranchService`. The game’s “mystery” structure is represented as information flags plus trust values, which together determine route changes and ending selection. This is one of the major game-specific decision boundaries in the architecture.

7. **Dialogue subsystem**
   Dialogue has its own core pipeline: `DialogueParser` turns dialogue JSON into `DialogueData` / `DialogueLine`, `DialogueRunner` advances the conversation, and `DialogueManager` coordinates presentation state. `ResourcesDialogueJsonLoader` is the Unity adapter that loads chapter dialogue from `Assets/Resources/Dialogues`, with `DialogueUI`, `ChoiceUI`, and `DialogueUIBridge` handling on-screen presentation and branching choices.

8. **Field, dungeon, and scene flow**
   The game uses distinct scenes for `Title`, `Field`, `Battle`, `Dungeon`, and `SampleScene`. Field gameplay is handled by `PlayerController`, `NPCController`, `BedInteraction`, `InfoFlagTrigger`, `EncounterTrigger`, and `AcademyPathTracker`. Dungeon progression is separated into `DungeonManager` / `DungeonManagerMB`, indicating a distinct exploration mode from the overworld field loop.

9. **Progression systems**
   Character and campaign progression are split into several core systems:
   - `LevelSystem` for character growth
   - `ErosionSystem` for the “corruption/abyss power” mechanic
   - `SoulLinkSystem` for relationship-linked bonuses and ending impact
   - `CalendarManager` and `ScheduleManager` for time progression and event scheduling
   These systems suggest the game advances on a calendar basis, with story scenes, dungeon runs, and social events competing for time.

10. **Data and content model**
    Most content is stored as asset data rather than hardcoded values. `ScriptableObjects` define `CharacterDataSO`, `EnemyDataSO`, `SkillDataSO`, `DungeonDataSO`, `ItemDataSO`, and `UIThemeSO`. Supporting enums and DTO-like types in `Core/Data` include `CharacterId`, `CharacterStats`, `SkillData`, `ItemData`, `BattleCommand`, `BattlePhase`, `SceneNames`, and `SceneTransitionData`. This makes the project highly data-driven and easy to balance without code changes.

11. **Save/load boundary**
    Persistence is isolated behind `SaveData`, `ISaveSerializer`, `SaveSerializer`, and the Unity adapter `UnitySaveSerializer`. This indicates a serialization boundary between game state and storage format, likely so the core state can be saved independently of platform-specific file I/O. Save data likely captures progression systems, flags, trust, calendar state, and party state.

12. **UI and presentation**
    UI is separated into reusable themed components: `ThemedButton`, `ThemedWindow`, `GaugeUI`, `TitleUI`, and `SceneTransitionManager`. Theme assets such as `Theme_Ch1_Academy` suggest per-chapter presentation styling. TextMesh Pro and URP 2D are used for presentation, but they are infrastructure rather than core architectural drivers.

13. **Audio and production assets**
    Audio is organized by purpose: BGM for major game states and SE for gameplay feedback. The asset layout indicates the game uses sound cues for battle, selection, healing, level-up, game over, and clearing events. This is a supporting subsystem, but it reinforces the game’s state-driven flow.

14. **Testability and CI**
    The repo includes extensive EditMode tests for battle, branching, dialogue, calendar, dungeon, save, schedule, and character systems. That aligns with the core/domain split: rules are designed to be testable without full Unity scenes. CI runs through GitHub Actions with `game-ci/unity-test-runner`, so automated validation is an explicit part of the architecture.

15. **How to draw the architecture**
    A good diagram would place the **core systems** in the center, with arrows from **MonoBehaviour scene controllers/UI** into them, and arrows from **ScriptableObject/Resources content** into the core via loaders and setup data. Surround that with the major game modes—**field exploration, dungeon exploration, battle, dialogue, branching/story, save/load, and schedule progression**—all coordinated by scene transitions and the calendar/branching state.

Main entry points: [`Assets/_Project/Scripts/Core/Battle/BattleFlowController.cs`](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Battle/BattleFlowController.cs) (Battle core), [`Assets/_Project/Scripts/Core/Branch/BranchService.cs`](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Branch/BranchService.cs) (Branching core), [`Assets/Scenes/Field.unity`](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/Scenes/Field.unity) (Scenes), [`Assets/_Project/Scripts/Core/Save/SaveSerializer.cs`](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Save/SaveSerializer.cs) (Save core)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_core["Core systems"]
  node_node_battle_core["Battle core<br/>core subsystem"]
  node_node_battle_rules["Battle rules<br/>combat logic<br/>[ATBSystem.cs]"]
  node_node_battle_ai["Enemy AI<br/>combat AI<br/>[BasicEnemyAI.cs]"]
  node_node_branch_core["Branching core<br/>story logic<br/>[BranchService.cs]"]
  node_node_dialogue_core["Dialogue core<br/>narrative pipeline<br/>[DialogueParser.cs]"]
  node_node_calendar["Calendar<br/>time system<br/>[CalendarManager.cs]"]
  node_node_progression["Progression<br/>growth systems<br/>[LevelSystem.cs]"]
  node_node_party["Party<br/>[PartyManager.cs]"]
  node_node_save_core["Save core<br/>persistence<br/>[SaveSerializer.cs]"]
  node_node_dungeon_core["Dungeon core<br/>exploration logic<br/>[DungeonManager.cs]"]
end

subgraph group_group_adapters["Unity adapters"]
  node_node_field_mb["Field controllers<br/>scene adapters"]
  node_node_battle_mb["Battle adapters<br/>scene adapters<br/>[BattleManager.cs]"]
  node_node_dialogue_mb["Dialogue UI<br/>ui adapter"]
  node_node_branch_mb["Branch UI<br/>scene adapter<br/>[BranchManager.cs]"]
  node_node_dungeon_mb["Dungeon adapter<br/>scene adapter"]
  node_node_party_mb["Party adapter<br/>scene adapter<br/>[PartyManagerMB.cs]"]
  node_node_save_mb["Save adapter<br/>platform adapter"]
end

subgraph group_group_content["Content assets"]
  node_node_scriptable["SO content<br/>data assets<br/>[CharacterDataSO.cs]"]
  node_node_resources[("Resources data<br/>runtime content<br/>[Enemy_Goblin.asset]")]
  node_node_dialogue_json["Dialogue JSON<br/>story data"]
end

subgraph group_group_presentation["Presentation"]
  node_node_ui["UI layer<br/>presentation UI"]
  node_node_scenes(("Scenes<br/>scene flow<br/>[Field.unity]"))
end

node_node_field_mb -->|"advances time"| node_node_calendar
node_node_field_mb -->|"sets flags"| node_node_branch_core
node_node_field_mb -->|"starts encounters"| node_node_battle_mb
node_node_battle_mb -->|"drives combat"| node_node_battle_core
node_node_battle_core -->|"resolves turns"| node_node_battle_rules
node_node_battle_core -->|"requests AI"| node_node_battle_ai
node_node_branch_mb -->|"applies story state"| node_node_branch_core
node_node_dialogue_mb -->|"runs dialogue"| node_node_dialogue_core
node_node_dialogue_mb -->|"loads chapters"| node_node_dialogue_json
node_node_dialogue_core -->|"branches choices"| node_node_branch_core
node_node_dungeon_mb -->|"wraps exploration"| node_node_dungeon_core
node_node_party_mb -->|"syncs party"| node_node_party
node_node_save_mb -->|"serializes state"| node_node_save_core
node_node_ui -->|"shows text"| node_node_dialogue_core
node_node_ui -->|"shows battle"| node_node_battle_mb
node_node_ui -->|"changes scenes"| node_node_scenes
node_node_scriptable -->|"defines stats"| node_node_battle_core
node_node_scriptable -->|"defines dungeons"| node_node_dungeon_core
node_node_resources -->|"feeds encounters"| node_node_battle_core
node_node_resources -->|"feeds loaders"| node_node_dialogue_mb
node_node_scenes -->|"hosts field"| node_node_field_mb
node_node_scenes -->|"hosts battle"| node_node_battle_mb
node_node_scenes -->|"hosts dungeon"| node_node_dungeon_mb
node_node_scenes -->|"hosts UI"| node_node_ui
node_node_calendar -->|"gates events"| node_node_branch_core
node_node_progression -->|"affects combat"| node_node_battle_core
node_node_progression -->|"affects endings"| node_node_branch_core
node_node_save_core -->|"persists state"| node_node_calendar
node_node_save_core -->|"persists flags"| node_node_branch_core
node_node_save_core -->|"persists growth"| node_node_progression

click node_node_battle_core "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Battle/BattleFlowController.cs"
click node_node_battle_rules "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Battle/ATBSystem.cs"
click node_node_battle_ai "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Battle/BasicEnemyAI.cs"
click node_node_branch_core "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Branch/BranchService.cs"
click node_node_dialogue_core "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Dialogue/DialogueParser.cs"
click node_node_calendar "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Calendar/CalendarManager.cs"
click node_node_progression "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Character/LevelSystem.cs"
click node_node_party "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Party/PartyManager.cs"
click node_node_save_core "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Save/SaveSerializer.cs"
click node_node_dungeon_core "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Dungeon/DungeonManager.cs"
click node_node_field_mb "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Field/PlayerController.cs"
click node_node_battle_mb "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Battle/BattleManager.cs"
click node_node_dialogue_mb "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Dialogue/ResourcesDialogueJsonLoader.cs"
click node_node_branch_mb "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Branch/BranchManager.cs"
click node_node_dungeon_mb "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Dungeon/DungeonManagerMB.cs"
click node_node_party_mb "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Party/PartyManagerMB.cs"
click node_node_save_mb "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Save/UnitySaveSerializer.cs"
click node_node_ui "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/UI/SceneTransitionManager.cs"
click node_node_scriptable "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/ScriptableObjects/CharacterDataSO.cs"
click node_node_resources "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/Resources/Data/Enemies/Enemy_Goblin.asset"
click node_node_dialogue_json "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/Resources/Dialogues/chapter1_dialogue.json"
click node_node_scenes "https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/Scenes/Field.unity"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_battle_core,node_node_battle_rules,node_node_battle_ai,node_node_branch_core,node_node_dialogue_core,node_node_calendar,node_node_progression,node_node_party,node_node_save_core,node_node_dungeon_core toneBlue
class node_node_field_mb,node_node_battle_mb,node_node_dialogue_mb,node_node_branch_mb,node_node_dungeon_mb,node_node_party_mb,node_node_save_mb toneAmber
class node_node_scriptable,node_node_resources,node_node_dialogue_json toneMint
class node_node_ui,node_node_scenes toneRose
```

## Components

### Core systems

Pure game rules and reusable domain logic.

- [Battle core](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Battle/BattleFlowController.cs): core subsystem · Turn flow, ATB, damage, status, break, formation, AI, and boss phases. · `Assets/_Project/Scripts/Core/Battle/BattleFlowController.cs`
- [Battle rules](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Battle/ATBSystem.cs): combat logic · ATB filling, action execution, damage calculation, break/status resolution, and formation handling. · `Assets/_Project/Scripts/Core/Battle/ATBSystem.cs`
- [Enemy AI](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Battle/BasicEnemyAI.cs): combat AI · Enemy decision logic including basic enemies and the Shion boss behavior. · `Assets/_Project/Scripts/Core/Battle/BasicEnemyAI.cs`
- [Branching core](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Branch/BranchService.cs): story logic · Flags, trust, refusal checks, and ending resolution for route selection. · `Assets/_Project/Scripts/Core/Branch/BranchService.cs`
- [Dialogue core](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Dialogue/DialogueParser.cs): narrative pipeline · Dialogue parsing, data model, runner, and manager for chapter conversations. · `Assets/_Project/Scripts/Core/Dialogue/DialogueParser.cs`
- [Calendar](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Calendar/CalendarManager.cs): time system · Campaign time progression and scheduling backbone. · `Assets/_Project/Scripts/Core/Calendar/CalendarManager.cs`
- [Progression](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Character/LevelSystem.cs): growth systems · Leveling, erosion, and soul-link relationship progression. · `Assets/_Project/Scripts/Core/Character/LevelSystem.cs`
- [Party](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Party/PartyManager.cs): party state · Party composition and party-level management. · `Assets/_Project/Scripts/Core/Party/PartyManager.cs`
- [Save core](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Save/SaveSerializer.cs): persistence · Save data model and serializer boundary independent of Unity I/O. · `Assets/_Project/Scripts/Core/Save/SaveSerializer.cs`
- [Dungeon core](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/Core/Dungeon/DungeonManager.cs): exploration logic · Dungeon progression and dungeon data model. · `Assets/_Project/Scripts/Core/Dungeon/DungeonManager.cs`

### Unity adapters

MonoBehaviours that wire scenes, input, UI, and lifecycle to core systems.

- [Field controllers](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Field/PlayerController.cs): scene adapters · Player, NPC, triggers, and path tracking in the overworld field scene. · `Assets/_Project/Scripts/MonoBehaviours/Field/PlayerController.cs`
- [Battle adapters](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Battle/BattleManager.cs): scene adapters · Unity battle entry and UI wiring around the core battle engine. · `Assets/_Project/Scripts/MonoBehaviours/Battle/BattleManager.cs`
- [Dialogue UI](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Dialogue/ResourcesDialogueJsonLoader.cs): ui adapter · Resources-based dialogue loading and dialogue/choice presentation bridge. · `Assets/_Project/Scripts/MonoBehaviours/Dialogue/ResourcesDialogueJsonLoader.cs`
- [Branch UI](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Branch/BranchManager.cs): scene adapter · MonoBehaviour boundary for branching and story-state interaction. · `Assets/_Project/Scripts/MonoBehaviours/Branch/BranchManager.cs`
- [Dungeon adapter](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Dungeon/DungeonManagerMB.cs): scene adapter · Unity-facing dungeon manager wrapper. · `Assets/_Project/Scripts/MonoBehaviours/Dungeon/DungeonManagerMB.cs`
- [Party adapter](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Party/PartyManagerMB.cs): scene adapter · Unity wrapper for party management. · `Assets/_Project/Scripts/MonoBehaviours/Party/PartyManagerMB.cs`
- [Save adapter](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/Save/UnitySaveSerializer.cs): platform adapter · Unity serializer bridge for persistence. · `Assets/_Project/Scripts/MonoBehaviours/Save/UnitySaveSerializer.cs`

### Content assets

ScriptableObjects, Resources, and dialogue data that feed gameplay systems.

- [SO content](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/ScriptableObjects/CharacterDataSO.cs): data assets · ScriptableObject definitions for characters, enemies, skills, dungeons, items, and themes. · `Assets/_Project/Scripts/ScriptableObjects/CharacterDataSO.cs`
- [Resources data](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/Resources/Data/Enemies/Enemy_Goblin.asset): runtime content · Enemy, skill, character, and dialogue assets loaded at runtime. · `Assets/Resources/Data/Enemies/Enemy_Goblin.asset`
- [Dialogue JSON](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/Resources/Dialogues/chapter1_dialogue.json): story data · Chapter dialogue source used by the dialogue pipeline. · `Assets/Resources/Dialogues/chapter1_dialogue.json`

### Presentation

UI and scene flow components that present game state.

- [UI layer](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/_Project/Scripts/MonoBehaviours/UI/SceneTransitionManager.cs): presentation UI · Reusable themed UI, gauges, dialogue UI, title UI, and scene transitions. · `Assets/_Project/Scripts/MonoBehaviours/UI/SceneTransitionManager.cs`
- [Scenes](https://github.com/mentai-baguette/guild_academy/blob/develop/Assets/Scenes/Field.unity): scene flow · Title, field, battle, dungeon, and sample scenes that structure gameplay flow. · `Assets/Scenes/Field.unity`

## Connections

- Field controllers → Calendar: advances time · Field interactions and daily flow feed the campaign calendar.
- Field controllers → Branching core: sets flags · Triggers and NPC interactions update story flags and trust.
- Field controllers → Battle adapters: starts encounters · Field encounter triggers transition into battle setup.
- Battle adapters → Battle core: drives combat · BattleManager and battle UI wrap the core combat engine.
- Battle core → Battle rules: resolves turns · ATB, actions, damage, break, and status are the combat pipeline.
- Battle core → Enemy AI: requests AI · Enemy and boss AI select actions within the battle loop.
- Branch UI → Branching core: applies story state · Unity-side branching surfaces feed core route and ending logic.
- Dialogue UI → Dialogue core: runs dialogue · The UI adapter loads and presents dialogue through the core runner.
- Dialogue UI → Dialogue JSON: loads chapters · Dialogue JSON is the runtime source for chapter conversations.
- Dialogue core → Branching core: branches choices · Dialogue choices can affect flags, trust, and route selection.
- Dungeon adapter → Dungeon core: wraps exploration · Unity dungeon manager delegates to the core dungeon system.
- Party adapter → Party: syncs party · Scene-side party wrapper keeps core party state in step with the game.
- Save adapter → Save core: serializes state · Unity-specific storage is separated from the core save model.
- UI layer → Dialogue core: shows text · Dialogue UI presents conversation state and choices.
- UI layer → Battle adapters: shows battle · Battle gauges, windows, and scene transitions present battle state.
- UI layer → Scenes: changes scenes · Scene transition UI controls movement between title, field, battle, and dungeon.
- SO content → Battle core: defines stats · Character, enemy, skill, and dungeon assets provide battle inputs.
- SO content → Dungeon core: defines dungeons · Dungeon ScriptableObjects feed dungeon progression and encounters.
- Resources data → Battle core: feeds encounters · Resource-backed enemy and skill data populate combat setup.
- Resources data → Dialogue UI: feeds loaders · Runtime dialogue files are loaded through the Resources adapter.
- Scenes → Field controllers: hosts field · Field scene contains overworld controllers and triggers.
- Scenes → Battle adapters: hosts battle · Battle scene contains combat UI and setup.
- Scenes → Dungeon adapter: hosts dungeon · Dungeon scene contains dungeon exploration adapters.
- Scenes → UI layer: hosts UI · Shared UI and title flow span the scene stack.
- Calendar → Branching core: gates events · Time progression can influence story availability and endings.
- Progression → Battle core: affects combat · Level, erosion, and soul-link progression change battle outcomes.
- Progression → Branching core: affects endings · Relationship and corruption systems feed route and ending logic.
- Save core → Calendar: persists state · Calendar state is part of the campaign save model.
- Save core → Branching core: persists flags · Story flags and trust values are persisted across sessions.
- Save core → Progression: persists growth · Character progression data is saved and restored.
