Enter Half-Life Re-imagined, our current competition!
Check out Skewing textures in Hammer, our newest tutorial!
Say hello to Windawz, our newest member!


Site Stuff






Valve Predictions 2017

What's the most likely thing Valve will release this year?



A new game


More overpriced hardware


Source 2 SDK


An army of evil killer cyborgs


The hounds



4 mins


8 mins

Kurosaki Ichigo

12 mins


25 mins

Dr. Orange

39 mins


46 mins


47 mins



A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Sound loop tests

Map Vault > Example Maps

map screenshot

star star star star star
(3 votes)

[More Screenshots]


By DiscoStu (See more)
30th December, 2011

1.11MB - RMF, BSP

Last edited: Never


Objective: 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,



avatar TJB says: 30th December 2011, 03:49 AM
While unfortunately I cannot download and test, from the description it sounds interesting. It could definitely be of use some day.
avatar Tetsu0 says: 30th December 2011, 05:52 AM
Best way to get sound cues in files? (coughfreecough)

interesting, i'll have to DL tomorrow
avatar Captain Terror says: star star star star star 30th December 2011, 06:06 AM
very precisely and carefully done! After all these years, i finally understand what "not toggled" flag is for and now i truly understand exactly what the cue points do and why.

Superb work sir! this should be written up as a tutorial too!

[b]EDIT: LOL it creates quite a cacoughpanously awesoome sound when you willy-nilly start pressing all the buttons! All kinds of ideas are popping up in my haed for some multiplayer maps using all these togglable sounds, but i'm sure it would wreak some seriousl havoc on a server. :P
avatar Skals says: 30th December 2011, 11:12 AM
It is possible to loop sounds with no cues, simply make a trigger_auto, and two trigger_relays, and the ambient_generic.

Then get the trigger_auto to turn the looping sequence on (or you can turn it on in any other way).

name the trigger_relay 1; relay1, name the trigger_relay 2; sound, name the ambient_generis; sound. Then make relay1 trigger sound, and make relay2 trigger relay1, with delay values being the wait between each time the sound is played. This way it will never turn off, the loop.

You can take it a step further at that, by adding a random trigger to make it trigger randomly lets say every 11, 3 or 7 seconds (the sound). This method is great for ambience in CS 1.6.
avatar doggybag71 says: 30th December 2011, 13:27 PM
Wow, good job DiscoStu!

As Captain T said, you should save this in the tutorials section too. It will be easier to find it when it's needed.
avatar DiscoStu says: 30th December 2011, 18:37 PM
Yay, glad you guys like it :D

@Tetsu0: Try GoldWave, it's free if it still exists. It's also ancient. Maybe Audacity can do that too.

@Cap'n & doggybag: I might do a tutorial, but there already are two tutorials on custom sounds and I fear this alone is not worthy of a tutorial. I'll try to write something up, though. Meanwhile, I posted a link to this at the custom sounds tutorial.

@Skals: Sure you can do that. I just meant sounds with no cues won't loop automatically. Also I suspect that method won't loop as perfectly.
avatar Stojke says: star star star star star 24th May 2012, 11:52 AM
avatar Striker says: star star star star star 27th September 2013, 07:41 AM
This was helpful. Thank you.
You must be logged in to comment.