Monday, August 27, 2012

OutRun C++ Engine Tech Demo 2

At last, here's a new demo of the OutRun engine. The entire game is ported, aside from sound and the service mode.

In terms of functionality, this release is bare bones. There is no menu system yet, all options are hardcoded and you have to play the game windowed.

It would be great if you could report bugs (and I'm sure there will be plenty) in the comments below. Please verify any subtleties against MAME for reference.


  • Conversion time from decompiled code: 1 year 10 months.
  • Estimated ratio of time spent coding vs. debugging: 1:5
  • Road rendering code: 1500 lines
  • Ferrari handling & rendering: 1680 lines
  • Code to render level objects: 1050 lines
  • General sprite handling code: 890 lines
  • Traffic handling code: 675 lines
  • Code to handle crash routines: 1450 lines


  • Cursors: Steering
  • Z: Accelerate
  • X: Brake
  • Space: Gear Change
  • 5: Insert Coin
  • 1: Start
  • F1: Pause
  • F2: Advance a frame when paused (useful for observing visual problems)
  • F3: Toggle/Freeze timers. (i.e. infinite time)
In a future revision, there will be options to custom the controls and the analogue sensitivity. I find MAME's default setup too twitchy, so you'll find the steering a little more heavy in comparison. 

Enhancements over original:

In a future revision, enhancements will be optional and there will be a menu toggle to enable/disable them.




Anonymous said...

Silky smooth.

Supper said...

I was really looking forward to trying this, but unfortunately I'm having the same problem I had with the last demo. When I run outrun.exe, I just get "cannot open rom" messages for every file the game needs, the same as if the roms directory was empty. The rom files are in the correct folder, the filenames match, and the rev B set I used works fine in the latest MAME. I have VS 2010, so I'm good on the runtime libraries too.

Do you have any idea what could be causing this? I'm using XP SP3, if it matters.

yt said...

No idea. Some more verbose output from the program would help in the event of error, but I haven't done that yet... can you pipe your roms directory to a text file and paste here: e.g. dir > output.txt

ruaideh said...

YT, this is an amazing work.
It (out) runs perfectly even on a virtual machine.
There is not even the need to install the microsoft runtimes libraries : just drop msvcr100.dll and msvcp100.dll in the exe directory and it works!
Note that there is no sound but still, this is Out Run.
Thanks for reviving the legend.

yt said...

Glad you liked it (and got it working).

The next step will be to assemble some volunteers to help port the engine to a range of platforms like the Raspberry Pi and mobile.

Would also be good to un-Microsoft this so it compiles and runs with straight GCC at some point...

Supper said...

Turns out the problem was my fault. My roms had an extra hyphen that I didn't notice. I renamed them and everything works great now. Sorry for the bad error report!

That said, this is excellent! Thank you so much for doing this. I'll run through it a a few times later and see if any problems crop up, though that doesn't seem likely.

matt said...

Do I have the wrong ROM set (they are all named correctly) or is this something else?

matt said...

My rom file epr10381a.132 was badly named as epr10381b.132 - doh!

Can't believe how well you have done this. 60fps looks amazing! Great work.

Michael said...

Amazing demo! Very fast and smooth.

I don't know if this is a bug but playing the game the speed goes up to 183-186kmh then falls back to 0 even if the gear is changed before reaching the max low gear speed. Sometimes it falls back to 0 before 183-186kmh

This is on an Acer 2420 laptop wth WinXP SP3, with a PS/2 keyboard attached via a USB adaptor however the game is fine when using the built in laptop keyboard. Probably my cheap PS/2 to USB adaptor is causing the problem.