Notes from learning Verse and building audio systems in UEFN, treated as a second implementation language alongside Blueprint. Newest entry first.

Random spot ambience in Verse

Spot sounds are what stop an ambience feeling like a loop: a distant call, a creak, something moving. Here is a small device that plays a random audio player from a list at random intervals. It's the Verse version of a Blueprint timer with a random delay.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Random }

# Plays a random audio player from a list, at random intervals.
spot_ambience_device := class(creative_device):

    # Drag your audio player devices into this list in the Details panel
    @editable
    Spots : []audio_player_device = array{}

    @editable
    MinDelay : float = 4.0

    @editable
    MaxDelay : float = 12.0

    OnBegin<override>()<suspends> : void =
        loop:
            Sleep(GetRandomFloat(MinDelay, MaxDelay))
            # Guard against an empty list before picking an index
            if (Spots.Length > 0, Index := GetRandomInt(0, Spots.Length - 1), Spot := Spots[Index]):
                Spot.Play()

What it shows

  • @editable fields appear in the Details panel, so a level designer can swap sounds and change timings without opening the code.
  • loop: with Sleep() does the job of a Blueprint timer, and runs as a single readable block.
  • The if guard handles an empty list, because picking from nothing is a runtime failure.

Next: weighting the spots, so rarer sounds fire less often, and keeping the same sound from playing twice in a row.

Note: a sketch written to show the shape of the approach. Check device and function names against the Verse API reference for your UEFN version before using it.

Clip to follow
// Spot ambience device — test clip

Hello, Verse: a trigger-driven ambience zone

The first useful audio device is a zone: step in and the ambience starts, step out and it stops. Two trigger devices mark the entry and exit, and one audio player holds the loop.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# Starts an ambience loop when a player enters a trigger, stops it when they leave.
ambient_zone_device := class(creative_device):

    @editable
    EnterTrigger : trigger_device = trigger_device{}

    @editable
    ExitTrigger : trigger_device = trigger_device{}

    @editable
    AmbienceLoop : audio_player_device = audio_player_device{}

    OnBegin<override>()<suspends> : void =
        EnterTrigger.TriggeredEvent.Subscribe(OnEnter)
        ExitTrigger.TriggeredEvent.Subscribe(OnExit)

    OnEnter(MaybeAgent : ?agent) : void =
        AmbienceLoop.Play()

    OnExit(MaybeAgent : ?agent) : void =
        AmbienceLoop.Stop()

This is deliberately simple, with a hard start and stop. Fades and overlapping zones are the obvious next steps, and the same questions apply as in the Blueprint ambient system I'm planning on the UE page.

Note: a sketch written to show the shape of the approach. Check device and function names against the Verse API reference for your UEFN version before using it.

Starting out with Verse

Verse is the scripting language for UEFN. For a sound designer the useful part is that it drives devices such as audio players, triggers and timers, so ambience and reactive audio can be built and shipped without touching C++. UEFN is also an increasingly important place to ship audio, which is why the Ballistic credit sits on this site.

Coming from Blueprint

  • Events become Subscribe() calls on a device's event.
  • Timers and delays become Sleep() inside a loop.
  • Exposed variables become @editable fields set in the Details panel.
  • Actors become devices: small classes you place in the level and wire together.

This page logs the small devices I write to learn it, and what I find along the way.