I got bored... so I made a game

So I had some free time so I started playing around with this game engine I found called Unity3D. Long story short I started coding some car physics and then decided to make a “game” that used them… So here’s an afternoon’s worth of work.

I set it up with RS4 gear ratios, weight etc and it seems to be simulating somewhat right. I havn’t factored in a proper drag coefficient yet so that’s probably fudging things up a bit too. Tires are also probably too grippy. I’m still mucking with the Pacejka magic formula.

Standard controls. Up/Down for gas brake, space for handbrake, a/z for gears.

Disclaimers:

  • The car tends to float forward at 0.01kph when stopped even if the brake is held so keep that in mind when staging.
    - There are no tree lights so just go once you stage… the timers will start again automatically each time you leave the staging beam.
  • Holding the handbrake and tapping the gas helps with staging.
  • There’s no clutch control yet, but the physics is set to “slip” the clutch at ~3800 RPM when in first gear.
  • No ABS
  • The power curve is extrapolated across three points for now. So torque will probably seem like it’s lacking lower down.

Have fun, ignore the sound and my volvo looking passoff for an RS4 :wink:

You’ll need Unity Web Player (Sorry): http://unity3d.com/webplayer/

Game Link

Results (csv file for now… I’ll make it look nicer or have an option to view it in game later on)

The neat thing about Unity is that it can do multiplatform deploys across PC, iPhone, Android and Web.

Who knows… maybe once I get the physics right I can polish it up, add some proper looking cars and maybe have some form of network play as well.

Change Log

v0.3.1 - 2012-10-05
Sound

v0.3.0 - 2012-10-04
Ability to upload results

v0.2.0 - 2012-10-04
Added Christmas Tree

Want to program a really really basic app for me? Like all text based basic.

Let me know.

That’s cool! I’ll have to give this a try later.

Pretty cool man!!

12.76 @ 107.24
1.91 60’

I’m after Saki’s record…haha

edit…shallow stage and short shift 1st

12.67 @ 107.55
1.84 60’
330’ 5.26
1/8 8.08
1000’ 10.55

can I get added to the 1/4 mile data base? ;D

Seriously though, I’m addicted to racing this black box…now can I get a 2.75" fullback and a JHM tune?

FUCK…I have been bumped to second place.
:slight_smile:

12.65@107.65

Bring it on bitches .

Haha glad you guys like it. I really want to get the engine model complete so it’ll simulate proper power curves.

Right now I have it as a slant with a flat top so the “curves” look something like:

  A___
 /
/

Where point A is at the peak RPM. The problem with this is it doesn’t accurately model our cars since we get most of our torque starting down low.

Next would be the drag since that plays a big factor as well.

Of course it’s pretty easy to cheat … you can always get a running start through the staging beams. But of course you guys wouldn’t do that :wink: Maybe I’ll add some light signal system in for the next iteration lol

To be honest I’ve never coded text based apps for Android, but considering it’s just Java with some sort of layout mechanism for UI components it should be pretty straight forward. Any particular reason you want it to be an app and not a mobile website though?

Fuck…I might not sleep tonight

Hahahaha!!!

O man, that’s gay…you can cheat!! Now your Game has as much credibility as a performance post or parts review by Mick.

We need the whole deal man…christmas tree with a red light…reaction times…
Quit your real job, you have a new one…haha

https://dl.dropbox.com/u/92800314/Screen%20Shot%202012-10-03%20at%2010.37.07%20PM.png

Totally agreed!!
I never even tried cheating.

Euro is this a legit pass?

Haha maybe I shouldn’t have mentioned it. It shouldn’t be too hard to make a signaling system. I’ll see if I can put something together quickly tomorrow night.

Of course that means all the previous times will then be null and void :wink:

Maybe some way to upload and view results would be neat as well.

Or maybe even a way to record your actual run itself with the upload. Then you’d be able to pick someone else’s and race a ghost car of their run in the other lane.

is this for pc, mac or phones?

I was on a pc

Haha, no this was my proof that cheating does net you a much better time. Although that was my best “cheating” pass out of like 5 runs.

I used my Mac

Desktop Browser… I could also export to native PC, Android or iPhone but web seemed the easiest way to share it.

Android and iPhone builds also require a different licence addon that I haven’t purchased yet.

Sent you an email.

whoa that was close…
saki please update the leader board!

<---- king of the B7 RS4!! lol!!!

I can’t download it at work…so you’ll have this one day in the sun.

Just like the real RS4 stock record…you’re going down jnaut!