Game maker - racing game programming help needed

edited in General
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.

Comments

  • I'm guessing you'd use a combination of different samples, and varying their tone(pitch?) and volume between the different gears to create a layered and rich engine sound... But I can't tell you how exactly programmatically :P

    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!
  • Yeah wanted to do it for Comp B: but didn't have time, the reduced game mechanic could be fun, specialy on a mobile device me thinks.
  • I'd google like a banshee to see if there were any articles out there by the people who do sound for Burnout, Need For Speed or Dirt. Those have always sounded near-perfect to me. Maybe you'll get lucky and there's something awesome hiding on Gamasutra somewhere?
  • I've had to do this for multiple projects. Doing it the proper way is a @#$#@ing ball ache of note. Or a fun challenge, depending how you look at it. ;)

    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.
  • Also, CSR Racing on iPad is a good, successful example of the genre ;)
  • It's also changing the volume along with the pitch, correct? The engine gets louder as well as higher pitched as the revs climb?
    Also, CSR Racing on iPad is a good, successful example of the genre ;)
    I'll go have a look, thanks.
  • if you were using separate loops, the higher loops would inherently be louder. But yes I guess with a single loop that would be a good approximation to add...
Sign In or Register to comment.