View topic - Making sounds audible again

 All times are UTC + 1 hour

 Page 1 of 1 [ 18 posts ]
Author Message
 Post subject: Making sounds audible againPosted: 30 May 2005, 22:24
 Spring Developer

Joined: 14 Mar 2005, 12:32
Location: The Netherlands
 Many feel that the current model for rendering sounds is not quite fit when the camera is zoomed out; see the thread http://taspring.clan-sy.com/phpbb/viewtopic.php?t=1248 for a reference. Forget the models I proposed there for a moment, 'cause I got a new one (with matching diagram, of course). I suggest that the volume of the sound is determined by how far events are located from the middle of the screen. Here's what it would look like: The white plane is a portion of the map, and the camera sees everything in within the blue line (I used the approximation that the camera sees a circle, not a square). The purple line is the direction along which the camera looks. Now the bright green dot is the location of a sound event. The green line runs from the the sound event to purple line to which it is perpendicular, and lies in the yellow plane. In the current situation in Spring the red line (from the camera to the sound event) is used for calculating the volume; I propose we use the green line instead. This way the sounds won't fade away when you zoom out a bit: the volume only depends on how far things are from the center of your screen. There is a minor problem though: I don't know how to implement this nicely. It can be done with the camera->rot.x and camera->rot.y properties, but I think OpenGL (of which I know absolutely nothing) has a few commands that will come in handy. I'm thinking in the direction of "getting rotation matrix, rotate locations of camera and sound event, calculate the length of the green line," but that's as far as I get. Any suggestions?

 Post subject: Posted: 31 May 2005, 07:21

Joined: 30 Oct 2004, 13:14
 Dude, you have got it all wrong. Use the distance, but when calculating the distance have the 'height' component affect it less than the XY component.

 Post subject: Posted: 31 May 2005, 08:15

Joined: 16 Aug 2004, 05:15
Location: New Zealand
 I'm sure there are sound libraries out there that do this sort of carry on.

 Post subject: Posted: 31 May 2005, 09:45
 Spring Developer

Joined: 14 Mar 2005, 12:32
Location: The Netherlands
 Doomweaver wrote:Dude, you have got it all wrong.Use the distance, but when calculating the distance have the 'height' component affect it less than the XY component. I don't think I have (and frankly I believe you haven't given this enough thought). With my 'solution' you have a "what you hear is what you see" situation, whereas with your idea you can easily hear things coming from the back of the camera. This is of course not necessarily an evil situation, but it's nothing like the thing you had in OTA. It's all just a matter of taste though. Do we want a soundmodel with which we can hear the things we see, or do we go for the more realistic version in which you don't hear crap? (As you many notice I'm not enterily objective in this part).

 Post subject: Posted: 31 May 2005, 10:12

Joined: 09 May 2005, 14:33
Location: Sweden
 colorblind, your idea sounds nice, but how does it work in "fps-mode" or in "C" mode? Then you whant to hear whats around you and not what you are looking at.

 Post subject: Posted: 31 May 2005, 10:26
 Spring Developer

Joined: 14 Mar 2005, 12:32
Location: The Netherlands
 Good point. Guess we'll have to have 2 soundmodi: one for the TA camera and one for the FPS camera.

 Post subject: Posted: 31 May 2005, 13:42

Joined: 30 Oct 2004, 13:14
 Guys, we don't need this complexity. In real life you hear sounds from all round! If a plane flies over you, and then is suddenly audible as it's wing brushes the camera's FOV, then that's lame! You can make it so that we have something more complex than the current distance volume relationship. If you want, you can say the audibility of a sound is drops of with Height^0.5, or XY distance^2. Because as you have pointed out, if we just make sounds louder than that's fine for zoomed out view, but when you zoom in it's too damn loud. Infact, you can calculate the area of that blue circle and rig your XY dropoff so that volume only really starts dropping off there. Then, as i said, use the square root of the height distance, so planes are not uber loud. But the key is to treat the XY and Z components differently. The angle your camera is at should not affect how loud stuff is!

 Post subject: Posted: 31 May 2005, 14:37
 Spring Developer

Joined: 14 Mar 2005, 12:32
Location: The Netherlands
 I'm sorry, but I'm afraid you still don't get it. (And I'm also sorry for the long reply; next time I'll try to write a shorter one). My proposal was not concerned with 'real life', or making the simulation as real as possible. It is concerned with gameplay. I want to hear the stuff I see. For example: when a unit is at the center of my screen, I want it to have 100% sound volume. But when it is, say, halfway my screen, I want it to have less (say 75%) sound volume. When it's outside my screen, I want it to have significantly less volume. In order to make this work, you need the angle of the camera. It's the location of the event coordinate system of the camera that's important, not the location in map-coordinates. You have to let go of the standard xyz-coordinates and rotate them to the camera's frame of reference. Also, you agree to most of 'this complexity', although you formulate things a bit different. I believe my model brings about the 'What You See Is What You Hear'-experience in more straightforward and natural manner than your kind of handwaving approach. But there's only one way to find out: code it. Concercing that my original question still stands: is there any library or API that already does this kind of thing? I've digged through the DS3D reference, but I couldn't find anything ...

 Post subject: Posted: 31 May 2005, 15:19
 Kernel Panic Co-Developer

Joined: 16 Nov 2004, 13:08
 The important point is to make sure the dgun sound volume is the same if you're looking at the commander from very far above or if you're inside the commander. Currently sound is deafening in FPS mode and barely audible in overview. That is what must be fixed. Read the thread this one is a spin-off of.

 Post subject: Posted: 31 May 2005, 20:04

