doc 1 of 6

Audio — the system you deferred last

Every curriculum on this site says the same sentence about sound. The farming game's architecture lists "audio" under later modules. The survivors game's stage 09 puts it first on the stretch list — "a survivors game with no sound is a spreadsheet with sprites." The 3D farm's closing stage reserves the harvest sound alongside the inventory. You defer audio last because it's the only system you can't debug by reading the code — you debug it with your ears, and your ears are the one instrument you can't open in a profiler.

Defer it, don't skip it. This shelf is the four-hours-to-working-audio path, in the order the deferral pays back: first sound, then music, then the scale problem (a hit sound when thirty things die a second), then the clock problem (a sound in the wrong frame — the one the rhythm game curriculum treats as the entire game), and finally the 3D port.

What this shelf teaches#

PartYou buildRight when
01One AudioStreamPlayer, one hit sound on the damage path, the volume in decibelsYou have a game that plays in silence and you want it to stop
02A looping score, a crossfade between tracks, the bus layout, and the pause that keeps the music aliveThe silence has a place for a score and a sting
03A sound pool that survives thirty hits a second, a limiter that survives the mixYour game has more than one thing dying at a time
04The three clocks — physics, render, audio — and the rule for which one each sound ridesA sound feels "off" and you can't say why
05AudioStreamPlayer3D, attenuation, and the 3D farm's ambient bedYour game has a Z axis and the sound should too

The rule the shelf keeps returning to#

Sound rides the event, not the presentation. The damage number floats from the stats node, the knockback leaves the hitbox, and the thock plays from the same damage_received signal — same frame, same truth. The swing's whoosh is the exception, and it's an exception because it's a promise (wind moving, nothing hit yet), which part 04 argues is the only kind of sound allowed to ride the animation. Get this one sentence and the rest of the shelf is placement; get it backwards and every sound in your game is a few frames late and you'll spend a week chasing a latency that isn't there.

What audio buys you#

  • Feedback — the hit is confirmed by a sound, the way the float text confirms it by a number. A damage moment without a sound is a damage moment you have to check.
  • Information — a 3D sound arriving from the left is a location report the player never reads. The 3D farm spends this in part 05: the harvest sound on the cell you're facing tells you which crop you hit without looking.
  • Weather — the score is the game's climate. It doesn't tell the player what to do; it tells them what kind of minute it is. The level-up sting that ducks the score (part 02) is the weather changing on a schedule you control.

What it doesn't buy you#

A game that plays badly in silence plays badly with a soundtrack. The order in which this shelf is meant to be read is the order in which audio should be added: the game first, the hit sound second, the score third — because each layer is a reaction to a moment that has to exist before the reaction can be tuned. Audio is the last system you build and the first one players miss, and the deferral is correct as long as it's a deferred system with a plan, not a forgotten one.

Prerequisites#

  • Signals — every sound in this shelf is a listener on an event that already exists. If your damage path doesn't emit, fix that first; a sound you play() in _physics_process is a sound that will be in the wrong frame (part 04).
  • Tweens — the crossfade, the duck, and every volume move in this shelf is a create_tween() on a volume_db.
  • The Monitor panel — the bus meters are where "too loud" and "clipping" become numbers. The performance shelf's measure-first part is the general treatment; here the instrument is the audio mix view.

Where this shows up in the projects#

The survivors game is the shelf's test case — stage 09's stretch list is the build order: the hit thock (part 01, riding stage 04's damage path), the level-up sting with score ducking (part 02, riding stage 07's pause), the ambient bed (parts 02–03), and the thirty-hits-a-second problem (part 03, riding stage 08's crowd).

The 3D farm is part 05's test case — the harvest sound on the faced cell, the ambient bed anchored to a world position, and the unit_size that should match the farm's 1-metre cells.

The rhythm game is the shelf's boundary: part 04 ends exactly where that curriculum begins, because audio latency measured on the player's hardware is the one thing you never simulate and always calibrate. The almanac's architecture doc lists it as a permanent refusal of any in-page demo — the game's job is the calibration screen, and the shelf's job is to get you to the frame where calibration is the only remaining variable.