Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sound entities can be heard everywhere in level despite the distance being set
Reminiscity Offline
Member

Posts: 81
Threads: 16
Joined: Jan 2013
Reputation: 2
#1
Sound entities can be heard everywhere in level despite the distance being set

As the title reads. The distance is set and is not covering the whole map. KeepPlayingOutOfRange is set to false in the .snt. STILL it can be heard everywhere.

Has anyone had the same problem?

My mod Amadeus
01-01-2016, 01:54 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Sound entities can be heard everywhere in level despite the distance being set

Can you post the text of your .snt? Maybe your ranges are too large or there is something else which may need tinkering~

Discord: Romulator#0001
[Image: 3f6f01a904.png]
01-01-2016, 02:29 PM
Find
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#3
RE: Sound entities can be heard everywhere in level despite the distance being set

Any sound with "ambient" in the name will play throughout the level regardless of distance from the source. I haven't found a solution to that specific issue, but there's usually a non-ambient version if you're using TDD's sounds.

If it's not ambience, try checking for map_cache files in appdata/roaming. It could be that your settings haven't been updated in-game because of a cache file.

Also definitely post the .snt for Romulator. I'm no expert in this and he'll be able to help you more Smile

[Image: quote_by_rueppells_fox-d9ciupp.png]
01-02-2016, 08:52 PM
Find
Newsman Waterpaper Offline
Senior Member

Posts: 735
Threads: 20
Joined: May 2013
Reputation: 39
#4
RE: Sound entities can be heard everywhere in level despite the distance being set

Put this in the .snt file
KeepPlayingOutOfRange="false" and Use3D="True" and mess around the volume and distance should help.
(This post was last modified: 01-02-2016, 08:58 PM by Newsman Waterpaper.)
01-02-2016, 08:57 PM
Find
Reminiscity Offline
Member

Posts: 81
Threads: 16
Joined: Jan 2013
Reputation: 2
#5
RE: Sound entities can be heard everywhere in level despite the distance being set

Here's the content of the .snt. It's an amfp sound that I copied to my isolated full conversion with the goal of making it only heard inside the area I set on the sound entity.

I have double checked my resources.cfg and my mod directory is above the default sound directory so it can't be that the original sound file is loaded. Or can it? xD

<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="amb_sewer_largearea" />
</Main>
</SOUNDS>
<PROPERTIES FadeStart="False" FadeEnd="False" Loop="True" Use3D="true" Stream="True" Blockable="True" Volume="0.35" MinDistance="1" MaxDistance="5" BlockVolumeMul="0.0" Random="1" Interval="0" Priority="0" KeepPlayingOutOfRange="false" />
</SOUNDENTITY>

My mod Amadeus
01-03-2016, 03:23 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#6
RE: Sound entities can be heard everywhere in level despite the distance being set

Alright, this seems to work for some reason. As Newsman Waterpaper above said, you'll need to play around with the Min and MaxDistance. The Min is the distance between the sound's origin and, in Level Editor units*, how far away the sound will be its loudest. The Max Distance is the maximum distance the sound can be heard - at least, until the sound reaches 0 volume. Between Max and Min, the sound will fade depending on distance.

Have a graphic I drew in Paint in a few minutes to show what I mean. This is based on the .snt I have in the code below. Volume can be changed (but 0.8 is pretty loud, since I am pretty sure 1.0 is the cap) and the distances should be changed to suit your environment.
[Image: a2cca15d86.png]

<SOUNDENTITY>
  <SOUNDS>
    <Main>
      <Sound File="amb_sewer_largearea.ogg" />
    </Main>
  </SOUNDS>
  <PROPERTIES FadeStart="False" FadeEnd="False" Loop="True" Use3D="True" Stream="True" Blockable="True" Volume="0.8" MinDistance="1" MaxDistance="5" BlockVolumeMul="0.5" Random="0" Interval="0" Priority="0" KeepPlayingOutOfRange="False" />
</SOUNDENTITY>

This worked for me - but if it still doesn't work, I'll post my poorly created map for you Smile

*Level Editor units being, the standard sized wall is 4 wide and 4 tall. Therefore, a distance of 20 wide would be about 5 default walls.


Previous Post
Spoiler below!
Since I still cannot figure out exactly why it doesn't adjust itself, are you able to take an approach similar to this?

[Image: 2ebbe73a7f.jpg]
The idea is this:
- Blue: The Player cannot hear the sound
- Green The Player can hear the sound (it's within the area, but unfortunately, still as loud as the volume (0.8f))
- Red The Sound Location, which is technically still green, since it plays around.

I set up a ScriptArea around the green area, which, when entered and exited, plays and stops the sound respectably using conditionals. The sound plays at a ScriptArea at the end of the corridor.
PHP Code: (Select All)
//Sound Test

void OnStart()
{
    
AddEntityCollideCallback("Player""ScriptArea_2""fade_sound"false0);
}

void fade_sound(string &in asParentstring &in asChildint alState)
{
    if(
alState == 1)
    {
    
PlaySoundAtEntity("ambience_sewer""amb_sewer_largearea.snt""ScriptArea_1"0false);
    }
    else if(
alState == -1)
    {
    
StopSound("ambience_sewer"3.0f);   //3 second fade out when out of area
    
}


I'll keep looking into this though if this isn't possible - it's really getting me thinking :3

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 01-03-2016, 01:45 PM by Romulator.)
01-03-2016, 12:58 PM
Find




Users browsing this thread: 1 Guest(s)