Joined: 02 May 2005, 02:56
 Basically this is my idea... the distance from your "point on the ground" to camera determines how loud EVERYTHING is, distance from "point on the ground" to sound objects determines how loud those will be in relationship to other sounds...

 Post subject: Posted: 01 Jun 2005, 01:08

Joined: 21 Apr 2005, 19:46
 I like Colorblind's proposal. I would edit the code and make a patch that the devs can test to see how it works. Then it will get integrated if the SY's think it should. Also, you will definitely need other models for the different camera modes.

 Post subject: Posted: 01 Jun 2005, 10:43
 Spring Developer

Joined: 14 Mar 2005, 12:32
Location: The Netherlands
 zwzsg wrote:The important point is to make sure the dgun sound volume is the same if you're looking at the commander from very far above or if you're inside the commander. I think that's already been taking care of. The CSound class has multiple functions for playing a sound: Code:void PlaySound(int id);void PlaySound(int id,CWorldObject* p,float volume=1);void PlaySound(int id,const float3& p,float volume=1); The first one is used for sounds that you want to have 100% volume, no matter where the camera is. The other two are distance dependent; these are the ones we have to modify. @Ace07: Thanks. The simplest implementation would probably be to first rotate to the frame of reference of the camera, after which you can simply calculate the length of the green line by subtraction. I'm only bumped as to what the easiest way of rotation is. You can do this with the camera->rot.x & camera->rot.y properties. But I'm quite sure the properties of the camera are also somewhere stored in an OpenGL variable, and OpenGL probably has some nifty features for point rotation. The thing is I'm not an OpenGL hero ...

 Post subject: Posted: 01 Jun 2005, 12:20

Joined: 09 May 2005, 14:33
Location: Sweden
 Quote:The first one is used for sounds that you want to have 100% volume, no matter where the camera is. D-gun, this shuld be altered imo. Anoying almost blowing your speakers everytime there is a d-gun somewhere, shure d-gun shuld be loud, but not THAT loud. if you start messing with the code, don't forget to so something about this...

 Post subject: Posted: 01 Jun 2005, 12:59

Joined: 19 Aug 2004, 16:38
Location: Togliatti, Russia
 I completely and absolutely object to "hearing what you see". You should hear what you should hear, not as if you have a directional mic. You don't want to hear gunfire and all the blasts when you're looking at a battle, but you rather want to hear the unit replies. That's my proposition. The system remains as it is (with a limit to maximum sound volume), with the exception of unit replies that are always full volume when on screen, and half volume when off screen, just as it was in TA.

 Post subject: Posted: 01 Jun 2005, 13:50

Joined: 30 Oct 2004, 13:14
 Yeah, hearing what you see would I think really take away from the experience. I mean, generally the camera is looking more or less strait down, so you pretty much would hear what you see if you just used the squareroot method. Because double the distance from the center of the camera in the XY plane means you get half the volume, whearas a unit that rushes by your screen isn't going to blow up the speakers and possibly cause the user a electric shock.

 Post subject: Posted: 01 Jun 2005, 14:08
 Spring Developer

Joined: 14 Mar 2005, 12:32
Location: The Netherlands
 Sean Mirrsen wrote:Unit replies (...) are always full volume when on screen, and half volume when off screen, just as it was in TA. I'm with that. Unit replies are the single most important thing you want to hear, and have to be louder than anything else. But still, I don't like the current situation where you almost hear no gunfire whatsoever when you're zoomed out. I want that to. (Frankly, I can't imagine why you would want to stick to the current situation.) Your proposition can be accomodated by my model; you just have to make the distance dependent sound less loud than the unit replies. And that can be easily built in (I think).

 Post subject: Posted: 01 Jun 2005, 14:57

Joined: 02 May 2005, 02:56
 ANother glitch that should be looked into, when building a block of buildings (this sometimes locks out the game too so might need other looks at too) it multiplies the confirmation sound volume and just comes out as a loud booming screechy noise...

 Post subject: Posted: 01 Jun 2005, 20:43

Joined: 19 Aug 2004, 16:38
Location: Togliatti, Russia
 Yeah, I noticed that. colorblind, I really like the current system. If I remember correctly, there were even mods to remove overly loud repeating sounds (i.e. EMG fire), and now you will only hear gunfire if you really want (and need) to hear it. Maybe make the sound volume be dependant on the XZ coord difference, rather than total distance between sound and camera.... I'm still not sure if I'd like that. A much milder solution would be to reduce sound falloff, maybe even via a slider. So, you will be able to hear gunfire and explosions even from a considerable distance. Unit replies should still be louder than anything else though... and any command given to any number of units should always yield one single reply sound.

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 18 posts ]

 All times are UTC + 1 hour

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Spring    Community News       News Submissions    General Discussion    Help & Bugs    Game Lobby       Spring Clans       Lobby Clients    Tournaments    Linux    Mac OS X    Off Topic Discussion Content Creation    Game Development       Game Development Tutorials & Resources    Map Creation       Map Tutorials & Resources    Art & Modelling       Modelling & Texturing Tutorials & Resources    Project Subforums       Kernel Panic       Zero-K       Balanced Annihilation       Spring: 1944       Star Wars: Imperial Winter       XTA       Supreme Annihilation       Caydr's Projects       Evolution RTS       Argh's Projects       The Cursed       NOTA       Damned       Conflict Terra       Engines Of War       Spring Tanks       Journeywar       BattleTech: Legacy       Dune: Evolution       Progressive Annihilation       TA: Factions    Sound Effects & Music Development    News    Development       Dedicated Developer Discussion       New Developer Discussion       Infrastructure Development       Meeting Minutes    AI    Feature Requests    Lua Scripts       The Werewolf Game Site content    Site content       Banners       Welcome images       Videos       Videos - contributions       Screenshots       Screenshots - contributions