Huge lag with soundscapes

  • If you're asking a question make sure to set the thread type to be a question!

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
There are 4 different areas in the same room in my custom map (you can imagine it as 4 rooms next to each other connected with doors).
These soundscapes are controlled by trigger_soundscapes and for each soundscape there is a trigger_soundscape covering the entire room.
However when entering after previously activating a completely different soundscape, it causes a huge lag.
Is there a way to avoid these lags?
 

ics

http://ics-base.net
aa
Jun 17, 2010
841
540
Do you have more than 2 soundscapes overlapping eachothers? Are they using game default soundscapes or some custom edited?
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
Do you have more than 2 soundscapes overlapping eachothers? Are they using game default soundscapes or some custom edited?

All soundscapes used are custom ones.
I've also replaced every soundscape_triggerable with normal soundscapes.
However I believe it's the audio which causes the lag when activating it when having another soundscape already active.

It's about this music:
View: https://www.youtube.com/watch?v=5Rq6w_K1K3E

I've downloaded it as a .wav-file with "Free YouTube to MP3 Converter" (original quality) and I've also set a beginning and end mark.
Here's what the soundscape script for this music looks like:


"Am2r.Surface"
{
"playlooping"
{
"wave" "glitchexe/am2r_surface.wav"
"volume" "1"
"pitch" "100"
}
}



btw. the soundscapes are not overlapping
 

AliDances

L1: Registered
Feb 4, 2018
12
2
So even when you are entering the radius of another normal soundscape you get lag? Or is it only with the trigger volumes?
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
So even when you are entering the radius of another normal soundscape you get lag? Or is it only with the trigger volumes?

It's with both. However I only use normal soundscapes now, which activate when entering their radius.
It's the custom am2r-music which causes the lag and I don't know the reason why.
There is only one other custom soundscape which works perfectly together with the am2r-version, but with all the others it causes a lag.
 

henke37

aa
Sep 23, 2011
2,075
515
Perhaps you should use only one soundscape, but give it multiple points to emit sound from?
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
Perhaps you should use only one soundscape, but give it multiple points to emit sound from?

The rooms have multiple entrances and each one has the same soundscape. The minimum of that one music is 3 soundscapes and they're not overlapping each other. When entering the radius, the players should have "eye contact" with the soundscape to let it play (that's why I have 3 of them due to walls)
Emission is not the problem, it's the activation.
 
Last edited:

Tumby

aa
May 12, 2013
1,084
1,192
Are you using any soundscape proxies? https://developer.valvesoftware.com/wiki/Env_soundscape_proxy
If you don't know what they are: They basically extend the influence of an existing soundscape entity. If you need to cover all doors of a room with the same soundscape, use proxies so the game doesn't reload the files.
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
Are you using any soundscape proxies? https://developer.valvesoftware.com/wiki/Env_soundscape_proxy
If you don't know what they are: They basically extend the influence of an existing soundscape entity. If you need to cover all doors of a room with the same soundscape, use proxies so the game doesn't reload the files.

Thanks for the advice. However, even though I've replaced two of them with soundscape proxies referring to the normal one (and it works), the lag still exists. It's probably something else causing it.
 

Tumby

aa
May 12, 2013
1,084
1,192
Did you change the wav file at any point? Delete any sound.cache files you can find as they don't update.
How big is the wav file? Maybe it's so big the sound system has trouble handling it. It's possible to add cue points to an mp3 so look into that.
Did you make sure the wav is in the right format? Maybe the engine has trouble reading it. Double check that the format is absolutely correct.
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
Did you change the wav file at any point? Delete any sound.cache files you can find as they don't update.
How big is the wav file? Maybe it's so big the sound system has trouble handling it. It's possible to add cue points to an mp3 so look into that.
Did you make sure the wav is in the right format? Maybe the engine has trouble reading it. Double check that the format is absolutely correct.

I've tried it with deleting all the sound.cache files. I've also renamed the soundscape because I thought it's because of the number in its name.
However, everything is still the same like before. The lag still exists.
(The wav file has markers and is 03.50 minutes long (39.681 KB) )
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
I found out that the music was just a little bit too long. I've reduced it by cutting out the "unneccessary" parts of the music and now it works perfectly.
The music is now less than 3:10 minutes long and the lag is gone.
 

henke37

aa
Sep 23, 2011
2,075
515
If that is the case then perhaps you should consider making the sound stream. Normally the engine loads in the entire sound at once at the start of playback.

To do this you will need to make a custom sound script in addition to the soundscape.
 
Last edited:

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
If that is the case then perhaps you should consider making the sound stream. Normally the engine loads in the entire sound at once at the start of playback.

To do this you will need to make a custom sound script in addition to the soundscape.

The soundscapes work but when testing the map with sv_pure 2 they're completely silent.
I have a soundscapes_manifest.txt file refering to the soundscapes_<mapname>.txt file which contains all the soundscapes.

I don't know what to put into the scripts/game_sounds_manifest.txt and maps/<mapname>_level_sounds.txt file.
 

Narpas

Takes way to long to make and update maps
aa
Jun 11, 2015
433
436
Have you packed your sounds using CompilePal, Pakrat, or VIDE? You needed to pack in custom content in order for it to work with sv_pure and for other people to see/hear it
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
107
2
Have you packed your sounds using CompilePal, Pakrat, or VIDE? You needed to pack in custom content in order for it to work with sv_pure and for other people to see/hear it

I usually pack with VIDE.
However I've noticed it only detects the scripts/soundscapes_<mapname>.txt file. The wavs and the scripts/soundscapes_manifest.txt file don't get packed

Do I have to add them manually or do I need the scripts/game_sounds_manifest.txt and maps/<mapname>_level_sounds.txt in order to let them being packed (If yes, what should I write in them?)
I'm a bit confused with this