FIX FOR sound falling off too soon.

FragmagnetFragmagnet Join Date: 2010-07-26 Member: 72873Members
edited February 2012 in NS2 General Discussion
<div class="IPBDescription">Why is this even an issue?</div>go to your Client.lua
find function OnMapPostLoad()

replace the first line after // Set sound falloff defaults

with

Client.SetMinMaxSoundDistance(7, 500)

THIS DOES NOT FIX THE FACT THAT SOUNDS ARE PLAYED FROM THE ORIGIN
I am looking for that though.

THIS FIXES
The issue where, for example, you won't hear a marine sniping you with a pistol.
THIS CAN STILL HAPPEN but the marine has to be 5 times as far now.

Comments

  • RokiyoRokiyo A.K.A. .::FeX::. Revenge Join Date: 2002-10-10 Member: 1471Members, Constellation
    edited February 2012
    Ah hah! WIN!

    EDIT: Just tried this out. And it was amazing. +999
  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members
    is this overriding the min max distances set in fmod designer? or is it just a multiplier for the settings in designer?

    if its a multiplier then this is an awesome fix and wil make my life much easier! i really need the min max ratios between events to stay consistent tho, there are some sounds like hive wound that need a much larger min distance than others


    cheers
  • RokiyoRokiyo A.K.A. .::FeX::. Revenge Join Date: 2002-10-10 Member: 1471Members, Constellation
    edited February 2012
    I don't really know the implementation details, but it felt like the spectrum was stretched out over the longer distance. My guess would be multiplier.

    That being said, there were certainly some oddities... As if the muffling effect for walls wasn't working as effectively. Occasionally I'd hear skulks munching on a res-node off in the distance, as if they were halfway across an open football pitch as opposed to on the otherside of several winding cave systems.

    Overall it felt much better though, being able to hear what I could plainly see on the other side of a room was like the world suddenly making sense for the first time.

    EDIT: Sheesh...Fragmagnet, how did you even come across that function? I was going to try and see if I could figure out what the SetMinMaxSoundDistance function was actually doing, but I'm not seeing where the heck it's even defined. The only other reference to even "SoundDistance" I could find in the entire project was in the observatory files... I can only assume that function is talking directly to the C++ side of things.
  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members
    edited February 2012
    cool, i want to try this out but my client.lua dosnt have the // Set sound falloff defaults line in there do i just put it after OnMapPostLoad()

    im not a programmer obviously :(


    actually nvmnd i found it
  • RokiyoRokiyo A.K.A. .::FeX::. Revenge Join Date: 2002-10-10 Member: 1471Members, Constellation
    Programmer or not, our collective ears love your work all the same!
  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members
    aw shucks! thanx

    try this to fix the muffling problem with extended fall offs

    In the console type

    reloadsoundgeometry 0.5 0.5

    for example. The first value is the occlusion, second is reverb, both should be between 0 and 1.
    current values are
    0.4 for occlusion and 0.2 for reverb

    lower numbers mean less obstruction by geometry
  • BonesXBonesX Join Date: 2007-02-04 Member: 59883Members, Constellation
    ok simon- or anyone else. i dont see this in the CLient.lua file. I tried loooking in the other files but no luck. Where did you find this?
  • RokiyoRokiyo A.K.A. .::FeX::. Revenge Join Date: 2002-10-10 Member: 1471Members, Constellation
    Lines 560-576:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->/**
    * Callback handler for when the map is finished loading.
    */
    function OnMapPostLoad()

        // Set sound falloff defaults
        Client.SetMinMaxSoundDistance(7, 100)
        
        InitializePathing()
        
        CreateDSPs()
        
        Scoreboard_Clear()
        
        CheckRules()
        
    end<!--c2--></div><!--ec2-->

    All of that should already exist in your Client.Lua. Find those lines, and then change the 100 to a 500.
  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members
    yeh this does work quite well, it will need some tweeks to the reverbs but its much nicer to extent the fall offs this way then when i was trying to do it to each individual sound in designer. thanx!

    ill test this out some more and get it put in to the official patches.
  • LuKeLuKe Join Date: 2011-11-05 Member: 131316Members
    <!--quoteo(post=1903435:date=Feb 15 2012, 11:15 AM:name=Rokiyo)--><div class='quotetop'>QUOTE (Rokiyo @ Feb 15 2012, 11:15 AM) <a href="index.php?act=findpost&pid=1903435"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Lines 560-576:<!--QuoteEnd--></div><!--QuoteEEnd-->

    Hmm, my Client.lua file only goes to line 20...
  • FragmagnetFragmagnet Join Date: 2010-07-26 Member: 72873Members
    I found this command very easily.

    open decoda
    Find in files
    falloff
    ns2 directory
    include subfolders

    and then looked through stuff cuz I was bored.
  • RokiyoRokiyo A.K.A. .::FeX::. Revenge Join Date: 2002-10-10 Member: 1471Members, Constellation
    <!--quoteo(post=1903434:date=Feb 16 2012, 02:03 AM:name=BonesX)--><div class='quotetop'>QUOTE (BonesX @ Feb 16 2012, 02:03 AM) <a href="index.php?act=findpost&pid=1903434"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->ok simon- or anyone else. i dont see this in the CLient.lua file. I tried loooking in the other files but no luck. Where did you find this?<!--QuoteEnd--></div><!--QuoteEEnd--><!--quoteo(post=1903455:date=Feb 16 2012, 03:18 AM:name=LuKe)--><div class='quotetop'>QUOTE (LuKe @ Feb 16 2012, 03:18 AM) <a href="index.php?act=findpost&pid=1903455"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Hmm, my Client.lua file only goes to line 20...<!--QuoteEnd--></div><!--QuoteEEnd-->
    Oh look at that, turns out there are multiple Client.lua files! Oops.

    Okay, the one you want is in Steam\steamapps\common\natural selection 2\ns2\lua

    It should be 23kb in size, and in the same folder as 375 other lua files.
  • LuKeLuKe Join Date: 2011-11-05 Member: 131316Members
  • BonesXBonesX Join Date: 2007-02-04 Member: 59883Members, Constellation
    <!--quoteo(post=1903552:date=Feb 16 2012, 12:15 AM:name=Rokiyo)--><div class='quotetop'>QUOTE (Rokiyo @ Feb 16 2012, 12:15 AM) <a href="index.php?act=findpost&pid=1903552"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Oh look at that, turns out there are multiple Client.lua files! Oops.

    Okay, the one you want is in Steam\steamapps\common\natural selection 2\ns2\lua

    It should be 23kb in size, and in the same folder as 375 other lua files.<!--QuoteEnd--></div><!--QuoteEEnd-->



    /rofl

    Whew- I thought i was going crazy! Thanks for teh tip. +1
  • FragmagnetFragmagnet Join Date: 2010-07-26 Member: 72873Members
    Yeah I probably should have given the file location huh.
  • IronHorseIronHorse Developer, QA Manager, Technical Support & contributor Join Date: 2010-05-08 Member: 71669Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Subnautica Playtester, Subnautica PT Lead, Pistachionauts
    <!--quoteo(post=1903519:date=Feb 15 2012, 01:55 PM:name=Fragmagnet)--><div class='quotetop'>QUOTE (Fragmagnet @ Feb 15 2012, 01:55 PM) <a href="index.php?act=findpost&pid=1903519"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->and then looked through stuff cuz I was bored.<!--QuoteEnd--></div><!--QuoteEEnd-->

    i dont know how you have the time, but your boredom has been consistently leading to a better NS2... please don't get a job or anything like that, you're needed here more :)
  • FragmagnetFragmagnet Join Date: 2010-07-26 Member: 72873Members
    <!--quoteo(post=1903612:date=Feb 15 2012, 08:27 PM:name=ironhorse)--><div class='quotetop'>QUOTE (ironhorse @ Feb 15 2012, 08:27 PM) <a href="index.php?act=findpost&pid=1903612"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->i dont know how you have the time, but your boredom has been consistently leading to a better NS2... please don't get a job or anything like that, you're needed here more :)<!--QuoteEnd--></div><!--QuoteEEnd-->

    Hey.
    Some gotta start.
    Some gotta be a part of started things.
Sign In or Register to comment.