QUARTZ MUSIC
System Overview
RedCell's score reacts to combat the moment the AI does — but it never cuts mid-phrase. A dedicated Music Manager rides a Quartz clock, listens for combat state over the GameplayMessage subsystem, and schedules every transition on a musical boundary, in a multiplayer game where that state has to reach every client correctly.
Full write-up in progress — figures below are from the working implementation
01 | Architecture
Music Manager Per World
The Music Manager is a GameState component added by each world's Experience definition, so every world owns its own musical identity. One map runs a different child manager from another, with no shared-singleton plumbing.
Every musical knob is exposed per child Blueprint: the MetaSound music system itself, the Quartz Clock and settings (time signature, BPM), the Quantization Boundary (quantization type, multiplier), and level-transitions on by default. Dedicated manager lifecycle and Quartz value logging make debug timing issues visible. Authoring a world's music is configuration, not code.
02 | Combat Detection
Combat States with AI Senses
Combat state starts at the source of truth: the AI Controller's Perception Component. Target perception updates feed a combat evaluation on the AI side, and the Enemy Spawn Manager tracks every live bot, owning the encounter-level verdict when the fight starts or the last aware bot loses the player.
03 | Gameplay Bridge
Audio through Gameplay Messaging
The AI Controllers and music system never reference each other. The spawn manager binds to its encounter event and broadcasts a Verb Message (SenseStateChanged) whose magnitude encodes combat on or off; the Music Manager registers this GameplayMessage and reacts to the payload. Either side can be swapped or extended without touching the other, so the same message could drive VO, post-processing, or haptics independently.
Delivery is handled by a net-mode message router. Depending on the current playing mode, a message broadcasts locally through the GameplayMessage subsystem, while on a dedicated or listen server it routes through the GameState's multicast message — so every connected player's score flips with the encounter, and PIE playback behaves correctly in every net mode during live testing.
04 | Quantized Transitions
Transitions on the Quartz Grid
The Music Manager builds its Quartz Clock from the configured name, time signature, and BPM, and creates the music system per level transition. Gameplay can request a state change at any moment, but the change is scheduled on the configured quantization boundary through Quartz commands and their completion events. With the current setup, the score moves between explore, passive, and combat MetaSound parameters. Different states have different quantization settings, such as a 1/4 note reset on the start of combat for immediacy, and falling back to the bar phrasing once completed. Using the Quartz clock means it's sample-accurate, and never cutting mid-phrase.
The score itself is composed per Experience, written so sections hand off to each other with the Quartz Quantization Event subscription — each world is getting its own set of original tracks.
In Development
Full implementation write-up
Original score per Experience — in production
System demo video
See also the RedCell Audio & Music overview and the Enemy AI page for the gameplay side of the bridge.