we have some issues in implementing an engine sound in a motorbike game (we are using Fmod Studio 1.0.3 - 42909)
We built the engine using a standard approach: the engine of the motorbike is an event made by 4 cross-faded samples; cross-fades are clearly depending on the rpm value passed by the physics engine of the game. No load parameter has been applied for the moment. The engine is pitched not with the “autopitch” function, but with a pitch modulation based also on the rpm. The sound is 3D, but no reverb or lowpass filtering is applied.
The engine of our bike is correctly played when a limited number of instances is played: for example, we noticed no problem with 1 - 10 motorbikes running, while when activating 15 instances of the engine sound disappears several times, in particular in the rpm ranges corresponding to the crossfades between samples. It seems like the current-playing samples decreases correctly in volume accordingly to the cross-fade, but actually the next-to-trigger sample is not triggered, thus resulting in a fade to silence of the current-playing sample, and not in a cross-fade.
To be honest, we also have some minor clicks also with a few instances, but maybe this is related to the absence of any modulation (like an ADSR with a non-zero attack\release time) for each sample of the event.
We already checked the following:
Every sample is looping and it’s never silent;
Every motorbike has its own event instance, so we’re not sharing a single event between the motorbikes;
The rpm parameter is correctly updated, and the parameter range is coherent both in the game and in Fmod;
We tried to solve the problem deactivating the “steal voice” option in the event macro menu and by raising the number of voices to infinite and the priority of the event to highest, but with no result.
We also tried a more complex engine event with load, reverb and lowpass, and we found the same cross-fade issue.
Moreover, we also noticed a strange behaviour in the distance attenuation curve. By selecting the first curve on the second row (the one above the “off” label), given a certain listener point in the space, increasing the maximum distance results in attenuating the volume at that point, while decreasing the maxDist results in increasing it. The other three attenuation curves work the opposite way, correctly in our opinion (maybe it’s a desired behavior but we couldn’t find it in the manual).
Do you have any suggestion about how to fix the engine?
Thank you in advance for your time and attention, best regards
First off, I recommend that you update to the latest version - there have been many fixes since 1.0.3, including several fixes for cross-faded samples.
This sounds like you may be running out of real channels. Each sample that is played requires a real channel, and if there are no real channels available the sample will go virtual and be silent. You can set the number of real channels using the low level System::setSoftwareChannels function as follows:
Hi Ben,
we tried to increase the real channels to 256 using the 1.0.3 but nothing changed… after that, we tried with the latest version 1.01.03 (we have rebuild the same fmod project) and the problem is still present.
Moreover, we noticed that there are performance problems with the latest version. I profiled the FMOD::Studio::System::update (1 per frame) and the FMOD::Studio::ParameterInstance::setValue (called every frame on about 20 instances). With the old version we have, respectively, 0.5 ms and 0.8 ms, but with the new version we have 1-3 sec. After that I used an external profiler and it is returning FMOD::ChannelControl::get3DConeSettings as the most time consuming method (9.27 sec on 9.81 total profiling session).
note: we are using fmodL/fmodstudioL
Thanks again.
Thanks,
I thought could be a logging problem but I haven’t seen the fmod.log file. It is continuously writing SpeakerLevelsPool::alloc and SpeakerLevelsPool::free. Why?
The cross fade problem is still present.
Bye, Salvo
For anyone watching this thread, the fade point limit issue should be fixed in the next release. We’re still investigating the crossfade dropout issue.