Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

duke

Do any games factor in the speed of sound?

This topic is 5324 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was thinking the other day about how sound doesn''t travel at instantaneous speed (obviously) but I think most if not all games model it this way. As an example: Imagine you are standing on a virtual mountain and about 1 KM away an apache helicopter gets hit by a missile and crashes into the ground. You see the helicopter crash into the earth and explode in a fiery explosion. You also hear this explosion as you are seeing it explode. This is the scenario most game engines would do, but in reality you would hear the explosion shortly after seeing the explosion. Does anyone know if any games (or game engines) actually take this type of thing into consideration? I was thinking of modifying my engine to create a sound sphere which would increase in diameter at the speed of the sound, and when that sphere first enveloped a listener, the sound would be instructed to be played.... I dont know if it is worth the effort, but I figure if noone else does it, then maybe I will just to be the first Also, anyone else have an alternative method of implementing this effect? A naive approach would be to get the position of the listener and the position of the sound and precalc how long it would take the sound to reach the listener and then just tell the sound subsystem to start playing the sound in X seconds from now, but this wouldnt handle the case properly in situations where the listener suddenly starts moving towards the sound or perhaps even instantly changes location via a mechanishm such as teleporting or what not. I think my sphere case above would handle that. Well I called it a naive approach, it is actually probably a fairly good approach if you dont mind it not working in some cases. Alternatively, you could create a ton of sound particles and then make them radiate outward from the source and they could be put through collision detection so it would also support occlusion and perhaps even reverberation but I suspect that might suck up a lot more cpu than it is worth... Jeff

Share this post


Link to post
Share on other sites
Advertisement
I personally don''t know any game that does this. The reason for this is that perhaps most of the games don''t envolve great distances in their worlds. For example, in a fps, you see things "in your face" and most worlds don''t have more than a "square mile" in it.

Another reason might be the fact that certain effects, although fisically correct, might look strange to the person playing the game. For example, those movies where there are explosions in space and you can ear them. Although this is fisically incorrect, it seems much more natural to us then not earing a thing when the ship in front of us just explodes. Sometimes fiction feels more realistic than reality.

Share this post


Link to post
Share on other sites
operation flashpoint and ofp: resistance by codemasters do this but i dont know how they implement it. you can shoot something from say 800 meters and see the explosion and then a second passes and you hear the boom. i havent heard of any others.

Share this post


Link to post
Share on other sites
Battlefield 1942 seems to do this with artillery explosions, but I'm not sure how realistic the delay is.

Also, Mechwarrior II seemed to do this, but that's an old one.

Implementing it is easy. You just set up a timed sound play event with location parameters and play the sound when the timer elapses. It gets more complicated if NPC's can be alerted by sounds. Each of them would need a separate timer for realism.

EDIT: Expanding sound spheres would work too, but might be overkill calculation-wise, especially if noone in the area is travelling fast enough for it to make much of a difference.


[edited by - Waverider on March 24, 2004 9:10:15 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I''d have thought the simpler way would be just as good; after all the player will surely move a negligable distance in the time the sound takes to reach him - assuming he''s moving at a realistic speed

Share this post


Link to post
Share on other sites
Extreme-G 2+3 sorta did this. When you drove above the sound barrier, the music would fade out and get really quiet. Then when you drop back down it would come back with a KABOOM!

Share this post


Link to post
Share on other sites
This is how most (or every) 3D sound libraries work. If your using headfones, it calculates the distance of the sound to each ear and plays the sound at the correct time. If your in a 5.1 enviroment, it takes 5 calculations

Hope this helps,


JVFF

Share this post


Link to post
Share on other sites
Battlefield Vietnam : Dolper effects
Wolfenstein Ennemy Territory : sound distortion (not sure if it is delayed but it is realy nice)


--- At The Edge Of Time

Share this post


Link to post
Share on other sites
I think RTCW did this.
Sometimes if you were getting shot by a sniper from super far away, you would loose health and about 1 second later you would hear the gunshot.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!