Game maker - racing game programming help needed
Hi guys,
I have been thinking about this in the back of my head for a couple of weeks now, and i cannot figure out what would be the best way of handling this game mechanic.
I want to make a 1/4mile drag racing game. You would be timing your gear changes and such with various different cars. Basically you wont have any control other than throttle brake and gears.
Now the question:
I will have a rev counter with the optimal gear change spot. I have a general idea how to control the revolutions, and "convert" that to the cars speed and such. How do I make the engine sound change realistically with the cars revs? You know i want to make a really good sounding game, as the game play is centred around proper gear changes, the sound is real importand.
Any suggestions how to go about this? I would like to use real sound samples from various engines if that helps.
I have been thinking about this in the back of my head for a couple of weeks now, and i cannot figure out what would be the best way of handling this game mechanic.
I want to make a 1/4mile drag racing game. You would be timing your gear changes and such with various different cars. Basically you wont have any control other than throttle brake and gears.
Now the question:
I will have a rev counter with the optimal gear change spot. I have a general idea how to control the revolutions, and "convert" that to the cars speed and such. How do I make the engine sound change realistically with the cars revs? You know i want to make a really good sounding game, as the game play is centred around proper gear changes, the sound is real importand.
Any suggestions how to go about this? I would like to use real sound samples from various engines if that helps.
Comments
Maybe do something about the hand gripping the steering wheel keeping the car in line too (not steering but some kind of variable on straightness) :p
Good luck, it sounds like fun!
1. Simplest is take a single engine loop and pitch shift it according to the revs on the engine (you should already have a decent measure of your revs if you're modelling the engine). There are quite a few places on the internet that you can find a fairly okay engine loop (google). This method works well enough as an approximation method, but pitch shifting a single loop so much shows up artifacts badly. Starts to sound tinny and not great like an engine should. (Not sure what Sound API's game maker gives you, but pitch shifting should be there if it has anything)
2. The next step up is actually crossfade multiple loops depending where you are in the rev range. So the idea is you take a loop from say a 1000 revs, 2000, 4000, 6000 etc. This means you're pitch-shifting each loop a lot less, and therefore you notice less artifacts. The challenge now is to find multiple loop samples, that all have to be at steady pitch. Really hard to find on google, but it might be there. When I did this we actually went out and recorded a car in neutral and had a driver hold the engine at different rev bands. The problem with this method is that you're not actually getting the engine under load, so again not perfect.
3. Next step up is to actually record the real car around a real race track. Second time I did this we bought samples from a company overseas that does this professionally. A samples of a single car will set you back a couple of thousand. (You get what you pay for). They will mic up a car with about 10 microphones and record it going around a track. They then mix this down and have to create loops by taking bits of engine runs and pitch enveloping them until the loop has a steady pitch. (anyone who has done audio recording will appreciate that is an absolute pain). In the end you will also have an set of "On load" samples and "Off load" samples which you cross-fade depending on whether the engine is doing any work or not. Welcome to engine sound in a modern racing game :)
4. Though this we're already further than i'm sure you'll ever go, this method is still actually not that perfect in terms of simulation. Next step up, probably be seen in some current and next gen racing games: People have developed propriety tech (read: crazy expensive) that allows you to take and engine run recording and dynamically re-pitch it however you want, using voodoo magic (granular synthesis). Saves you have to do all the pitch flattening to get steady loops.
My advice, try find a good sample and stick to step one. When we did step 3 we actually had to abandon it because multiple samples were crashing the game, and you'd be surprised how forgiving people are once they actually get into playing the game. And if you game becomes anything special you can always upgrade at a later point in time.