Mumble NS2 Positional Audio Plugin

HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
edited December 2012 in Modding
>hear< where are your mates
Mumble Natural Selection 2 Positional Audio Plugin
by Hackepeter

Hey NS2 community!
The famous open source voice group chat application Mumble has an awesome feature called Positional Audio:

"Positional Audio is a feature of Mumble that places the people talking to you in a certain position relative to your own depending on their actual position in the game you are playing. This way you can hear the person like his actual avatar in-game would be talking to you."

image
(source)

No surprise that Mumble currently doesn't support Natural Selection 2 in it's beta phase.
BUT to change that I made a plugin for NS2 so that you can use the Positional Audio feature if you like it!

I provide two installation possibilities. You can either install it as a mod or install it directly into NS2 when you already using a mod.

Please read the README.txt for detailed installation instructions and further information about the plugin.

Enjoy! Any feedback is much appreciated :)

Thanks to my testers ale, Gh0ti, Koruyo and Zeikko!




This plugin does not work with the current version of NS2. I'm very sorry! Please read this post:
http://www.unknownworlds.com/ns2/forums/in...t&p=2052024

Version: 1.2
Date: 2012-03-20

DOWNLOAD

Changelog:
  • updated code to work with Build 200
Post edited by Unknown User on
«1

Comments

  • CandideCandide Join Date: 2011-06-28 Member: 106766Members Posts: 16
    It's amazing!
    How does it work? I mean technically.
    Mostly Alien Player.
    Casual Player since 2003 (NS 2.0).
    Skulk movement mastering in progress.
    Lack of FPS means no playing at the moment. (Since build 185)

    Avatar by Kouji_San
  • KoruyoKoruyo AUT Join Date: 2009-06-06 Member: 67724Members, Reinforced - Shadow Posts: 1,702 Fully active user
    edited September 2011
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (Candide @ Sep 10 2011, 03:45 PM) »
    It's amazing!
    How does it work? I mean technically.


    You mean how I programmed it?

    If the DLL gets loaded by Lua I get access to the whole Lua Client VM and can extract the local players position (and camera position). Those values are transported to a shared memory which Mumble provides for Positional Audio data. Mumble will then send this data to your current Mumble Server to forward it to the other Mumble users in your current channel. You also get the player positions of the other users over that way and if you are in the same context (I defined the context as server ip:port and teamnumber) the Positional Audio gets activated. The rest is some math to calculate the volume for each speaker according to the relative player positions and so on.

    The Positional Audio data is updated on every client tick, but it's almost just a bit memory copying of a few bytes, it don't affects the game performance!
  • SkymanderXSkymanderX Green Marine - The Few, The Proud, The Green. Join Date: 2011-07-29 Member: 113006Members Posts: 430
    really nice contribution!
    image
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (SkymanderX @ Sep 21 2011, 02:05 AM) »
    really nice contribution!

    Thank you!

    New update arrived today! Version 1.1:

    Bug fix: Positional Audio was not correctly differentiating between teams, it turns out the context string doesn't like space characters. A new context definition fixes that but makes the plugin incompatible to version 1.0.

    New feature:

    Positional Audio is now working one-way for commanding or being dead. That means if you are a commander you can hear your players on ground with Positional Audio (you can hear from where someone is calling you) but the players on ground hear the commander without Positional Audio because that would be kinda irritating. The same if you are dead, if you following somebody as a dead spectator you can still hear the Positional Audio of them but if you are speaking as a dead player the others hear you without Positional Audio. Furthermore, when they will implement first person view for spectating you will hear exactly the same Positional Audio as the guy that you are following :)

    Enjoy!
  • HeadClotHeadClot Utah Join Date: 2009-12-20 Member: 69724Members Posts: 15
    Hey, Quick Question - Would it be ok if I used this in a Mod that I am making for NS2?
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (HeadClot @ Sep 23 2011, 09:54 PM) »
    Hey, Quick Question - Would it be ok if I used this in a Mod that I am making for NS2?


    Sure! Please use it and forward the feedback about the Plugin back to me. Would like to hear about your mod so keep me informed! :)
  • HeadClotHeadClot Utah Join Date: 2009-12-20 Member: 69724Members Posts: 15
    QUOTE (Hackepeter @ Sep 23 2011, 02:35 PM) »
    Sure! Please use it and forward the feedback about the Plugin back to me. Would like to hear about your mod so keep me informed! :)


    The post is up for Space Station 13

    Feel Free to look over it :)

    http://www.unknownworlds.com/ns2/forums/in...howtopic=115015
  • Ender_74Ender_74 Join Date: 2011-01-28 Member: 79329Members Posts: 110
    Is this adjustable ?
    I'm a huge fan of Ender's game (the book from Orson Scott Card, if you haven't read it yet, man you are really missing out, but I think my nick is obvious enough).

    ...

    Even though at this stage I'll take for granted that you have read it I'll explain my though.
    In this book, they are all playing in front of a simulator and are using microphones. The position of their head determine who will hear them. For instance, when they want to talk to their commander they need raise their face, or lower it when they want to talk to their squad. That would be cool but is not really feasible just yet.
    However, being able to set the different position of sounds for your team mates would be awesome. Hearing a voice coming from above you when it's the commander, so you can easily know that it's him/her. When you are in combat it's sometimes hard to know who talked. And when you hear "Incoming two skulks !!", but it's not directed to you it's disorientating.

    Would it be possible to set different positions for everyone, or for groups of players ? (Comm, squad, close to you, others)

    Ender_74

    No QWERTY keyboard ? No problem
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (Ender_74 @ Oct 17 2011, 07:45 PM) »
    I'm a huge fan of Ender's game (the book from Orson Scott Card, if you haven't read it yet, man you are really missing out, but I think my nick is obvious enough).

    Unfortunately I didn't read Ender's Game but it has amazing good ratings and is also available in my local library, maybe I should give it a try ;)
    QUOTE (Ender_74 @ Oct 17 2011, 07:45 PM) »
    In this book, they are all playing in front of a simulator and are using microphones. The position of their head determine who will hear them. For instance, when they want to talk to their commander they need raise their face, or lower it when they want to talk to their squad. That would be cool but is not really feasible just yet. However, being able to set the different position of sounds for your team mates would be awesome. Hearing a voice coming from above you when it's the commander, so you can easily know that it's him/her.
    [...]
    Would it be possible to set different positions for everyone, or for groups of players ? (Comm, squad, close to you, others)

    It is not possible to provide different players with different positions of each other.
    I can just send the local players position to Mumble and all distribution decisions are handled by the Mumble server.
    It would be possible to limit Positional Audio to squads but I'am not sure if it would be annoying to have it turn on and off multiple times if you enter/leave a squad and at least aliens don't have squads imho.
    To the Commander point, I tried that already through pushing the commanders position to the players so they hear the commander "above" them. It is working BUT the commander is moving so fast and so many time over the whole map so you just hearing him swapping between left and right speaker etc. it is just irritating and confusing and if you have him exactly over your head it sounds of course just like without Positional Audio.
    Currently I implemented the Positional Audio for the Commander unidirectional in that way that the Commander hears his players depending on there position (normal Positional Audio) but the players hear the Commander always "global" (without Positional Audio). I think that approach is the more natural to everyone.
    QUOTE (Ender_74 @ Oct 17 2011, 07:45 PM) »
    When you are in combat it's sometimes hard to know who talked. And when you hear "Incoming two skulks !!", but it's not directed to you it's disorientating.

    That is just why I made the plugin and is already working like that :) At least you can hear where he screams for his life :D

    But sure if you wan't to try something different just contact me and as long as it is technical possible I could set up a test version for trying it out.
  • Ender_74Ender_74 Join Date: 2011-01-28 Member: 79329Members Posts: 110
    My main focus here is for clan matches and I meant this in a more static way that you understood it I think.
    I would want to have the voice of the comm from above me regardless of where he's watching. (I want to recognize his voice over the others)
    Regarding the squads, when we play in matches we decide squads out of the game and try to stick to them during the round, that's when I'll set the position of my squad mates voices.
    I understand it is probably completely different from the mod you are presenting here, I just think it may be useful. And of course would imply some getting used to.
    Ender_74

    No QWERTY keyboard ? No problem
  • culpritculprit Join Date: 2005-01-07 Member: 33527Members, Constellation Posts: 313 Advanced user
    This is a really awesome mod here! I really hope this can get rolled into the NS2 proper. There are definitely some tweaks that could be done to handle to edge cases (comm and distant players). Using specific DSPs on the comm (maybe to simulate a PA intercomm sound - like TF2 announcer) and distant teammates would really help add some polish on this.
  • ZehtukaZehtuka Join Date: 2010-07-26 Member: 72853Members Posts: 11
    They should integrate this in the game and replace the current VOIP.
  • endarendar Join Date: 2010-07-27 Member: 73256Members, Squad Five Blue Posts: 620 Fully active user
    Very nice!

    Just testing this out, cant wait to try it out in a real game.
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    Thank you for all your positiv feedback guys :)

    QUOTE (Zehtuka @ Oct 22 2011, 11:48 AM) »
    They should integrate this in the game and replace the current VOIP.


    hmm the problem is that the plugin is working over Mumble, it can't replace the ingame voice in that way. But I agree that I would really like to see something like that built into the ingame voice of a game. I don't know any game which has such a Positional Audio feature. Of course with the ability to disable it if somebody don't want it.

    At least the devs could integrate the Mumble Link into the engine so it supports Mumbles Positional Audio out of the box. The code for that is under public domain "and can be used, shared or modified freely" so I think there is no licence problem if they would put that in there proprietary engine. There are not many games with native support currently.
  • ale'ale' Join Date: 2011-08-06 Member: 114689Members Posts: 63
    QUOTE (Ender_74 @ Oct 17 2011, 10:44 PM) »
    My main focus here is for clan matches and I meant this in a more static way that you understood it I think.
    I would want to have the voice of the comm from above me regardless of where he's watching. (I want to recognize his voice over the others)
    Regarding the squads, when we play in matches we decide squads out of the game and try to stick to them during the round, that's when I'll set the position of my squad mates voices.
    I understand it is probably completely different from the mod you are presenting here, I just think it may be useful. And of course would imply some getting used to.


    Do you have speakers or headphones that can emulate the sound coming from above? I know I don't. And it shouldn't be a big issue in clan matches anyway because you should learn to recognize the voice of your commander pretty quickly.
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (ale' @ Oct 22 2011, 05:02 PM) »
    Do you have speakers or headphones that can emulate the sound coming from above? I know I don't. And it shouldn't be a big issue in clan matches anyway because you should learn to recognize the voice of your commander pretty quickly.


    Anyway, it is just not possible to hear things from above. Even if you would have such a speaker it would sound the same as from front or behind. The reason is that your ears will get the sound with the same volume and delay so there is there no information for you brain to calculate the position of the sound origin. Just try it with a friend, close your eyes and let him snap his fingers before and behind you. You will have no idea where the sound is coming from, you can just guess it. :) I wish I could implement such features but humans are to limited, you need cat/bat ears or at least more ears like him: click for more ears!!
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members Posts: 634 Fully active user
    the brain calculates the direction by echos and reflections,
    so the brain can defect where a sound is coming from.

    never had this situation, you are walking on the street and
    out of sudden you are jumping to the side and looking up
    because you heard a cracking noise over your head?
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (derWalter @ Oct 23 2011, 12:32 PM) »
    the brain calculates the direction by echos and reflections,
    so the brain can defect where a sound is coming from.

    never had this situation, you are walking on the street and
    out of sudden you are jumping to the side and looking up
    because you heard a cracking noise over your head?


    I'm no expert so I just read the Wikipedia article about sound localization. And reflections and echos are not used for localization calculation by the auditory system, only direct sounds. BUT (and that's new to me) it uses characteristics reflections in the external portion of the ear to detect directions. So it could detected sounds from above. Awesome! But at least not possible to achieve with stereo speakers. ^^

    But thanks for the hint!
  • glimmermanglimmerman Join Date: 2004-04-29 Member: 28300Members, Constellation Posts: 643
    edited October 2011
    Check out the ACRE mod for arma 2 for a good way this should work.

    A nice video of the demo, genera directl 3d during the whole game, some radio chatter at around the 1:20 mark.

    http://www.youtube.com/watch?v=v1TAenJI-zs...feature=related.

    The radio signal is affected by all sorts of things including:

    - the type of radio
    - the power settings of the radio
    - terrain
    - plus other technical stuff I can't remember

    It also has different channels for communication (set by frequencies though, this is a military sim implimentation of it)

    Main things to listen for is the radio noise, and the 3d sound positioning.

    This is using teamspeak 3.

    Also has a few things like if you talk on the radio, people around you will hear your direct talk (aka the 3d sound), as well as your radio dialouge if you are on the same radio frequency.
  • RanemanRaneman Join Date: 2010-01-07 Member: 69962Members Posts: 450
    Now if only there was a clan with a mumble server.
    Raneman's Curated Maps
    MOST BE LOGGED ONTO STEAM COMMUNITY TO VIEW
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (Raneman @ Nov 28 2011, 01:49 AM) »
    Now if only there was a clan with a mumble server.


    At least we and HBZ used Mumble :) The Teamspeak 3 Plugin ACRE from glimmerman's post sounds awesome but I have currently no idea about the Teamspeak 3 plugin API and also no time to dig into it. But maybe I'll give it a shot sometime later.
  • RyneRyne Join Date: 2012-02-25 Member: 147408Members, NS2 Map Tester Posts: 443
    Does this mod still work with B199? I cannot get it to work and typing "mumble" into console does nothing.
    Ryne aka R-W-Ryne (twitch)

    Trying to stream NS2 often: everything from scrims, to gathers, to pub play!
    Ryne's Twitch Page | Ryne's Casts (Steam Group) | Blind's Twitch Page
  • ArkantiArkanti pub baddie Join Date: 2011-07-22 Member: 111781Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow Posts: 694 Advanced user
    So this only works with positional audio for everyone in your Mumble channel right, not in game? Does everyone in Mumble need to be running the plugin for it to work, or just yourself?
    Mr. Arkanti
    noGG Arkanti
    nova | Arkanti
    Pub Baddie

    Co_Summit - A remix of Summit's unique areas to mould it into a better Combat mod experience. I also broke all the textures. Mad skills yo.
    WildGrass Games - I make video games.
  • endarendar Join Date: 2010-07-27 Member: 73256Members, Squad Five Blue Posts: 620 Fully active user
    It is probably broken by now, due to the nature of how these things work.

    And to Arkanti: If you are running the plugin, it will allow others who are running the plugin to have access to your location data, and it will allow you to receive location data from other players running the plugin.

    It can be disconcerting using this, takes a bit to get used to.

  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    QUOTE (Ryne @ Mar 11 2012, 09:33 AM) »
    Does this mod still work with B199? I cannot get it to work and typing "mumble" into console does nothing.


    Thank you for the information!

    I haven't had time the last months to play NS2 by myself but I'll try to fix it. It worked quite a long time without updates from my side so hopefully just some small changes are needed. Stay tuned!
  • Smug_LobsterSmug_Lobster Join Date: 2009-06-22 Member: 67903Members Posts: 109
    Holy crap can't wait to try this. I wish games would all have positional audio for voice communication.
    ¸.¤*¨¨*¤.¸¸...¸.¤*¨¨*¤.
    \¸.¤ dad, im g4y ¤*¨*¤.
    .\¸.¤*¨¨*¤.¸¸.¸.¤*¨¨*¤.
    ..\
    ☻/
    .▌
    / \
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    And there it is!

    I updated the first post to the new version 1.2 which will work with B200 and hopefully many of the following builds.

    Keep in mind that your friends also need the plugin and it's important that all of you are connected to the same server IP. If you host a local server and connect locally but your friends connect over an external IP then Mumble thinks you are playing on different servers and there will be no Positional Audio between you. If you play on normal public servers it should always work, please write an PM when you experience any problems.

    Enjoy!
  • RyneRyne Join Date: 2012-02-25 Member: 147408Members, NS2 Map Tester Posts: 443
    QUOTE (Hackepeter @ Mar 20 2012, 09:49 AM) »
    And there it is!

    I updated the first post to the new version 1.2 which will work with B200 and hopefully many of the following builds.

    Keep in mind that your friends also need the plugin and it's important that all of you are connected to the same server IP. If you host a local server and connect locally but your friends connect over an external IP then Mumble thinks you are playing on different servers and there will be no Positional Audio between you. If you play on normal public servers it should always work, please write an PM when you experience any problems.

    Enjoy!


    Thanks man, Ill give it a try tonight! Really appreciate the work you put into this.
    Ryne aka R-W-Ryne (twitch)

    Trying to stream NS2 often: everything from scrims, to gathers, to pub play!
    Ryne's Twitch Page | Ryne's Casts (Steam Group) | Blind's Twitch Page
  • SquishpokePOOPFACESquishpokePOOPFACE -21,248 posts (ignore below) Join Date: 2012-10-31 Member: 165262Members, Reinforced - Shadow Posts: 1,654 Advanced user
    QUOTE (Zehtuka @ Oct 22 2011, 02:48 AM) »
    They should integrate this in the game and replace the current VOIP.


    Sucks to be those who can only hear out one ear...
    To be fair, you have to have a very high IQ to play Natural Selection 2. The gameplay is extremely subtle, and without a solid grasp of military strategy and advanced mathematics you won't even win a single game. Theres also the game's nihilistic outlook, which is deftly woven into the game. The maps and artwork draw heavily from Riddley Scott's Alien franchise, for instance. The players understand this stuff, they have the intellectual capacity to truly appreciate the depth of the game, to realise that it's not just great, that it also says something about LIFE. As a consequence people who dislike Natural Selection 2 truly ARE idiots. of course they wouldn't appreciate, for instance, the humour in the Marines' existential catchphrase "how do I get to be so good", which itself is a cryptic reference to the high degree of intelligence required to play the game as intended. I'm smirking right now just imagining one of those addlepated simpletons scratching their heads in confusion when spectating a game. What fools... how I pity them. And, yes, by the way, i DO have a Fade tatoo. And no, you cannot see it. it's for the ladies' eyes only, and even then they have to demonstrate that they are within 50 hive skill points of my own (preferable lower) beforehand. Nothin personnel kid.
Sign In or Register to comment.