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 10 years ago
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 10 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.
[quote="solecist":1jyd2e7f]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.[/quote:1jyd2e7f]
You only have one parameter in that event. As I said at the start of my post:
I suggest creating another parameter ("sound_delay" or similar) to control which sound is played and setting the velocity on that parameter.
The rest of my post won’t help if you don’t follow that step.
I have created a project which should do what you want, set up in a similar way to your screenshot. The project has two parameters, "delay" (which should be set to the event’s distance from the listener before starting the event) and "(distance)" (an automatic distance parameter which controls the crossfade between the two layers).
Here is a screenshot of the event with the "delay" parameter selected:
And here is a screenshot of the event with the "(distance)" parameter selected:
The project is available at http://18.104.22.168/files/distance_delay.fdp
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.
Upon re-reading your original post, it sounds like you may not fully understand what the parameter velocity does. Parameter velocity moves the parameter (i.e. changes its value) automatically every frame based on the velocity. For example, if the velocity is 3.00 units/second, and the parameter is set to 0 when the event starts, the parameter will have a value of 3.00 after one second, 6.00 after two seconds, 9.00 after three seconds, and so on until it reaches the maximum value.
Please let me know if you have any more questions.
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="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
Please login first to submit.