# nikzbyte/in-other-words architecture

> Architecture diagram of the GitHub repository nikzbyte/in-other-words, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nikzbyte/in-other-words
- Repository: https://github.com/nikzbyte/in-other-words

## Overview

In Other Words is a Java visual novel that combines campus exploration, character relationships, and practice in Cebuano, Ilokano, and Central Bikol. The player enters through the game UI, explores maps and interacts with classmates, then follows a four-chapter story with choices and typed language challenges; progress and endings reflect their play. The graph also shows the vocabulary dictionary, save state, and optional AI answer checking. Edges rely on the README and SOURCE INDEX references; unsampled implementation details are not assumed.

Main entry points: [`src/main/GamePanel.java`](https://github.com/nikzbyte/in-other-words/blob/main/src/main/GamePanel.java) (Game interface), [`src/story/StoryManager.java`](https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryManager.java) (Story progression), [`src/data/GameProgress.java`](https://github.com/nikzbyte/in-other-words/blob/main/src/data/GameProgress.java) (Playthrough state), [`src/story/StoryView.java`](https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryView.java) (Story presentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_main["Game launcher<br/>[Main.java]"]
  node_game["Game interface<br/>[GamePanel.java]"]
  node_input["Keyboard input<br/>[KeyHandler.java]"]
  node_entities["Player and classmates<br/>[Player.java]"]
  node_entitybase["World entities<br/>[Entity.java]"]
  node_events["Campus events<br/>[EventHandler.java]"]
  node_maps["Map and tiles<br/>[TileManager.java]"]
end

subgraph group_story["Story and dialogue"]
  node_script["Story script<br/>[StoryScript.java]"]
  node_storymgr["Story progression<br/>[StoryManager.java]"]
  node_storyview["Story presentation<br/>[StoryView.java]"]
  node_highlight["Dialect highlighting"]
  node_sprites["Story sprites<br/>[StorySprites.java]"]
end

subgraph group_learning["Language learning"]
  node_dictionary["Vocabulary dictionary<br/>[Dictionary.java]"]
  node_validator["Answer validation"]
  node_tutor["AI tutor service<br/>[TutorService.java]"]
  node_geminitutor["Gemini tutor<br/>[GeminiTutor.java]"]
  node_offline["Offline tutor<br/>[OfflineTutor.java]"]
  node_gemini["Gemini API client<br/>[GeminiClient.java]"]
end

subgraph group_progress["Progression"]
  node_dialogue["Dialogue mechanics"]
  node_affection["Affection scoring"]
  node_partners["Partner selection"]
  node_stages["Chapter stages<br/>[StageManager.java]"]
  node_endings["Story endings<br/>[EndingManager.java]"]
end

subgraph group_services["Data and AI"]
  node_state["Playthrough state<br/>[GameProgress.java]"]
  node_files[("Save and resource files<br/>[FileManager.java]")]
  node_entries["Vocabulary entries"]
end

node_player(("Player"))
node_gemini_api{{"Gemini service"}}

node_player -->|"plays"| node_game
node_main -->|"opens"| node_game
node_game -->|"handles input"| node_input
node_game -->|"updates and draws"| node_entities
node_entities -->|"inherits"| node_entitybase
node_game -->|"routes events"| node_events
node_game -->|"uses maps"| node_maps
node_player -->|"explores campus"| node_game
node_game -->|"starts story"| node_storymgr
node_game -->|"presents story"| node_storyview
node_game -->|"loads story"| node_script
node_storyview -->|"advances dialogue"| node_storymgr
node_storyview -->|"highlights dialect"| node_highlight
node_storyview -->|"renders sprites"| node_sprites
node_game -->|"shows vocabulary"| node_dictionary
node_dictionary -->|"uses entries"| node_entries
node_storymgr -->|"checks answers"| node_validator
node_storyview -->|"requests answer check"| node_tutor
node_tutor -->|"selects online tutor"| node_geminitutor
node_tutor -->|"falls back"| node_offline
node_geminitutor -->|"delegates checks"| node_gemini
node_gemini -.->|"sends requests"| node_gemini_api
node_storymgr -.->|"uses mechanics"| node_dialogue
node_dialogue -->|"validates responses"| node_validator
node_dialogue -->|"updates affection"| node_affection
node_storymgr -->|"applies scoring"| node_affection
node_storymgr -->|"routes partner choice"| node_partners
node_storymgr -->|"routes endings"| node_endings
node_stages -->|"coordinates chapters"| node_dialogue
node_storymgr -->|"reads and updates"| node_state
node_dialogue -->|"updates progress"| node_state
node_affection -->|"updates score"| node_state
node_partners -->|"updates partner"| node_state
node_stages -->|"updates stage"| node_state
node_endings -->|"reads ending state"| node_state
node_game -->|"saves and loads"| node_files
node_files -->|"persists progress"| node_state
node_files -->|"loads vocabulary"| node_entries

click node_main "https://github.com/nikzbyte/in-other-words/blob/main/src/main/Main.java"
click node_game "https://github.com/nikzbyte/in-other-words/blob/main/src/main/GamePanel.java"
click node_input "https://github.com/nikzbyte/in-other-words/blob/main/src/main/KeyHandler.java"
click node_entities "https://github.com/nikzbyte/in-other-words/blob/main/src/entity/Player.java"
click node_entitybase "https://github.com/nikzbyte/in-other-words/blob/main/src/entity/Entity.java"
click node_events "https://github.com/nikzbyte/in-other-words/blob/main/src/main/EventHandler.java"
click node_maps "https://github.com/nikzbyte/in-other-words/blob/main/src/tile/TileManager.java"
click node_script "https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryScript.java"
click node_storymgr "https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryManager.java"
click node_storyview "https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryView.java"
click node_highlight "https://github.com/nikzbyte/in-other-words/blob/main/src/story/DialectHighlighter.java"
click node_sprites "https://github.com/nikzbyte/in-other-words/blob/main/src/story/StorySprites.java"
click node_dictionary "https://github.com/nikzbyte/in-other-words/blob/main/src/data/Dictionary.java"
click node_validator "https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/AnswerValidator.java"
click node_tutor "https://github.com/nikzbyte/in-other-words/blob/main/src/ai/TutorService.java"
click node_geminitutor "https://github.com/nikzbyte/in-other-words/blob/main/src/ai/GeminiTutor.java"
click node_offline "https://github.com/nikzbyte/in-other-words/blob/main/src/ai/OfflineTutor.java"
click node_gemini "https://github.com/nikzbyte/in-other-words/blob/main/src/ai/GeminiClient.java"
click node_dialogue "https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/DialogueManager.java"
click node_affection "https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/AffectionManager.java"
click node_partners "https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/PartnerManager.java"
click node_stages "https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/StageManager.java"
click node_endings "https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/EndingManager.java"
click node_state "https://github.com/nikzbyte/in-other-words/blob/main/src/data/GameProgress.java"
click node_files "https://github.com/nikzbyte/in-other-words/blob/main/src/data/FileManager.java"
click node_entries "https://github.com/nikzbyte/in-other-words/blob/main/src/data/VocabularyEntry.java"

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_main,node_game,node_input,node_entities,node_entitybase,node_events,node_maps toneBlue
class node_script,node_storymgr,node_storyview,node_highlight,node_sprites toneAmber
class node_dictionary,node_validator,node_tutor,node_geminitutor,node_offline,node_gemini toneMint
class node_dialogue,node_affection,node_partners,node_stages,node_endings toneRose
class node_state,node_files,node_entries,node_player,node_gemini_api toneIndigo
```

## Components

### Game runtime

- [Game launcher](https://github.com/nikzbyte/in-other-words/blob/main/src/main/Main.java): `src/main/Main.java`
- [Game interface](https://github.com/nikzbyte/in-other-words/blob/main/src/main/GamePanel.java): `src/main/GamePanel.java`
- [Keyboard input](https://github.com/nikzbyte/in-other-words/blob/main/src/main/KeyHandler.java): `src/main/KeyHandler.java`
- [Player and classmates](https://github.com/nikzbyte/in-other-words/blob/main/src/entity/Player.java): `src/entity/Player.java`
- [World entities](https://github.com/nikzbyte/in-other-words/blob/main/src/entity/Entity.java): `src/entity/Entity.java`
- [Campus events](https://github.com/nikzbyte/in-other-words/blob/main/src/main/EventHandler.java): `src/main/EventHandler.java`
- [Map and tiles](https://github.com/nikzbyte/in-other-words/blob/main/src/tile/TileManager.java): `src/tile/TileManager.java`

### Story and dialogue

- [Story script](https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryScript.java): `src/story/StoryScript.java`
- [Story progression](https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryManager.java): `src/story/StoryManager.java`
- [Story presentation](https://github.com/nikzbyte/in-other-words/blob/main/src/story/StoryView.java): `src/story/StoryView.java`
- [Dialect highlighting](https://github.com/nikzbyte/in-other-words/blob/main/src/story/DialectHighlighter.java): `src/story/DialectHighlighter.java`
- [Story sprites](https://github.com/nikzbyte/in-other-words/blob/main/src/story/StorySprites.java): `src/story/StorySprites.java`

### Language learning

- [Vocabulary dictionary](https://github.com/nikzbyte/in-other-words/blob/main/src/data/Dictionary.java): `src/data/Dictionary.java`
- [Answer validation](https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/AnswerValidator.java): `src/mechanics/AnswerValidator.java`
- [AI tutor service](https://github.com/nikzbyte/in-other-words/blob/main/src/ai/TutorService.java): `src/ai/TutorService.java`
- [Gemini tutor](https://github.com/nikzbyte/in-other-words/blob/main/src/ai/GeminiTutor.java): `src/ai/GeminiTutor.java`
- [Offline tutor](https://github.com/nikzbyte/in-other-words/blob/main/src/ai/OfflineTutor.java): `src/ai/OfflineTutor.java`
- [Gemini API client](https://github.com/nikzbyte/in-other-words/blob/main/src/ai/GeminiClient.java): `src/ai/GeminiClient.java`

### Progression

- [Dialogue mechanics](https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/DialogueManager.java): `src/mechanics/DialogueManager.java`
- [Affection scoring](https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/AffectionManager.java): `src/mechanics/AffectionManager.java`
- [Partner selection](https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/PartnerManager.java): `src/mechanics/PartnerManager.java`
- [Chapter stages](https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/StageManager.java): `src/mechanics/StageManager.java`
- [Story endings](https://github.com/nikzbyte/in-other-words/blob/main/src/mechanics/EndingManager.java): `src/mechanics/EndingManager.java`

### Data and AI

- [Playthrough state](https://github.com/nikzbyte/in-other-words/blob/main/src/data/GameProgress.java): `src/data/GameProgress.java`
- [Save and resource files](https://github.com/nikzbyte/in-other-words/blob/main/src/data/FileManager.java): `src/data/FileManager.java`
- [Vocabulary entries](https://github.com/nikzbyte/in-other-words/blob/main/src/data/VocabularyEntry.java): `src/data/VocabularyEntry.java`

### Other components

- **Player**
- **Gemini service**

## Connections

- Player → Game interface: plays
- Game launcher → Game interface: opens (evidence: `src/main/Main.java`)
- Game interface → Keyboard input: handles input (evidence: `src/main/GamePanel.java`)
- Game interface → Player and classmates: updates and draws (evidence: `src/main/GamePanel.java`)
- Player and classmates → World entities: inherits (evidence: `src/entity/Player.java`)
- Game interface → Campus events: routes events (evidence: `src/main/GamePanel.java`)
- Game interface → Map and tiles: uses maps (evidence: `src/main/GamePanel.java`)
- Player → Game interface: explores campus
- Game interface → Story progression: starts story (evidence: `src/main/GamePanel.java`)
- Game interface → Story presentation: presents story (evidence: `src/main/GamePanel.java`)
- Game interface → Story script: loads story (evidence: `src/main/GamePanel.java`)
- Story presentation → Story progression: advances dialogue (evidence: `src/story/StoryView.java`)
- Story presentation → Dialect highlighting: highlights dialect (evidence: `src/story/StoryView.java`)
- Story presentation → Story sprites: renders sprites (evidence: `src/story/StoryView.java`)
- Game interface → Vocabulary dictionary: shows vocabulary (evidence: `src/main/GamePanel.java`)
- Vocabulary dictionary → Vocabulary entries: uses entries (evidence: `src/data/Dictionary.java`)
- Story progression → Answer validation: checks answers (evidence: `src/story/StoryManager.java`)
- Story presentation → AI tutor service: requests answer check (evidence: `src/story/StoryView.java`)
- AI tutor service → Gemini tutor: selects online tutor (evidence: `src/ai/TutorService.java`)
- AI tutor service → Offline tutor: falls back (evidence: `src/ai/TutorService.java`)
- Gemini tutor → Gemini API client: delegates checks (evidence: `src/ai/GeminiTutor.java`)
- Gemini API client → Gemini service: sends requests (evidence: `src/ai/GeminiClient.java`)
- Story progression → Dialogue mechanics: uses mechanics
- Dialogue mechanics → Answer validation: validates responses (evidence: `src/mechanics/DialogueManager.java`)
- Dialogue mechanics → Affection scoring: updates affection (evidence: `src/mechanics/DialogueManager.java`)
- Story progression → Affection scoring: applies scoring (evidence: `src/story/StoryManager.java`)
- Story progression → Partner selection: routes partner choice (evidence: `src/story/StoryManager.java`)
- Story progression → Story endings: routes endings (evidence: `src/story/StoryManager.java`)
- Chapter stages → Dialogue mechanics: coordinates chapters (evidence: `src/mechanics/StageManager.java`)
- Story progression → Playthrough state: reads and updates (evidence: `src/story/StoryManager.java`)
- Dialogue mechanics → Playthrough state: updates progress (evidence: `src/mechanics/DialogueManager.java`)
- Affection scoring → Playthrough state: updates score (evidence: `src/mechanics/AffectionManager.java`)
- Partner selection → Playthrough state: updates partner (evidence: `src/mechanics/PartnerManager.java`)
- Chapter stages → Playthrough state: updates stage (evidence: `src/mechanics/StageManager.java`)
- Story endings → Playthrough state: reads ending state (evidence: `src/mechanics/EndingManager.java`)
- Game interface → Save and resource files: saves and loads (evidence: `src/main/GamePanel.java`)
- Save and resource files → Playthrough state: persists progress (evidence: `src/data/FileManager.java`)
- Save and resource files → Vocabulary entries: loads vocabulary (evidence: `src/data/FileManager.java`)
