Log inGet started
World

Origo Party

Branchmain
Branchesmain
Commit926e535b08

README.md

OrigoSound — the party's voice

Attached by the scene entrypoint to the Sound anchor when play begins. It shows nothing on screen and owns no state: it is a pure reaction to what the match announces on the game.rules bus.

It starts the looping candy music bed once at start(), and plays one clip per beat thereafter. Each effect gets its own short-lived temporary entity under the Sound anchor so two of the same sound can overlap, and despawns itself after six seconds.

What plays when

Bus eventClipNote
(start)game.audio.party_looplooping music bed on the music channel
rollgame.audio.dice_rollthe die leaving the hand
moveStepgame.audio.hoponce per tile walked, pitch varied
resolvegame.audio.coin_gain / coin_lossby the sign of the coin CHANGE, not the total
starBoughtgame.audio.star_buythe star fanfare; the coin-loss cue is suppressed on that beat
shopgame.audio.shop_chimethe shop opening
showdownStartgame.audio.countdownCOIN CLASH opening
showdownScoregame.audio.grabrate-limited to one per 0.09 s
matchEndgame.audio.win / losewin when P1 takes the match, shared wins included

Two details of the bus worth knowing

  • resolve carries coins and stars as the player's totals after the effect. The coin cue is picked from the difference against the total this component last saw for that seat, so a red tile plays the loss however rich the player is. The totals are re-baselined on roundStart, turnStart and showdownEnd, because the showdown bonus is paid outside a resolve.
  • matchEnd carries winner as a ranking row and winnerSeat beside it, not a seat number.

Mixing

The clips came back from the generator at very different levels — peak from 0.09 (coin_gain) to 1.0 (coin_loss) — and a source's volume is clamped to 1.0 by the mixer, so the loud ones are trimmed down rather than the quiet ones pushed up. Each clip's figure in TRIM is the peak it contributes to the mix: 0.09 to 0.50, against a bed that peaks at 0.14. Every effect therefore lands at or above the bed's loudest transient, and the master stays well under clipping when a loud cue lands on the music.

hop was regenerated: its first generation peaked at 0.003, about 51 dB below every other effect, and nothing the mixer accepts could make it audible.

Needs

  • A game.rules module in the world (require("game.rules")).
  • An AudioListener somewhere in the scene; the camera in scenes/main.scene/build.luau carries one.
  • The eleven clips under game/audio/.