How ozawataiki/rhythmproject works
Project Type and Purpose
• This is a native C++ rhythm‐game application built on top of a small in-house engine.
• The “Application” folder contains the game logic, UI, resource definitions (JSON, models, shaders, audio), and a Visual Studio solution.
• The top-level “Engine” folder (not expanded here) holds reusable engine components (framework, rendering, audio, scene factory, particle factory, etc.).
• CI (GitHub Actions) is configured via DebugBuild.yml and ReleaseBuild.yml.
File Structure Analysis
• Top Level
• .github/workflows: CI pipelines
• Application: game project (VS solution, resources, source code)
• Engine: core engine code
• Application/Resources
• Data (game rules, beat-maps, animations, UI layouts)
• Primitives, Shader (HLSL), Sounds, fonts, images, models
• Application/Source/Application
• Modular folders per feature: BeatMapEditor, BeatMapLoader, BeatsManager, Core, Effects, FeedBack, GameEnvironment, GameMusic, GameUI, Input, Lane, Note, OptionMenu, PauseMenu, Result, Scene (with subfolders for transitions), Setting, SpectrumRing, TitleCamera/UI
• Application/Source/Essential
• SampleFramework, SceneFactory, ParticleModifierFactory
• Patterns visible
• Command pattern in BeatMapEditor/Command
• Factory pattern in Essential/SceneFactory & ParticleModifierFactory
• Scene-based state management
README Insights
a. Main Components
– Engine Subsystems
• Framework & Initialization (SampleFramework)
• Renderer (Direct3D, HLSL shaders)
• Audio System (wave playback, metronome)
• Resource Manager (loads JSON, models, textures, shaders, audio)
• SceneFactory & ParticleModifierFactory (factories for scenes and effects)
– Application Modules
• Scene Manager (Title, Select, Game, Editor, Result scenes + transitions)
• Core Game Loop & GameCore
• BeatMap Loader & BeatsManager (loads map, schedules beats)
• Input Manager (captures key/tap events)
• GameMusic (synchronizes audio playback)
• NotesSystem & Judging (spawn notes, compute hit/miss)
• Effects & Feedback (tap effects, judge text/sound, hold effects, lane/vignette)
• UI Layer (Game UI, Pause Menu, Settings, Result UI, Editor UI)
• BeatMap Editor (UI + command history for creating maps)
b. Relationships & Data Flow
– On startup, SampleFramework initializes Engine (render, audio, resource manager)
– SceneFactory → TitleScene (UI) → user input triggers transitions → GameScene
– GameScene: ResourceManager loads Data/Models/Shaders/Sounds → BeatsManager & GameMusic start
– InputManager feeds tap events → NotesSystem → Judge → Feedback & Effects → Renderer draws frames
– UI Module overlays score, settings, pause menu → user commands via Input → passes to Core/GameScene
– BeatMapEditor scene interacts with command pattern → ResourceManager saves JSON maps
– ResultScene displays summary using ResultData + UI
– Scene transitions controlled by SceneTrans (FSM)
c. Architectural Patterns & Principles
– Layered architecture: Engine layer vs Application layer
– Factory pattern for scenes and particle modifiers
– Command pattern for editor undo/redo
– Single Responsibility: each folder handles one domain (Input, Audio, UI, Effects, Scenes)
– Event-driven flow: Input → GameCore → Effects/Feedback → UI → Renderer
d. Key Technologies & Frameworks
– C++17, Visual Studio C++ project
– Direct3D 11/12 with HLSL shaders
– ImGui (for editor tools; see imgui.ini)
– JSON for Data definitions
– GitHub Actions for CI
Essential Details to Capture
– Initialization sequence (main → SampleFramework → initialize render/audio)
– Scene lifecycle and transitions
– Real-time loop: input → logic → audio sync → effects → render → UI
– Resource loading pipeline separate from runtime modules
– Editor as a special scene using command pattern