sunfall.package
This package holds more than this page lists. See all of its files in its world.
README.md
SunfallAudio
The whole soundscape of Sunfall Ridge as one component. Put it on any one entity of the scene and it does the rest: it reads the run's shared state (sunfall.game, written every frame by the Run component) and the course (sunfall.course) and plays everything the player hears, from the clips in sunfall.package/sounds/. It needs no sibling component and no other setup.
local audioEntity = entity.spawn("audio")
audioEntity.component.add("SunfallAudio", {})
What it plays
| Layer | When | How |
|---|---|---|
Score: music_title | title, cinematic | warm pads and felt piano, 72 s seamless loop; lifts while the cinematic's title card is up |
Title-card swell: sting_swell | 4.6 s into the cinematic | one-shot over the bed |
Score: music_flight | flight | lighter flowing guitar and strings, 126 s loop; thins out as light falls below 0.25 |
Score: music_dusk | flight, light < 0.22 | low drone and slow pulse, 74 s loop; full by light 0.12 |
High mountain wind: wind_mountain | title, cinematic, result | soft breeze bed |
Evening ambience: ambience_evening + rare distant bird | title, cinematic, result | very sparse |
Wind over the wing: wind_body + wind_air_l/wind_air_r | flight | quiet hiss at 10 m/s to a full roar at 30 m/s; the bright layer rises and brightens with speed (gain and pitch), slow gusting, leans left/right with bank |
Variometer: vario_beep | flight, climb from +0.2 m/s | 500 Hz at 2 beeps/s (+0.3 m/s) up to 1200 Hz at 7 beeps/s (+5 m/s); silent between -2.5 and +0.2 |
Sink tone: vario_sink | flight, sink below -3 m/s | soft low hum, held until the sink eases past -2.5 |
Thermal: thermal_swell | inThermal turns true | one-shot |
Raptors: bird_eagle_1, bird_hawk_2, bird_buzzard_3 | flight, within ~520 m of a thermal | spatial, from an emitter circling each thermal at about the pilot's height; calls every 7-15 s, every 3-7 s while circling in that thermal |
| Endings | state.result changes | landed: touchdown + sting_landed (sting_landed_best for 3 feathers); outlanding: touchdown + sting_outlanding; crash: crash; dark: sting_dark |
UI click: ui_click | every request event | soft one-shot |
Every bed fades toward its target over 1-2 s, starts from its head when it rises out of silence and stops once faded out, so beds nobody hears cost nothing.
Fields
master,music,wind,vario,ambience,effects: levels, 0..1. They multiply each layer's own mix level, and they are read every frame, so a settings slider is heard as it moves.effectscovers the touchdown, crash and UI click.listener(default true): when noAudioListeneris active, it puts one on the play camera (layers.active.camera.entity) so the birds are placed, and takes it off again when the component goes. A scene that places its own listener keeps it.
Methods
report()returns what it is doing now: each bed's gain, target, volume, pitch and the mixer's own report of its voice, the vario's smoothed reading and last beep, and the one-shots played most recently. Tests read it.simulate(state)drives it from a table shaped likeGame.stateinstead of the run's state, andsimulate(nil)hands it back. The test benchscenes/audio_test.sceneuses it to walk every phase while a real run plays beside it.
The clips
They live in sunfall.package/sounds/, and scenes/audio_test.scene/bake_sounds.luau documents how each was made. The music, stings, wind textures, ambience, birds, thermal swell, touchdown, crash and click were generated with @builtin::services.audio_gen (ElevenLabs), then trimmed, levelled and, for the loops, made seamless with an equal-power tail-into-head crossfade. The vario beep, the sink tone and the crash's low thud were synthesized. Loops are Opus at 160 kbps, the click and vario clips are PCM, and every loop reads seamless on clip:loopSeam().
Glide kit's Glider plays a wind loop of its own. Turn it off (sound = false) where this component is used, so only one wind is heard.