To find out the difference between using cues and not using them in a sound file in the Half Life engine.Procedure:
The theory is that, for audio files to be looped, there has to be one cue at the start of the file and one at the end. The test uses six separate sound files, all containing the same 4-second audio data but different cues.
They are set as follows:
One file with no cues at all.
One file with 1 cue, set at 0:00
One file with 1 cue, set at a random point different than 0:00 (set at 0.5s)
One file with 2 cues, the first at 0:00 and the last at the very end (4 sec)
One file with 2 cues, in two random locations different than the very ends (set at 1.5s and 3s respectively)
One file with 3 cues, in three random locations different than the start and end (set at 1.5s, 3s and 3.5s respectively)
The test is arranged in four groups of tests. All ambient_generics have the "play everywhere" and "start silent" flags.
The first group of 6 ambient_generics are individually triggered and are toggled.
The second group of 6 ambient_generics are also individually triggered, but are also set to "not toggled".
The third group of 6 ambient_generics are toggled and triggered all at once by a single button, to demonstrate how they all end up out of sync due to differently placed cues.
The fourth group of 6 ambient_generics are not toggled and also triggered all at once by a single button.Test Results:Sound files with no cues
will not loop at all, even if set to toggled ("toggle/not-toggle" flag has no effect).Sound files with cues
will play the first time from 0:00 to the very end, and then loop between the first two cues. If only one cue is present, it will loop from said cue to the end of the file.
If two cues are present and they are at each end of the file, the sound will loop from start to end; but if said cues are placed at random points in the file, the complete audio will only be heard once, at least until the sound is turned off and then back on.
Files with three or more cues will only use the first two cues and ignore the rest.
Sound files with cues will always loop
, regardless of the "toggled" flag; but there is
a difference. If set to toggle, the sound can be toggled on/off any time. If the flag is set to not toggled, there will be no way to turn the sound off
. It will only ever be silent if "start silent" is used, and only until it is triggered. Further triggering will only cause the sound to jump back to 0:00 and continue playing (looping between its cue points, if set)
As always, I hope this will serve as a working example of generally unexplored engine features (being mostly edge cases), and that others will find this an useful and interesting learning experience (and maybe even find inspiration to push the engine even further)
Love to all,