Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Environmental sound delay mod  (Read 1509 times)

0 Members and 1 Guest are viewing this topic.

GroteVogel35

  • member
  • Offline Offline
  • Posts: 32
Environmental sound delay mod
« on: September 27, 2015, 05:04:52 PM »

Sorry to mention, but I noticed a H.U.G.E. physical flaw in IL-2 Sturmovik.. Sounds occuring far away are heard instant, while in reality sound takes some time to reach you..

Is it possible to make a mod that simulates this?


Edit:

As a rough sketch, I would see something like this:

instead of 'trigger --> play sound' it could be: 'trigger --> calculate delay --> delay --> play sound'

The trigger can be an explosion, for example.

Logged

Koty

  • Mr. MiG
  • Modder
  • member
  • Offline Offline
  • Posts: 2274
  • It's a MiG!
Re: Environmental sound delay mod
« Reply #1 on: September 28, 2015, 02:46:03 AM »

With sounds such as explosions it can be done - problem will be with sounds like engine sound, where you need to change it with delay and such + aply doppler effect at the same time. Not to mention that doppler effect does not work correctly in IL, it works only up to 1000 km/h, therefore you can't model supersonic effect (yet).

Personally, I think this is an interesting idea, would really push us forward.
Logged
If I don't have to do it, I won't. If I have to do it, I'll make it quick.

GroteVogel35

  • member
  • Offline Offline
  • Posts: 32
Re: Environmental sound delay mod
« Reply #2 on: September 28, 2015, 07:47:12 AM »

Together with the doppler effect it could be packed as the 'Environmental sound mod', a must have.. Seriously, since I realise it, I can't play the game normal any more without noticing this quite big mistake xD
Logged

benitomuso

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2587
  • P.A.L.
Re: Environmental sound delay mod
« Reply #3 on: September 28, 2015, 04:15:46 PM »

Together with the doppler effect it could be packed as the 'Environmental sound mod', a must have.. Seriously, since I realise it, I can't play the game normal any more without noticing this quite big mistake xD

There are lots of things practically non-modelled in Il-2, don't be so neurotic about the sound delay. Things fall without friction. The effect of the wind itself was for a long time not considered, and later introduced just as a speed modifier. FMs are unable to reproduce floating things behavior as dirigibles or helicopters not to mention high speed jets...

But even though it is far better than many other flight sims, much more responsive, has thousands of planes, you can shoot at them... not bad at all.

As everything, what you mention, the sound delays for space travel should be implemented into the engine itself: the part of the game we don't have access to. It is quite difficult to do something general about sound in Java.

Regards,
                    Pablo
Logged

GroteVogel35

  • member
  • Offline Offline
  • Posts: 32
Re: Environmental sound delay mod
« Reply #4 on: September 28, 2015, 05:05:23 PM »

Quote
..As everything, what you mention, the sound delays for space travel should be implemented into the engine itself:..

Well, if we just talk about basic distance. In real life at only 1000m distance you'll have to wait ~3 seconds before you hear anything.. 1000m in an aircraft is not much, so the sound delay (or lack of it) is very noticeable.

You would have to implement some code that creates a delay, the delay calculation itself is reasonable to do so.

But I don't know if you can program that in the game... As I understand it is thus very difficult.
Logged

Koty

  • Mr. MiG
  • Modder
  • member
  • Offline Offline
  • Posts: 2274
  • It's a MiG!
Re: Environmental sound delay mod
« Reply #5 on: September 28, 2015, 10:51:27 PM »

Not only difficult, at this point it is impossible as Benito said. The only way might be by asking DT, as they have access to the core of the game (most likely) - but they don't have the right to let that code out even if they had it.
Logged
If I don't have to do it, I won't. If I have to do it, I'll make it quick.

Stainless

  • Modder
  • member
  • Offline Offline
  • Posts: 1537
Re: Environmental sound delay mod
« Reply #6 on: September 29, 2015, 02:56:03 AM »

The problem is far more complex than you think.

The distance from the sound effect needs to be calculated real time. A bomb 2 klicks in front of you detonates. If you were stationary, the sound would take approximately 6 seconds to reach you.

However you are very unlikely to be stationary. A fast jet moving towards the location could be moving at 300 mS. So you and the sound collide after roughly 3 seconds.

You could write a java class to handle this. Instead of sending the sound event to the c++ code, you could add it to a manager which only plays the sound effect when it calculates you should, but I don't think it would work very well.

It might be possible to use an external application to handle 3D audio, but you would have to communicate with it by TCP/IP.

If I had to, I would design something like this.

Code: [Select]
Load and start external application.       
{
         Creates a server on a uncommon port.     
}
Load and start game.
{
         Creates a client and connects to server.
}

Start mission
{
        Send a list of sound effects required to server, which then loads them into memory.
        Register plane as listener
}
Weapon detonates
{                         
        Send a packet with the effect id and location to server.
}
Every frame
{
        Send a packet with the listener location to the server. Server renders the audio.
}

Not easy, resource hungry, and relies on loopback TCP/IP


Logged

GroteVogel35

  • member
  • Offline Offline
  • Posts: 32
Re: Environmental sound delay mod
« Reply #7 on: September 29, 2015, 12:29:38 PM »

I think at least the calculation can be done and is simple.

Let's take as example that you drop a bomb.

From the detonation onwards, a basic timer starts to run. Next, the software needs to calculate several times a second the time it takes for the sound to reach you. If the two (the static timer and the calculated time) meet, the sound wave has reached you and the sound file is played.

Perhaps you can also use the general (pc) time as the static timer and pop in marked points at moments of sound occuring.

Would it not be possible to do this calculation client-side instead of server-side?

Offline would anyhow be nice, online is an extra in my opinion.
Logged
Pages: [1]   Go Up
 

Page created in 0.182 seconds with 29 queries.