Explosion delay

Make suggestions for improving one of the best games on the net!
Post Reply
asciimonster
Private First Class
Private First Class
Posts: 55
Joined: Wed Sep 13, 2006 9:52 am

Explosion delay

Post by asciimonster »

When an explosion happens far away, in bzflag, the boom is a little less loud when it happens right besides you. As far as I can tell you can hear explosions that happen far away at the same time as you can see them boom. Yes, this is how Hollywood usually does it, but Hollywood movies usually get it wrong when it comes to physics.

Sound only travels some 1000000x slower than light. That means that there should be a slight delay between seeing and hearing a far-away explosion. This is especially poignant when you make a CTF. Now you hear one bang, but there should be several of them at various intervals, unless the opponents were grouped together.

But as many of you have already pointed out, there is little realism in this game already. Still, I wonder which you prefer here: reality or the stuff writers with no science education forgot to think about?
User avatar
Red Cobra
Private First Class
Private First Class
Posts: 184
Joined: Mon Feb 21, 2005 11:37 pm

Post by Red Cobra »

Good point. The only problem with that would be that it might use up some bandwith. Plus it kinda effects gameplay. (And when I say kinda, I meen kinda) When you shoot someone off of a rico, and you can't see them, you want to know if you killed them or not. Now you could always look at your map, but sometimes you don't want to take your eyes off the game. It's kinda like a 6th sense you get when you play BZFlag a lot. (You don't always look at your map to see if you killed them.) Good idea though.



RC
Cop@R3lax
Trusted@Viper
User avatar
BinarySpike
Corporal
Corporal
Posts: 735
Joined: Mon Mar 28, 2005 11:58 pm
Contact:

Post by BinarySpike »

Asciimonster wrote:When an explosion happens far away, in bzflag, the boom is a little less loud when it happens right besides you. As far as I can tell you can hear explosions that happen far away at the same time as you can see them boom.
Doesn't BZFlag use OpenAL? I always thought that the sound was correct.
Note a good example of what you are explaining is a lightning bolt way off in the distance, we see the light and then hear the boom.

Also the boom was always delayed in bzflag. I can like 70% of the time tell from a drop sound if someone is behind me or in front of me. I learned that from lasermania ;)
Red Cobra wrote:Good point. The only problem with that would be that it might use up some bandwith.
No just have the client add delay till it's supposted to start. Modding flag spawning code so that timed flag reset bots aren't needed would reduce lag massively on servers that used it (like boxy war)
asciimonster wrote:Sound only travels some 1000000x slower than light.
No...
Speed of light is 186,282.397 mph
Speed of sound is 769.5 mph
That means sound is roughly 242.08x slower
(using all significant values of course)

But those are the speeds in a vacuum, if we were driving around inside a diamond it would be different :book:
Red Cobra wrote:Plus it kinda effects gameplay. (And when I say kinda, I meen kinda)
I think the effect to gameplay would be better.


Asciimonster: It's a great idea if it isn't already implemented.
Because I could swear it already is... I still can't decide if BZFlag uses OpenAL though :lol:
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

bzflag does not use open AL for sound, It uses ether the OS sound system, or SDL in 2d mode, and does it's own sound mixing.

BZflag does do speed of sound and doppler shifting of positional sounds as it mixes, using the source of the sound in the computation.

The speed of sound in BZflag is 343.0 units/second ( sound can not travel in a vacuum, BinarySpike, the speed you are using is for sea level atmospheric pressure, if you are going to pick nits.)

In short, there is a speed of sound delay in the code now, and has been for a very long time ( before it went open source even ), for positional event sounds ( shots, explosions, jumps, etc.. ). Other sounds, like chat beeps, or other warnings, are assumed to come from the player's tank, and are not delayed at all, nor are they mixed in positionally.
ImageJeffM
User avatar
CannonBallGuy
Private First Class
Private First Class
Posts: 2083
Joined: Wed Apr 12, 2006 1:31 am
Contact:

Post by CannonBallGuy »

