# smeckle-git/ripples_of_the_past architecture

> Architecture diagram of the GitHub repository smeckle-git/ripples_of_the_past, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/smeckle-git/ripples_of_the_past
- Repository: https://github.com/smeckle-git/ripples_of_the_past

## Overview

#### Purpose and Entry Points
Godot game project for a narrative-driven 3D adventure/RPG: exploration of village, forest, intro, and “God Room” locations; NPC interaction; quests; companion behavior; dialogue choices; and journal/HUD UI. Project configuration is `project.godot`; the apparent gameplay root is `scenes/Levels/Game.tscn`, with destination scenes under `scenes/Levels/Destinations/`.

#### World and Scene Composition
Levels assemble reusable building, character, environmental, and GridMap-style terrain scenes. Major playable destinations are `scenes/Levels/Destinations/Intro.tscn`, `scenes/Levels/Destinations/Village.tscn`, and `scenes/Levels/Destinations/GodRoom.tscn`. Reusable world content is separated into `scenes/Buildings/`, `scenes/environment/`, and `scenes/gridmap_blocks/`; Terrain3D resources live in `resources/terrain3d_resources/`.

#### Player, Camera, and Movement State
The player is controlled through an explicit state-machine family: base state, machine, idle, walking, falling, dialogue, and follow states. This boundary centralizes movement/input behavior and makes dialogue or companion-follow modes distinct from ordinary traversal. Key paths: `Scripts/player_prototype_st.gd`, `Scripts/managers/StateMachine/Player_State_machine.gd`, `Scripts/Camera/player_camera.gd`.

#### Characters and Companion Systems
Named NPC scripts and character scenes represent story actors, while shared NPC/companion logic supports interaction and follow behavior. Character definitions are primarily scene-driven, with behavior scripts in `Scripts/Characters/` and separate companion implementations in legacy/new-content directories. Key paths: `scenes/Characters/Thorinn.tscn`, `Scripts/Characters/companion.gd`, `Scripts/npc.gd`.

#### Quest and Narrative Progression
Quest scripts encode location- and character-specific progression, with a central quest manager and a karma/judgement branch layer. Dialogue timeline assets are content data consumed by Dialogic, allowing story flow and choices to be authored outside gameplay scripts. Key paths: `Scripts/managers/quest_manager.gd`, `Scripts/Quests/Karma_global.gd`, `gui/Dialog/Timelines/Choose_which_villager_to_kill.dtl`.

#### Interaction, Dialogue, and UI
In-world interaction flows through an interaction-area/manager layer into NPC, object, quest, or dialogue actions. HUD, journal, pause/settings, main menu, and loading UI are separate scene/script systems. Dialogic is vendored as an addon and provides runtime timeline handling, dialogue text, choices, variables, conditions, audio, and save-related subsystems. Key paths: `Scripts/ui/InteractManager.gd`, `scenes/ui/Journal/Journal.tscn`, `addons/dialogic/Core/DialogicGameHandler.gd`.

#### Transitions, Rendering, and Dependencies
Scene loading is handled by dedicated loaders and loading-screen UI, likely mediating destination transitions and minimizing blocking changes. Rendering uses Godot scenes, materials, particle scenes, and custom shaders; Terrain3D supplies native terrain binaries/editor tooling. No networked service or backend is evident. Key paths: `Scripts/scene_loader.gd`, `scenes/ui/Loading_Screen/Scene_loader.tscn`, `addons/terrain_3d/terrain.gdextension`.

