How should sound samples be made when bullets fly past a player’s ear? Should it be made into short samples or samples with the same lifespan as bullets.
Problem 1: It is obviously not acceptable for a short sample to end the sound before it reaches the player’s ear.
Question 2: If the sound sample is made to have the lifespan of a bullet flight, it cannot be produced without it, and the effect is also very poor.
Summary: Does bullet skill require new programming features to support it, or are there other feasible methods?
I’m sure there are many ways to achieve this.
A method I used in our game, for arrows, is by using a sustain point (during the flight of the arrow) and an async instrument crossing the sustain point for the fly-by sound. When the arrow hits, the sustain point is released and the fly-by sound (if still playing) is cut (with a fade) and the hit sound is triggered.
Hello, thank you very much for your reply. Perhaps my expression was not very clear, let me rephrase it.
I hope there is a sound of bullets flying by my ear, but I don’t know how to control it. It’s not the sound of hitting someone, but the sound of someone flying past their ear. Because the character can move, not in a fixed position, and the duration of the bullet flying over and passing by the ear is also not fixed, how to determine whether it has passed by the character’s ear and triggered the sound effect of the bullet’s flight when making sustain points?
Determining if the bullet has passed by isn’t a question for FMOD, but for your dev. Determine that in the game code and trigger the right sound at the right moment.
You could, however, use the built-in distance parameter to trigger something based on the distance between the bullet and the listener, if that’s what you want.
Another approach would be that the bullet has its own sound (either looping or long enough) during the entire time of its flight. This corresponds to the 2d option of your first post. The effect won’t be “very poor” if the spatializer is correctly set (right min-max distance, doppler effect…).
Thank you again for your reply. I have tried making bullet samples into a loop effect, but in actual games, this effect is not ideal. Then, the sound samples were made to be as long as the bullet’s flight time. Such sound samples could not be made at all, and the effect was very poor after being made reluctantly. I don’t know what other methods can be used to make them. If it is determined that a bullet is approaching a character, the character has a function to accept the judgment and trigger the sound of the bullet flying quickly through it. Can this also be done and will it consume more performance?
As a basic implementation exemple, here’s a simple white noise, filtered with an EQ automated by the distance.
It could be done, so why don’t you just try and see if it works for you?
Thank you very much for your technical sharing. I know how to implement it now and I am glad to receive your reply. (Smiling face)
Based on the ideas you provided, I have added samples that I believe are more infectious to the monitoring location to achieve the desired sound effect. Thank you very much, and I hope to discuss and learn from you in the future when encountering new problems.
Thank you both for sharing the solutions here!
Seems nice!
Beware with your loop, which doesn’t have a transition timeline, and doesn’t have some room at the end to feed that transition…
Be careful with the doppler effect, which may or may not be suitable here. It’s impossible to test it in FMOD Studio, you’ll have to try directly in the game engine.
Thank you for the reminder. Following this topic, I would like to ask you another question. How can we release the key off sustain button in the game? I can’t find any way to trigger it.
You could consider using EventInstance::keyOff() to release the key off sustain button in the game.
Hope this helps, let me know if you have any questions.
Okay, thank you for your reply.