main.rs that grew to over 2000 lines. When freeplay menus were added, cascading breakage made the codebase effectively unmaintainable. V2’s answer is a Cargo workspace where every subsystem lives in its own crate with a single, enforced responsibility.
The six-crate workspace
The workspace is declared in the rootCargo.toml. Each member crate owns exactly one domain:
Cargo.toml
Dependency flow
Dependencies flow in one direction only.rustic-core is the leaf — it has zero rendering or audio dependencies. rustic-app is the root — it depends on everything else and wires the crates together. No crate may introduce a circular dependency.
rustic-core sits at the bottom of this graph deliberately. Data types, chart parsing, scoring math, and asset path resolution must not pull in a GPU backend or audio library. Keeping rustic-core dependency-free means you can run all parsing and logic tests without a window or sound device.
Single-responsibility principle
Each crate answers one question:| Crate | Question it answers |
|---|---|
rustic-core | What does the game data look like? |
rustic-audio | How does sound play? |
rustic-render | How does everything get drawn? |
rustic-gameplay | What are the rules of the game? |
rustic-scripting | How do Lua scripts interact with the engine? |
rustic-app | How do all these pieces start up and connect? |
rustic-gameplay — that is the signal to stop and route the work through events or the app layer instead.
Explore the crates
rustic-core
Data types and parsing. Chart formats, character definitions, stage files, scoring math. Zero rendering or audio dependencies.
rustic-audio
Audio playback via kira. Music and vocals sync, sound effects, BPM/beat tracking via the conductor.
rustic-render
All drawing. Sparrow XML atlas parsing, sprite animation, camera system, HUD. Uses wgpu.
rustic-gameplay
Game logic only. Input handling, note hit/miss detection, hold notes, event system. No rendering.
rustic-scripting
Lua VM integration. Exposes the full Psych Engine Lua API with matching function signatures.
rustic-app
Binary entry point. State machine, screen transitions, wires all crates together.