Main entry points: [`Scripts/ui/InteractManager.gd`](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/ui/InteractManager.gd) (Interaction Manager), [`scenes/Levels/Game.tscn`](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Game.tscn) (Game Root), [`Scripts/player_prototype_st.gd`](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/player_prototype_st.gd) (Player Controller), [`Scripts/managers/quest_manager.gd`](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/managers/quest_manager.gd) (Quest Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_world["World &amp; Scenes"]
  node_game["Game Root<br/>level scene<br/>[Game.tscn]"]
  node_destinations["Playable Destinations<br/>level scenes"]
  node_intro["Intro<br/>destination scene<br/>[Intro.tscn]"]
  node_village["Village<br/>destination scene<br/>[Village.tscn]"]
  node_godroom["God Room<br/>destination scene<br/>[GodRoom.tscn]"]
  node_world_content["Reusable World Content<br/>scene library"]
  node_terrain["Terrain3D Resources<br/>terrain assets"]
end

subgraph group_gameplay["Gameplay"]
  node_player["Player Controller<br/>player script"]
  node_player_states{{"Player State Machine"}}
  node_camera["Player Camera<br/>camera controller<br/>[player_camera.gd]"]
  node_characters["NPCs &amp; Companion<br/>character behavior<br/>[companion.gd]"]
  node_thorinn["Thorinn<br/>character scene<br/>[Thorinn.tscn]"]
  node_interaction{{"Interaction Manager<br/>interaction layer<br/>[InteractManager.gd]"}}
end

subgraph group_narrative["Narrative"]
  node_quest_manager{{"Quest Manager<br/>progression manager<br/>[quest_manager.gd]"}}
  node_karma["Karma Branching<br/>quest logic<br/>[Karma_global.gd]"]
  node_timeline["Dialogue Timeline<br/>dialogue content"]
end

subgraph group_ui["UI &amp; Transitions"]
  node_journal["Journal UI<br/>UI scene<br/>[Journal.tscn]"]
  node_scene_loader{{"Scene Loader<br/>transition controller<br/>[scene_loader.gd]"}}
  node_loading_screen["Loading Screen<br/>UI scene<br/>[Scene_loader.tscn]"]
end

subgraph group_platform["Engine Addons"]
  node_dialogic["Dialogic Runtime<br/>dialogue addon"]
  node_terrain_addon["Terrain3D Addon<br/>native terrain addon"]
end

node_project["Godot Project<br/>project config<br/>[project.godot]"]

node_project -->|"starts"| node_game
node_game -->|"hosts"| node_destinations
node_destinations -->|"includes"| node_intro
node_destinations -->|"includes"| node_village
node_destinations -->|"includes"| node_godroom
node_destinations -->|"composes"| node_world_content
node_world_content -->|"uses"| node_terrain
node_terrain_addon -->|"provides"| node_terrain
node_game -->|"controls"| node_player
node_player -->|"delegates movement modes"| node_player_states
node_player -->|"drives"| node_camera
node_player_states -->|"supports follow mode"| node_characters
node_thorinn -->|"uses behavior"| node_characters
node_interaction -->|"activates"| node_characters
node_interaction -->|"triggers progression"| node_quest_manager
node_interaction -->|"starts dialogue"| node_dialogic
node_quest_manager -->|"evaluates branches"| node_karma
node_quest_manager -->|"updates"| node_journal
node_dialogic -->|"consumes"| node_timeline
node_timeline -->|"expresses choices"| node_karma
node_scene_loader -->|"shows"| node_loading_screen
node_scene_loader -->|"transitions to"| node_destinations

click node_project "https://github.com/smeckle-git/ripples_of_the_past/blob/main/project.godot"
click node_game "https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Game.tscn"
click node_intro "https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Destinations/Intro.tscn"
click node_village "https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Destinations/Village.tscn"
click node_godroom "https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Destinations/GodRoom.tscn"
click node_player "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/player_prototype_st.gd"
click node_player_states "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/managers/StateMachine/Player_State_machine.gd"
click node_camera "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/Camera/player_camera.gd"
click node_characters "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/Characters/companion.gd"
click node_thorinn "https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Characters/Thorinn.tscn"
click node_interaction "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/ui/InteractManager.gd"
click node_quest_manager "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/managers/quest_manager.gd"
click node_karma "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/Quests/Karma_global.gd"
click node_timeline "https://github.com/smeckle-git/ripples_of_the_past/blob/main/gui/Dialog/Timelines/Choose_which_villager_to_kill.dtl"
click node_dialogic "https://github.com/smeckle-git/ripples_of_the_past/blob/main/addons/dialogic/Core/DialogicGameHandler.gd"
click node_journal "https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/ui/Journal/Journal.tscn"
click node_scene_loader "https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/scene_loader.gd"
click node_loading_screen "https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/ui/Loading_Screen/Scene_loader.tscn"
click node_terrain_addon "https://github.com/smeckle-git/ripples_of_the_past/blob/main/addons/terrain_3d/terrain.gdextension"

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_game,node_destinations,node_intro,node_village,node_godroom,node_world_content,node_terrain toneBlue
class node_player,node_player_states,node_camera,node_characters,node_thorinn,node_interaction toneAmber
class node_quest_manager,node_karma,node_timeline toneMint
class node_journal,node_scene_loader,node_loading_screen toneRose
class node_dialogic,node_terrain_addon toneIndigo
class node_project toneNeutral
```

## Components

### World & Scenes

- [Game Root](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Game.tscn): level scene · Gameplay entry scene. · `scenes/Levels/Game.tscn`
- **Playable Destinations**: level scenes · Intro, Village, and God Room locations.
- [Intro](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Destinations/Intro.tscn): destination scene · `scenes/Levels/Destinations/Intro.tscn`
- [Village](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Destinations/Village.tscn): destination scene · `scenes/Levels/Destinations/Village.tscn`
- [God Room](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Levels/Destinations/GodRoom.tscn): destination scene · `scenes/Levels/Destinations/GodRoom.tscn`
- **Reusable World Content**: scene library · Buildings, environment, and GridMap terrain blocks.
- **Terrain3D Resources**: terrain assets

### Gameplay

- [Player Controller](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/player_prototype_st.gd): player script · `Scripts/player_prototype_st.gd`
- [Player State Machine](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/managers/StateMachine/Player_State_machine.gd): state machine · Separates traversal, falling, dialogue, and follow behavior. · `Scripts/managers/StateMachine/Player_State_machine.gd`
- [Player Camera](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/Camera/player_camera.gd): camera controller · `Scripts/Camera/player_camera.gd`
- [NPCs & Companion](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/Characters/companion.gd): character behavior · Shared interaction and companion-follow behavior. · `Scripts/Characters/companion.gd`
- [Thorinn](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/Characters/Thorinn.tscn): character scene · `scenes/Characters/Thorinn.tscn`
- [Interaction Manager](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/ui/InteractManager.gd): interaction layer · Routes in-world actions to NPCs, objects, quests, and dialogue. · `Scripts/ui/InteractManager.gd`

### Narrative

- [Quest Manager](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/managers/quest_manager.gd): progression manager · `Scripts/managers/quest_manager.gd`
- [Karma Branching](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/Quests/Karma_global.gd): quest logic · Judgement and narrative branch layer. · `Scripts/Quests/Karma_global.gd`
- [Dialogue Timeline](https://github.com/smeckle-git/ripples_of_the_past/blob/main/gui/Dialog/Timelines/Choose_which_villager_to_kill.dtl): dialogue content · `gui/Dialog/Timelines/Choose_which_villager_to_kill.dtl`

### UI & Transitions

- [Journal UI](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/ui/Journal/Journal.tscn): UI scene · `scenes/ui/Journal/Journal.tscn`
- [Scene Loader](https://github.com/smeckle-git/ripples_of_the_past/blob/main/Scripts/scene_loader.gd): transition controller · `Scripts/scene_loader.gd`
- [Loading Screen](https://github.com/smeckle-git/ripples_of_the_past/blob/main/scenes/ui/Loading_Screen/Scene_loader.tscn): UI scene · `scenes/ui/Loading_Screen/Scene_loader.tscn`

### Engine Addons

- [Dialogic Runtime](https://github.com/smeckle-git/ripples_of_the_past/blob/main/addons/dialogic/Core/DialogicGameHandler.gd): dialogue addon · Runs timelines, choices, variables, conditions, audio, and saves. · `addons/dialogic/Core/DialogicGameHandler.gd`
- [Terrain3D Addon](https://github.com/smeckle-git/ripples_of_the_past/blob/main/addons/terrain_3d/terrain.gdextension): native terrain addon · `addons/terrain_3d/terrain.gdextension`

### Other components

- [Godot Project](https://github.com/smeckle-git/ripples_of_the_past/blob/main/project.godot): project config · `project.godot`

## Connections

- Godot Project → Game Root: starts
- Game Root → Playable Destinations: hosts
- Playable Destinations → Intro: includes
- Playable Destinations → Village: includes
- Playable Destinations → God Room: includes
- Playable Destinations → Reusable World Content: composes
- Reusable World Content → Terrain3D Resources: uses
- Terrain3D Addon → Terrain3D Resources: provides
- Game Root → Player Controller: controls
- Player Controller → Player State Machine: delegates movement modes
- Player Controller → Player Camera: drives
- Player State Machine → NPCs & Companion: supports follow mode
- Thorinn → NPCs & Companion: uses behavior
- Interaction Manager → NPCs & Companion: activates
- Interaction Manager → Quest Manager: triggers progression
- Interaction Manager → Dialogic Runtime: starts dialogue
- Quest Manager → Karma Branching: evaluates branches
- Quest Manager → Journal UI: updates
- Dialogic Runtime → Dialogue Timeline: consumes
- Dialogue Timeline → Karma Branching: expresses choices
- Scene Loader → Loading Screen: shows
- Scene Loader → Playable Destinations: transitions to
