so let’s say i’ve got my gunshot/explosion/whatever set to a maximum audible distance of 1200 meters. the problem is, when that sound plays from about 800 meters away, it plays instantly. is there anyway to simulate the speed of sound (~340m/s) using an effect or otherwise?
velocity or seek speed seemed like my best bet in parameter properties, but produced strange and unexpected results. for instance, velocity set to 340 units/s would play all the layers at strange intervals. like if the sound went off at 50 meters, it would play the first layer (set to go quiet at 100 meters), then shortly after would play the next layer, then the last layer, as if playing through the distance parameter like a timeline.
so my best bet is probably an effect, right? a time delay maybe? or is there an easier way that i am missing?
thanks in advance.
- solecist asked 9 years ago
[quote="solecist":2nugamg8]velocity or seek speed seemed like my best bet in parameter properties, but produced strange and unexpected results. for instance, velocity set to 340 units/s would play all the layers at strange intervals. like if the sound went off at 50 meters, it would play the first layer (set to go quiet at 100 meters), then shortly after would play the next layer, then the last layer, as if playing through the distance parameter like a timeline.[/quote:2nugamg8]
It sounds like you set a velocity on the distance parameter, which would naturally produce the results you are describing. I suggest creating another parameter ("sound_delay" or similar) to control which sound is played and setting the velocity on that parameter. You will need to edit the layer properties and change the control parameter to "sound_delay".
For example, in the situation you describe above, you could set the "sound_delay" parameter to have a minimum of -100 (this will become clear in a moment), a maximum of 1200, and a velocity of -340 units/s. You can then put your gunshot sound in the region between -100 and 0. Before you start the event, you can set the "sound_delay" parameter to the gunshot distance (800 in your example), and it will automatically decrease at the correct rate, playing the gunshot sound when it reaches 0. This should give the correct delay.
You could even place a "bullet hit" sound in the remainder of the "sound_delay" parameter’s range so it starts immediately, simulating the bullet travelling much faster than the speed of sound. You may need to place it on a separate layer so it is not affected by your falloff effects.
Hope this helps,
well first let me say thank you so much for going through all that trouble. much appreciated.
second, i did understand what you meant about multiple parameters, my concern was that because you had to shorten the sounds to fit in the delay parameter that they would be equally short in the distance parameter. as can be seen in the screenshots, the sounds only fill 100 meters of the distance parameter, and i was just worried that this would stop the sounds from playing beyond 100 meters. i guess that is not the case, though. thank you
[quote="solecist":rd6lpg1r]now it’s working! thanks.
first issue seems to be that time offset is not a time delay, but an actual offset in the timeline of the sound. so if the time offset is 1 second, it skips the first second of the sound and plays the remainder immediately (no delay – regardless of distance). is this right or i am i just missing something?[/quote:rd6lpg1r]
The time offset is variable, the amount of silence played at the start of sound is set by the distance parameter. If you always want delay you could simply adjust the time offset envelope accordingly/
When the listener and sound emiter are close, the time offset = 1, meaning the the silent section of the file is skipped, playback of the actual important part of the audio file is played immediately.
When the listener and sound emiter are far apart, the time offset = 0, meaning no section of the file is skipped, both the silence and meaningful part of the sound occurs.
To answer your question:
Playback isn’t delayed, however there is a variable amount of silence added to the front of the actual sound.
As I stated in a previous post, this technique is a little hacky – but it does simulate the delay effect of distance.
from my viewpoint i can’t see how that would be possible. i follow you up until i have to actually place the sound in the -100 to 0 area of my timeline. wouldn’t that mess up my distance parameter? here is a screenshot of one of the sound’s setup:
sorry if i’m totally ignorant. i just started using this a couple of days ago.
one little bit of confusion after attempting to use this method…setting the delay parameter.
[quote:1wu1cpge]To use this event, you would set the "delay" parameter to the appropriate distance (e.g. 500 if the event is 500 meters away) before starting the event. This won’t work in Designer, as the parameter will be reset to -100 when the event is started, but you can see the effect by starting the event and then setting the "delay" parameter to the appropriate distance. The sounds won’t start until the "delay" parameter reaches 0. [/quote:1wu1cpge]
this seems to imply that i have to set the distance manually, whereas i am looking for a dynamic speed simulation based on whatever distance my avatar happens to be from the sound. am i right to assume this or have i just misunderstood?
why don’t you just use the distance parameter to control the delay of when the sound is played? You already have the distance parameter setup. Just add Fmod Echo to both layers with the following settings:
delay – starting at 0.0sec for 0 distance, then line to 3.53sec for distance 1200.
decay – 0
max channels – 0
dry mix – 0
wet mix – 100
This will give you the realistic delay over distance like you are looking for. You might want to also use the low pass filter also controlled by distance to simulate the effects air has on sounds at a distance. Good luck. Hopefully this helps.
[quote="solecist":2nrdkklk]this seems to imply that i have to set the distance manually, whereas i am looking for a dynamic speed simulation based on whatever distance my avatar happens to be from the sound. am i right to assume this or have i just misunderstood?[/quote:2nrdkklk]
Yes, that is correct. In your game engine, you would need to set the "delay" parameter manually just before starting the event.
No, problem. The only down fall for this is the amount of memory it could comsume. Try it out and be careful to either use it sparingly on only the sounds it is necessary for or find a better way to do it using programming. Using the programming in your game you can just delay the message being sent rather than delaying a sampled sound. The sample goes into a buffer which takes up lots of memory if used simultaneously by lots of events.
we did this using the delay effect at first but like mentioned elsewhere canned that because the memory footprint for those and echo was just too big on ps3.
in the end, we just triggered the sound from the engine at the appropriate time. it was easy because we also included a small camera shake and had a shockwave vfx that also needed to reach the player at the correct time.. so we already knew in the engine when the sound was supposed to hit the player and just triggered the event then, with no fancy parameter or layer tricks needed.
this is probably not as useful a solution for your case however. we only did this for explosions, not weapons or other fast firing stuff because it just became kind of confusing, it felt like the sound was out of sync rather than seeming more realistic. (and the explosions had 2 components, one crack that triggers on the explosion, and then one which is the shockwave/thump that was heard at speed-of-sound distance.)
- acrosby answered 9 years ago
I have had a quick thought about adding a variable delay. This is a little bit ‘hacky’ until a start delay is added to designer.
Has anyone tried adding silence to the front of the sample, then using the ‘time offset’ effect with the distance parameter?
Add one second of silence to the front of the gunshot sample. When using compressed formats, this will not take up much space.
Place the sample on a layer of an event.
- Add a distance parameter (min = 0, max= 1100 feet)
- Add the ‘time offset’ effect.
Set the effect envelope so that:
at parameter 0 the time offset = 1 sec.
at parameter 1100 the time offset = 0 sec.
This means at a small distance, the delay is small and at a large distance the delay is large.
- You can then use the occlusion effect to manipulate the direct and reverb effects to make the gunshot sound more distant.
All this would be controlled by a single distance parameter.
If anyone is interested I can put a project up on the website.
hmm, well i’m almost certain i have it set up properly otherwise. it almost feels like they’re overlapping eachother or something, because if it is quiet for a moment the first next two or three sounds come in loud and clear, but the rest following are silent. this is in a scene with hundreds of these sounds playing at once, by the way. i didn’t notice much of a drop in framerate, though.
i also tried testing the sounds one at a time, and i’d say it has a 60% success rate…the other 40% of the time it is cutting the sound off early.
[quote="solecist":1jrvlkjm]i am definitely interested! thanks for reviving this…i thought it was long-gone[/quote:1jrvlkjm]
I’ve put an example here:
The example demonstrates how to create a variable pre-delay and simulate distance with a single parameter.
Please login first to submit.