Has anyone got any tips for handling engine sounds for a car game? Im not sure how to have the car tick over when your not accelerating and then have a sound of accelerating and going though the gears also id like that sound as the coasts along after releasing the accelerator. I can do the skiding and braking sounds they are easy.
Car engine sounds
Miscellaneous Forums/General Discussion/Car engine sounds You need a long acceleration sound which goes from stopped to top speed, and when the player pushes the gas, you start playing this sound from the right point.
When they reach the max acceleration, you switch to a looped sound of max acceleration.
When they let off the gas, you have a second long sound of deceleration, from max speed to stopped, which you start playing at the right point.
And when the car has come to a stop, you play the idle sound.
It's pretty simple, cause the player is either accelerating at a constant speed, or decelerating at a constant speed. It would probably be more complicated to do on a console with analog control of the accelerator. In that case you might have to have a few different acceleration sounds for different speeds of acceleration and properly transition between them with pitch bending and fades or something, and use small segments for looping when the player holds the accelerator at a certain point.
Play some Half Life 2 and see how they did the car sounds in that game. Unless I'm mistaken they've done exactly as I describe above.
When they reach the max acceleration, you switch to a looped sound of max acceleration.
When they let off the gas, you have a second long sound of deceleration, from max speed to stopped, which you start playing at the right point.
And when the car has come to a stop, you play the idle sound.
It's pretty simple, cause the player is either accelerating at a constant speed, or decelerating at a constant speed. It would probably be more complicated to do on a console with analog control of the accelerator. In that case you might have to have a few different acceleration sounds for different speeds of acceleration and properly transition between them with pitch bending and fades or something, and use small segments for looping when the player holds the accelerator at a certain point.
Play some Half Life 2 and see how they did the car sounds in that game. Unless I'm mistaken they've done exactly as I describe above.
@Swift - Starting a sound at the right point is not possible in Blitz3d using it's native sound commands. I guess Fmod of suchlike would work.
This may help ..
http://www.blitzbasic.com/Community/posts.php?topic=54222#605167
This may help ..
http://www.blitzbasic.com/Community/posts.php?topic=54222#605167
What about altering the channel pitch gradually?
He didn't say he was using Blitz3D. What with all those 3D engines available for Max, it's possible he's using that, and I think you can do what I said with Max's sound system, as I seem to remember some more advanced commands for altering sound buffers and such.
thanks sswift i am using blitz3d but am moving over to max and minib3d, I will look into your way of doing it, ive only done very basic sound in projects before and this one has me thinking. thanks Stevie G for the link ill take a look. I got a long sample of a car starting and then reving and the accerating slowing and stopping. its a royality free sample so im going to try and cut it up and make some loops etc with. ill come back with some code if i get stuck.
thanks again Pete
thanks again Pete
For SRX I used a simple system of 2 sounds - they're both a looping engine sample at high revs, but one is more aggressive (the ON throttle sound) and the other is muted and quieter (the OFF throttle sound).
I simply play them both together, then as the player varies the throttle I adjust the volumes in realtime - at 100% throttle the ON sample is at 100% volume, at 50% throttle both ON and OFF are at about 75% volume, and at 0% throttle ON is at 0% and OFF is at 100% volume.
To get the pitch right I simply calculate which gear the car is in, dep. upon speed, then work out the required pitch for that gear & speed and adjust both samples to match. The sample is the engine at high revs, so most of the time it is being played slower than normal speed.
I've added a few other tweaks - as the car goes up the gears the baseline for the pitch rises, meaning each higher gear has a slightly higher pitch than the last, and first gear plays at a slightly different rate again, merely to get it to sound right.
I measure the sideslip of the car (relative movement in the X axis of the vehicle, which is used for the volume of the tyre scrub SFX also) and increase the engine pitch according to this sideslip, so as the player powerslides the car the engine revs appear to increase slightly as the car gets more sideways - this is done only because it sounds right when playing, not because it's physically accurate.
I also drop both ON and OFF volumes to 50% for a few frames when the speed reaches a gear change point, to simulate the driver lifting off the power for a brief moment.
Finally I build up a turbo over-run counter whenever the player has 100% throttle - when the player releases the throttle I check this over-run and if it has built up beyond a threshold point I play a random exhaust pop / bang sample (at random volume, so sometimes you get no pop) - this simulates the build up and release of turbo boost pressure, but the threshold ensures it doesn't happen every time the player comes off the throttle, just after a sustained period of acceleration.
Hope this helps.
I simply play them both together, then as the player varies the throttle I adjust the volumes in realtime - at 100% throttle the ON sample is at 100% volume, at 50% throttle both ON and OFF are at about 75% volume, and at 0% throttle ON is at 0% and OFF is at 100% volume.
To get the pitch right I simply calculate which gear the car is in, dep. upon speed, then work out the required pitch for that gear & speed and adjust both samples to match. The sample is the engine at high revs, so most of the time it is being played slower than normal speed.
I've added a few other tweaks - as the car goes up the gears the baseline for the pitch rises, meaning each higher gear has a slightly higher pitch than the last, and first gear plays at a slightly different rate again, merely to get it to sound right.
I measure the sideslip of the car (relative movement in the X axis of the vehicle, which is used for the volume of the tyre scrub SFX also) and increase the engine pitch according to this sideslip, so as the player powerslides the car the engine revs appear to increase slightly as the car gets more sideways - this is done only because it sounds right when playing, not because it's physically accurate.
I also drop both ON and OFF volumes to 50% for a few frames when the speed reaches a gear change point, to simulate the driver lifting off the power for a brief moment.
Finally I build up a turbo over-run counter whenever the player has 100% throttle - when the player releases the throttle I check this over-run and if it has built up beyond a threshold point I play a random exhaust pop / bang sample (at random volume, so sometimes you get no pop) - this simulates the build up and release of turbo boost pressure, but the threshold ensures it doesn't happen every time the player comes off the throttle, just after a sustained period of acceleration.
Hope this helps.
Vorderman: thanks that gives me load to work with. im just cutting up my original samples to make the loops at the moment, but when ive done that i try you system. as im using ODE i could get each wheel rotional speed and the speed of the care and work out when the cars wheels are slipping for skid sounds im already using this idea to trigger particles of smoke from the tyres.
ill let you know how i get on
ill let you know how i get on