BinarySpike wrote:No...
Speed of light is 186,282.397 mph
Speed of sound is 769.5 mph
That means sound is roughly 242.08x slower
(using all significant values of course)
If we stick with metres per second we have:
Approx 3*10^8 m/s for light.
With around 3.4*10^2 m/s for sound.
The ratio is clearly in the magnitude of around 10^6 - equivalent to asciimonster's original number.

The actual figures are:
Light: 299,792,458 m/s
Sound: 340.29 m/s
Light/Sound = 880,991.09 or 8.8*10^5 - not a lot less than my 10^6 approximation above but significantly more than your "242.08" figure.
Image

Merry Christmas!

"Look, if I don't buy booze for the kids, I don't get any incriminating pictures to show to their parents, my business goes down the sink, my girlfriend leaves me and the baby goes on ebay. So help me search..."

"go Play With Toys urself in a dark alley u donkey ******" - Lt-Kirby2007
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme »

BinarySpike wrote:No...
Speed of light is 186,282.397 mph
Speed of sound is 769.5 mph
That means sound is roughly 242.08x slower
(using all significant values of course)
I believe that your MPH figure for light should be Miles Per Second, and therefore the correct MPH figure is 670,616,629.2 MPH. Comparison must be between like terms. ;-)
asciimonster
Private First Class
Private First Class
Posts: 55
Joined: Wed Sep 13, 2006 9:52 am

Post by asciimonster »

JeffM2501 wrote:BZflag does do speed of sound and Doppler shifting of positional sounds as it mixes, using the source of the sound in the computation.
So that's the reason that the SW sound sounds goes one octave up when I'm killed. Since my speed is no longer defined, it goes to a preset setting.
BinarySpike wrote:Also the boom was always delayed in bzflag. I can like 70% of the time tell from a drop sound if someone is behind me or in front of me. I learned that from lasermania
The sound is always delayed with me too, but that's because my system isn't that fast.
User avatar
the_j0k3r
Private First Class
Private First Class
Posts: 91
Joined: Fri Aug 18, 2006 9:56 am
Location: australia

Post by the_j0k3r »

asciimonster wrote:
JeffM2501 wrote:BZflag does do speed of sound and Doppler shifting of positional sounds as it mixes, using the source of the sound in the computation.
So that's the reason that the SW sound sounds goes one octave up when I'm killed. Since my speed is no longer defined, it goes to a preset setting.
ive always wondered about that! interesting answer

could it have something to do with the fact that when i hear 2 shots shot really close together (as in a 2 shot burst) the sounds goes up and octave as well? (obviously i dont think its the same reason as the sw, but the general discussion...)
Image
User avatar
BinarySpike
Corporal
Corporal
Posts: 735
Joined: Mon Mar 28, 2005 11:58 pm
Contact:

Post by BinarySpike »

Constitution wrote:I believe that your MPH figure for light should be Miles Per Second, and therefore the correct MPH figure is 670,616,629.2 MPH. Comparison must be between like terms. ;-)
ack! the page I got it off of said 186,282.397 Miles per hour, not Miles per second >.< That's why I posted that, cause the number was smaller than I thought.

JeffM2501 wrote:bzflag does not use open AL for sound, It uses ether the OS sound system, or SDL in 2d mode, and does it's own sound mixing.

BZflag does do speed of sound and doppler shifting of positional sounds as it mixes, using the source of the sound in the computation.
Ok
User avatar
Saber
Private First Class
Private First Class
Posts: 207
Joined: Tue Nov 01, 2005 9:27 pm
Location: ¨¨¨¨¨

Post by Saber »

The SW thing is mixing me up. :? :?
First of all, you must know the sound is a wave. When the SW is coming in your direction, the wave will be "squished" and when you are in the SW, the wave is going away so it's "stretched". A longer wave should be an octave lower and not an octave higher. You will hear the same effect from a car's engine if it's coming in your direction or if it's going away. So why is the SW like it currently is? Is it wrong or am I wrong?
Post Reply