How kh-returngame/rg2_rhythmhealth works
Project Type and Purpose
• This is a Unity-based, client-only rhythm/game application that lets users create and play exercise routines to music (a “routine maker” rhythm game).
• Key indicators:
• Assets folder full of audio (MP3), JSON data for prologues and routines
• Scripts organized under Dialog, Play, Stage, UI, RoutineMaker
• Scenes like StartScene, MakeRoutine, Play, Stage, Prologues
• Plugins: FMOD (advanced audio middleware), SimpleFileBrowser, TextMesh Pro
File Structure Analysis
• Top-level folders:
• Assets – all game content (Audio, Sprites, Scenes, Prefabs, Scripts)
• Packages – manifest.json for Unity’s Package Manager
• ProjectSettings – engine configuration
• Under Assets:
• Plugins – third-party subsystems: FMOD (audio engine integration), SimpleFileBrowser (file I/O dialog), TextMesh Pro (text rendering)
• Scenes – each game state (start, prologue, routine maker, play, stage)
• Scripts – core game logic broken into subpackages:
– Dialog (text and dialogue control)
– Play (note spawning, verdict, results printing)
– Stage (player movement, environment interactions)
– UI (menus, settings, offset calibration)
– RoutineMaker (beat definition, save/load routines)
• PreRoutines – audio + JSON data for pre-built routines
• Configuration & build files: ProjectSettings, Packages/manifest.json
README Insights
1. Unity Engine Core
2. Scenes Manager
3. Game Logic Layer
• Dialog System
• Play System (NoteSpawner, NoteVerdict, Results)
• Stage System (Player controller, environment)
• RoutineMaker System (BeatInfo, SaveInfo)
4. UI Layer
• Settings & Offset Calibration
• Menus (Start, Pause/Esc, Next, BackToStage)
• File Browser (SimpleFileBrowser plugin)
5. Data Layer
• JSON Data (PreRoutines, Prologues, RoutineMaker save files)
• DataManager (load/save)
6. Audio Layer
• FMOD Plugin Runtime & Studio
• Unity AudioSource (fallback)
• Audio Assets (OffsetSFX, Prologue MP3)
7. External Subsystems
• FMOD Studio (audio middleware)
• SimpleFileBrowser (file dialog UI)
• TextMesh Pro (text rendering)
• Unity Engine ← loads → Scenes Manager
• Scenes Manager → instantiates → Game Logic & UI components
• Game Logic ↔ Data Layer (JSON load/save via DataManager)
• Game Logic → UI Layer (update scores, show dialogues)
• UI Layer → SimpleFileBrowser (open/save routines)
• Game Logic → FMOD Runtime (play event emitters, sound effects)
• FMOD Runtime → Audio Hardware (final sound output)
• InputSystem → UI & Game Logic (user taps, keypresses)
c. Architectural Patterns & Principles
• Component-based design (Unity GameObjects + MonoBehaviour scripts)
• MVC-like separation:
– Model: DataLayer (JSON, DataManager)
– View: UI Layer & Scenes
– Controller: Game Logic scripts
• Scene-driven flow: Start → Prologue → MakeRoutine → Play → Stage → Results
d. Key Technologies & Frameworks
• Unity Engine (2022+ with URP 2D)
• FMOD Unity Integration (audio events, banks)
• SimpleFileBrowser (runtime file dialogs for JSON)
• TextMesh Pro (advanced text UI)
• Unity Input System (InputSystem_Actions.asset)