Mumble NS2 Positional Audio Plugin
Hackepeter
Join Date: 2003-06-08 Member: 17107Members, Constellation
<div class="IPBDescription">>hear< where are your mates</div><div align='center'><!--coloro:#ADD8E6--><span style="color:#ADD8E6"><!--/coloro--><!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->Mumble Natural Selection 2 Positional Audio Plugin<!--sizec--></span><!--/sizec-->
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->by Hackepeter<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc--></div>
Hey NS2 community!
The famous open source voice group chat application <a href="http://mumble.sourceforge.net" target="_blank">Mumble</a> has an awesome feature called Positional Audio:
<div align='center'>
"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."
<img src="http://mumble.sourceforge.net/w/images/c/c3/Positional_Audio.gif" border="0" class="linked-image" />
(<a href="http://mumble.sourceforge.net/Positional-Audio" target="_blank">source</a>)
</div>
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.
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Please read the <b>README.txt</b> for detailed installation instructions and further information about the plugin.<!--sizec--></span><!--/sizec-->
Enjoy! Any feedback is much appreciated :)
Thanks to my testers ale, Gh0ti, Koruyo and Zeikko!
---------------------------------------------------
<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo--><!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->
This plugin does not work with the current version of NS2. I'm very sorry! Please read this post:<!--colorc--></span><!--/colorc--><!--sizec--></span><!--/sizec--> <a href="http://www.unknownworlds.com/ns2/forums/index.php?s=&showtopic=114904&view=findpost&p=2052024" target="_blank">http://www.unknownworlds.com/ns2/forums/in...t&p=2052024</a>
Version: 1.2
Date: 2012-03-20
<strike><a href="http://goo.gl/E3TuS" target="_blank"><!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->DOWNLOAD<!--sizec--></span><!--/sizec--></a></strike>
<b>Changelog:</b>
<ul><li> updated code to work with Build 200</li></ul>
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->by Hackepeter<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc--></div>
Hey NS2 community!
The famous open source voice group chat application <a href="http://mumble.sourceforge.net" target="_blank">Mumble</a> has an awesome feature called Positional Audio:
<div align='center'>
"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."
<img src="http://mumble.sourceforge.net/w/images/c/c3/Positional_Audio.gif" border="0" class="linked-image" />
(<a href="http://mumble.sourceforge.net/Positional-Audio" target="_blank">source</a>)
</div>
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.
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Please read the <b>README.txt</b> for detailed installation instructions and further information about the plugin.<!--sizec--></span><!--/sizec-->
Enjoy! Any feedback is much appreciated :)
Thanks to my testers ale, Gh0ti, Koruyo and Zeikko!
---------------------------------------------------
<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo--><!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->
This plugin does not work with the current version of NS2. I'm very sorry! Please read this post:<!--colorc--></span><!--/colorc--><!--sizec--></span><!--/sizec--> <a href="http://www.unknownworlds.com/ns2/forums/index.php?s=&showtopic=114904&view=findpost&p=2052024" target="_blank">http://www.unknownworlds.com/ns2/forums/in...t&p=2052024</a>
Version: 1.2
Date: 2012-03-20
<strike><a href="http://goo.gl/E3TuS" target="_blank"><!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->DOWNLOAD<!--sizec--></span><!--/sizec--></a></strike>
<b>Changelog:</b>
<ul><li> updated code to work with Build 200</li></ul>
Comments
How does it work? I mean technically.
How does it work? I mean technically.<!--QuoteEnd--></div><!--QuoteEEnd-->
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!
Thank you!
<!--coloro:#4169E1--><span style="color:#4169E1"><!--/coloro--><!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->New update arrived today! Version 1.1:<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc-->
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.
<b>New feature:</b>
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!
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 :)
<a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=115015" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=115015</a>
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)
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 ;)
<!--quoteo(post=1880319:date=Oct 17 2011, 07:45 PM:name=Ender_74)--><div class='quotetop'>QUOTE (Ender_74 @ Oct 17 2011, 07:45 PM) <a href="index.php?act=findpost&pid=1880319"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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)<!--QuoteEnd--></div><!--QuoteEEnd-->
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.
<!--quoteo(post=1880319:date=Oct 17 2011, 07:45 PM:name=Ender_74)--><div class='quotetop'>QUOTE (Ender_74 @ Oct 17 2011, 07:45 PM) <a href="index.php?act=findpost&pid=1880319"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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.<!--QuoteEnd--></div><!--QuoteEEnd-->
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.
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.
Just testing this out, cant wait to try it out in a real game.
<!--quoteo(post=1881148:date=Oct 22 2011, 11:48 AM:name=Zehtuka)--><div class='quotetop'>QUOTE (Zehtuka @ Oct 22 2011, 11:48 AM) <a href="index.php?act=findpost&pid=1881148"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->They should integrate this in the game and replace the current VOIP.<!--QuoteEnd--></div><!--QuoteEEnd-->
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 <a href="http://mumble.sourceforge.net/Link" target="_blank">Mumble Link</a> 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.
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.<!--QuoteEnd--></div><!--QuoteEEnd-->
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: <a href="http://www.guardian.co.uk/artanddesign/2009/apr/14/performance-artist-ear-impant" target="_blank">click for more ears!!</a>
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?
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?<!--QuoteEnd--></div><!--QuoteEEnd-->
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!
A nice video of the demo, genera directl 3d during the whole game, some radio chatter at around the 1:20 mark.
<a href="http://www.youtube.com/watch?v=v1TAenJI-zs&feature=related" target="_blank">http://www.youtube.com/watch?v=v1TAenJI-zs...feature=related</a>.
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.
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.
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.
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!
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!
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!<!--QuoteEnd--></div><!--QuoteEEnd-->
Thanks man, Ill give it a try tonight! Really appreciate the work you put into this.
Sucks to be those who can only hear out one ear...