Monday, January 16, 2012

OutRun Sprite Zoom Bug

OutRun uses a lookup table to set the horizontal and vertical zoom values of sprites based on their z co-ordinate.

Unfortunately, one of the vertical zoom entries in this table is incorrect. If you drive as slowly as possibly by gently tapping the accelerator, there is a single position where sprites snap to an erroneous vertical zoom value. This causes the sprite to clip incorrectly and jolt to a different offset.

You can see an example of this behaviour in the animation below. Note the third palm tree from the left suddenly snaps and zooms to an incorrect position.


Unbelievably, this applies to all sprites in the game. Although it's only noticeable when driving at low speeds. However, once spotted it's hard to ignore.

I've updated OutRun: Enhanced Edition with a patch for the bug.

In other news, expect an early tech demo of my C++ port very shortly. It was in coding the port that I spotted this bug.

Update: The Sega Saturn port does not suffer from this issue. Looking through the Saturn binary, I can't find the lookup table used by the arcade version, so this area was probably rewritten for hardware purposes.

The Xbox port (part of OutRun 2) does have the bug.

7 comments:

JetSetSkippy said...

Wonder how that bug came to be, surely those lookup tables weren't manually typed up? Usually generated by a fashion of defined attributes. Now I'm gonna have one eye on the road and the other on a palm tree :-/

matt said...

Awesome attention to detail. I'd love to see if you could get a response from the creator of Outrun, Yu Suzuki, about this project. I wonder if he knows about it?

yt said...

I'm sure, like most game visionaries, he's more focused on his upcoming work than something he worked on 25 years ago.

But glad you're enjoying the blog. More news and a tech demo in the coming weeks :)

matt said...

Oh, yeah, I'm sure he is. But - like Jordan Mechner with the recent C64 Prince of Persia port it was nice to see a shout out from the man himself.

http://popc64.blogspot.com/2011/10/prince-of-persia-for-commodore-64128.html

Also, have you seen this?

http://marketplace.xbox.com/en-US/Product/Ocean-Drive-Challenge/66acd000-77fe-1000-9115-d80258550a61

Video: http://www.youtube.com/watch?v=aakort5bb8o

yt said...

Good set of links - thanks. I hadn't seen the Prince of Persia blog before, and am interested in similar endeavours.

I wish I'd had Yu Suzuki's original documentation when I did the disassembly, it would have made life far easier!

Figuring out the source code from scratch took well over a year...

And actually porting the code to C++ hasn't been as easy as I naively expected, mainly due to the complexities of many of the level rendering routines.

Debugging road rendering routines that fail at very specific points in the level was an absolute nightmare. But thankfully, one that is over now.

Misty Simmonds said...

http://www.youtube.com/watch?v=gpW24-3g4B0

yt said...

Misty - that's interesting... but curious to see what happens on hardware rather than MAME if that strange bug can be reproduced.