![]() |
CriWare Unreal Engine
Plug-ins for CriWare solutions.
|
Until now, the resources allocation settings was a meticoulus thing to setup correctly. CRI ADX plugin for Unreal 5 is using a different asset loading design depending how the sound is imported or played in editor, played in standalone mode or finally packaged then played on target platform with various file access design. Thus resources settings got more and more complex and difficult to handle.
To simplify and optimize resource allocations, some automatic management for ADX resources have been added:
UE5 CriWare plugin v2.3.0 introduces "Dynamic ADX voice pools management" to offer a better dynamic design depending the situation of the game engine, and game script actions.
UE5 CriWare plugin v2.4.0 introduces "Dynamic CRI FileSystem management" and a "Unique global voice pool" to offer a greatly simplified management of the loading and streaming resources used for sound playbacks.
Voice pools are a cluster of multiple source voices used to playback sound. In ADX they need to be fully defined before playing anything. A source voice may have a decoder to read input encoded sound data, a re-sampler, and a source effect chain. It is used by playback and outputs to buses.
A source voice can reads encoded data stored on-memory or from a file. The StreamingType determines the read access of all voices of a voice pool.
It exists 3 types of streaming:
"Worse case" settings are hard to calculate and the fixed nature of the pools contributes to a substantial lost of resources when they are, most of the time, not fully involved.
An "On Memory" Cue sound designed from Atom Craft have chanche to fight against the memory model of the target architecture by creating more copies.
To resume, Atom Craft Settings, Unreal Editor, Stanalone Play and Packaged Games for various target platforms and the game logic itself, makes the resource loading process different by context.
This asked for a more general but flexible model for resources used by Atom.
Dynamic voice pools are created and destructed on demand by the plugin.
A voice pool is linked to a unique sound source. The pool is created at playtime and freed when sound stops or at playend. Also the voice pool uses settings accordingly to the linked sound source.
Due to their "standalone" nature, all sound sources that are not a AtomSoundCue from an AtomCueSheet will generate a dynamic voice pool for playtime.
In detail, sound sources that use dynamically created voice pools are:
Settings for a dynamically created voice pool (channels, sampling-rate x max pitch factor, memory type...) are set accordingly with sound source to play.
Because Cues are designed externally by Atom Craft and use multiple waves and various playback design, we let the possibility to choose whether to use the global voice pool or let play AtomSoundCue from its own separated dynamic voice pool.
To setup this, each SoundCue have a setting in Voices section:
This will generate the voice pool for the sound source at next play of the cue. Setting of the pool is adjusted accordingly to the 1st waveform settings of the cue. Actually, one pool is created for each playback in Unreal.
This is a unique global voice pool that can decode and play any SoundCue (streamed or on memory) and used for playback by default.
AtomSoundCue not using Dynamic Voices (Default) will be played over the global voice pool.
Global Voice Pool Settings are available in ProjectSettings for ADX Atom.
Alternatively, the "Forces Dynamic Voice Management for Sound Cue" checkbox will remove the Global Voice pool. Any AtomSoundCue will automatically be played using a dynamic voice pool.
By default, ADX will allocate and free FileSystem resources when requested for voice pool creations or data loadings.
Nothing is required.
In case you want to continue to allocate manualy the resources for CRI FileSystem at engine startup, Dynamic FileSystem Management can be disabled in ADX Atom section in Project Settings:
You need to setup a good number of FS Loaders and binders in CriWare Core settings to ensure all your sounds are loadable for any situations.
ADX sound engine need to load and stream sound data to a source voice to play a sound.
The settings "Loading Behavior" from the details panel of AtomCueSheet or AtomWaveBank permits to control the loading/release time into ADX sound engine.
An AtomCueSheet own ACB data as payload that contain binary logic for cues and may also contain encoded soundwave data if set by Atom Craft.
An AtomWaveBank own AWB data as payload that contain encoded soundwave data. Only first chunk of soundwave data is loaded to ADX before play a sound then data is streamed or inline into memeory depending settings.
The sound data will be loaded to ADX using the global rule defined by console variable 'atom.streamcache.AtomSoundBankDefaultLoadingBehavior'.
(0: Default (load on demand), 1: Retain audio data on load, 2: prime audio data on load, 3: load on demand (No audio data is loaded until a UAtomSoundBank is played or primed).)
The sound data will be loaded to ADX when necessary, at the playback timing by AtomComponent.
Cue Sheet resources are not destroyed until the AtomCueSheet asset is destroyed.
The sound data will be loaded to ADX at the same time than the asset is loaded.
Since, playback can be performed with few latency.
The sound data will be loaded to ADX when necessary, at the playback timing from AtomComponent or when primed by PrimeSound() function call in CueSheet.
Therefore, if you try to play the Cue before the Cue Sheet is loaded, it will take little time until playback starts.
The sound data is loaded and fully copied into memory when the asset is loaded. ADX will access to it trough a read/write memory copy.