Thanks to everyone who tried the recent Visual Studio based build for Windows. The plan is to ensure this becomes a true cross platform project, not tied to a particular operating system or architecture. I like to think of it as "OutRun Everywhere", making the world a better place ;) Thanks to some work from a friend, who knows far more about this sort of thing than me, this is close to becoming a reality.
The code now successfully compiles and runs on both a Mac with XCode IDE support and the Windows MinGW compiler. Other platforms will shortly follow, including Linux and the Raspberry PI if performance allows.
We're using CMake, the cross platform, open-source build system. This automates the creation of build files for a whole range of target platforms. We're able to generate builds for a whole host of platforms and configurations.
The C++ libraries have been switched to Boost. This provides an open-source cross platform alternative to facilitate portability.
I can't take credit for the above, but I have started decompilation work on the Z80 code that controls the sound hardware (both the custom Sega PCM sample player and the Yamaha YM2151). This is my main area of focus and will take some time. So far, I've commented the code that triggers the PCM samples. Ultimately, I'd love to give players the choice of emulating the original sound hardware or streaming audio from disk, similar to the approach used by the Sega Saturn conversion.
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.
Stats:
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
Keys:
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:
60 frames a second. The original game runs at 30fps.
In a future revision, enhancements will be optional and there will be a menu toggle to enable/disable them.
Requirements:
OutRun Revision B ROMs. They must be named correctly and placed in the roms subdirectory. No other set will work. Although you can use the patched set from OutRun Enhanced Edition. I would recommend running the demo from the console to see any error messages.
Here's another bug in the original game; the leftmost two end sequences have a palette issue which causes the male sprite to suddenly change in appearance. In the screenshot below, we're approaching the goal banner.
Then, as if by magic, the colour of the man's top changes to light blue!
But don't worry, on reaching the finish line it's back to dark blue again.
The game code swaps to an animation playing routine at the point of the colour change. It should be seamless. But it seems as if 2 of the 5 end routines are configured incorrectly.
Why am I noticing such trivial details? Because the engine is now complete (minus sound and test mode). Expect a test release in the next week!
It's been nearly two years since I started rewriting OutRun, and three years since I begun decompilation work. This is, and feels like, a long time. According to Yu Suzuki, the original game took four programmers between eight and ten months to complete, so I'll take some reconciliation from the fact this was only a part-time project.
Following the success of the decompilation work, I expected the rewrite to be plain sailing. In fact, the rewrite proved tough - really tough! The size and complexity of the codebase meant I spent an inordinate length of time debugging. Writing your own code from scratch is comparitively easy; your intentions are clear and tracking errors is straight forward. Finding the source of a bug in thousands of lines of ported assembler can be a nightmare.
Debugging ultimately became a case of stepping through the suspected area of code line-by-line and comparing results with the MAME debugger. I invoked crazy tactics along the way; I coded routines to utilise MAME memory dumps for the road layer to quickly determine whether bugs were caused by erroneous code or if data in memory was at fault. This also enabled me to compare the original with my port from an identical starting point.
The other complication was the way in which the original codebase was designed and structured. The style of code varies dependent on who was working on it and by god, they produced a lot of it. The hardware specifications were insane by 1986 standards, and the coding team appear to have approached the project with the view that space and clarity were not a primary concern. There is a huge amount of code duplication and multiple routines that perform similar tasks with minor modifications. Despite evidence of code reuse at Sega, there should be no doubt that this is disposable code, not a reusable game engine. In fairness, the programming team would have been under considerable time pressure.
So what's next? I'm going to port the final chunk of code to handle the game completion sequence. This consists of a big switch table to manually send commands to the sub CPU handling the road layer (similar to the road split, but not quite the same), code to control the Ferrari AI during this period (similar to attract mode, but not quite the same), code to blit the timing information to the screen (similar to other digit blitting routines but not quite the same) and code to handle the animation sequences (similar to the start line intro sequence but not quite the same). Now, you're beginning to understand the OutRun codebase!
Once this is complete, I will release a new build for testing purposes. I was going to release sooner, but I'm so close in terms of porting the entire core engine I'm going to hold back. This build will run at 60fps and feature a selection of other minor improvements not in the original game. From this point onwards, the fun begins and we can start to include extra functionality and enhancements. It will also be a good point to port the code to a variety of platforms. I will be looking for help once I tidy up the codebase a little further.
I hope that explains where the project is, feel free to comment below if you have questions.
UPDATE: Tantalisingly close... bonus points code done, bonus sequence AI done, bonus track control done. Just the animation sequences now.
Nothing interesting to report. Since returning from holiday I've converted the high-score entry code and course map screen. When I used to develop games professionally, I didn't enjoy working on these elements and I can't say the feeling has changed much!
Next I'll move onto some of the remaining attract mode code. Once I've tied up some loose ends, I'll release a playable tech demo in order to gather bug reports. And that will be a little more interesting.
Update:
The core game engine is now ported, apart from the end sequences, test mode and sound code. We're getting close...
My ported OutRun engine now runs at 60 FPS, as opposed to the standard 30 FPS of the original arcade machine. It's beautiful and smooth. Although you can easily switch back to 30 FPS if desired.
The game was intended to run at 60 FPS originally, but reduced to 30 FPS for performance reasons. You can tell this by studying at the game code. The vertical interrupt code, including the routine to increment the timer, is intended to be called 60 times a second. Whereas the game engine is intended to be ticked 30 times a second.
The Sega Saturn version is the only other version to support 60 FPS mode. However, I can probably increase the frame rate further still... let's see!
Aside from that, I ported the the HUD and related logic (including the 'Extend Time' code between stages). The intro sequence with the Ferrari driving in and flag waving is also complete.
I will release a new tech demo in around 6 weeks so you can give it a spin and report any bugs.
Update: Tonight I recoded the engine to run at a ridiculous 120 FPS. Then I realised my LCD monitor doesn't even support this refresh rate - doh! The code becomes a little more hacky to support such a frame-rate causing a few minor bugs to surface. For this reason, I probably won't support 120 FPS. Still - it was a fun experiment, sort of...
Chase HQ is one of my favourite Spectrum games. It is a fantastic conversion, pushing the 3.5Mhz processor to its limit. A racing game boasting tunnels, road forks, destructible scenery, fantastic graphics, sampled speech, and a healthy frame rate. All this on a machine that didn't have a hardware multiply instruction or meaningful graphics hardware.
As an artist for Ocean software, Bill Harbison was part of the Chase HQ team and I'm delighted he agreed to be interviewed for this blog.
Let’s go back to 1988! Thatcher’s still in power, the Berlin wall is about to crumble and computer games are delivered on cassette tape. What encouraged you to join Ocean over the other software houses?
Honestly? Ocean were my last choice. At that time their track record wasn't great: Knight Rider and Street Hawk. After rejections from everywhere else I thought, "why not? They can only say no as well."
Little did I know that Gary Bracey [Ocean's Software Manager] was building a fresh team of people to work in-house just at the time when I decided to apply. It wasn't even a formal application, it was just a handwritten letter with a cassette of my work enclosed. Amazingly I got a call back and I moved to Manchester from Scotland to work on Daley Thompson's Olympic Challenge.
In Retrogamer, you mentioned that you hadn’t played Chase HQ before being offered the conversion. Once you’d tried the original, were you excited about the project, or was it just another job at the time?
I didn't get much of a chance to go to arcades at that time so I lost touch of what new games were out there. I had just finished work on WEC Le Mans so I thought, "oh great, another racing game!" (sarcasm) We got the arcade machine delivered to the studio and it looked a lot more interesting than the usual racing title.
Chase HQ - Arcade Version
How did you team up with John O’Brien [Chase HQ programmer] and what was he like to work with?
That's an easy one. He had just started work there a few weeks earlier and I was told I would be working with him after my previous programmer left.
Chase HQ - Spectrum Version
It was the early days of the games industry, so did either John or yourself effectively assume the role of producer and/or designer? How were design decisions on Chase HQ made?
There were no such things as producers back then. We were just given the game and told to make it work on the Spectrum. Any graphical work was left to me and the game mechanics or gameplay was mainly Jon. It was quite a joint effort, occasionally other people would chip in with suggestions and we could decide to either do them or ditch them.
One of the admirable aspects of your conversion is the attention to detail. This runs throughout the conversion, from the multiple logo animations on the start screen through to the animated end sequence. You clearly went beyond what was expected or necessary. Can you tell us a little about what motivated you to push the boundaries at a time when many arcade conversions were rushed and uninspired?
Jon was such an efficient programmer that when the game was finished he had loads of memory left over and I think he felt a bit guilty about that. We had to think of things we could add to the game, they were mainly graphical additions like the game ending and the bouncing title graphics.
What resources did Taito and Ocean provide in order to convert Chase HQ? Did you receive the original art or source code?
We got the arcade machine that you could sit in to play, it was free to play which was great and very useful.
You worked on both the Spectrum and CPC ports. Did Ocean attempt to coordinate the conversion teams?
The Amstrad version was done afterwards because I think the code could be ported across with adjustments made, the graphics however had to be done from scratch. I had done Amstrad graphics before on Daley Thompson’s Olympic Challenge and I enjoyed working with all those lovely colours.
Chase HQ - Amstrad CPC Version
What hardware and software packages did you use to create the artwork? Can you tell us a little about the process you followed?
We had no means to rip the graphics from the arcade board so I had to sit at the arcade machine and make sketches on paper of the graphics and animation frames. I later drew the sprites and animation on the Atari ST with a remarkably good in-house sprite editor written by John Brandwood. The only thing it couldn’t do was scale graphics up or down which meant that all the smaller frames of the cars and roadside objects had to be drawn from scratch. Any background elements that required colour attributes were drawn on the Spectrum with my own copy of Artist 2, the software with which I did my portfolio work a couple of years previously.
The Artist II - Spectrum Graphics Package
How long did the conversion take and what were the main challenges you faced?
I think the conversion probably took about 6 to 8 months to do both the Spectrum and Amstrad versions. There weren’t really any challenges to overcome in the project, we both knew what we were doing and we managed to get all the gameplay elements completed ahead of schedule. This left us time to show off and add as much extra content as we could think of. We didn’t really have to clear it with anyone, Taito didn’t really seem interested in what we were doing, we never had any contact with them. The only person I suppose we answered to was Gary Bracey [Ocean's Software Director] and if he didn’t like what we were doing he would be quick to tell us. He obviously did like what we were doing because he kept us together to work on a similar driving game in Batman The Movie for the Atari ST and Amiga.
C&VG rightly described Chase HQ as “the best ever Spectrum arcade conversion” and “the most astounding Spectrum game for years”. They were clearly more excited about the Spectrum conversion than the 16-bit conversions. Were you expecting this response and how did you feel when you first read the reviews?
There were a few decent racing titles out already and I knew that our conversion was better than Out Run, I just wanted our game to be better than my favourite, Enduro Racer. We were very pleased with the reaction of the reviewers but I was more touched when we received a hand-written letter from someone who had spent their own money on the game and felt compelled to thank us for doing such a good job. Whoever you were, it was greatly appreciated.
Were any features cut from the final version of the game due to technical or time constraints?
No, as I mentioned earlier we added extra content to the game. The animated title sequence came from Jon’s conversation with some of the other programmers either Paul Hughes or James Higgins. I don’t think Jon had intended to animate the titles letters and I think some gentle teasing and reverse psychology may have been implemented to see if he could do it. He not only did it but did it exceptionally well.
Why did Ocean assign a different team for Chase HQ II? Was the original game engine reused?
We were already working on Batman The Movie which was a massive license for the company and I don’t think it was seen as as important. I was a bit disappointed that I didn’t get to work on the sequel, I’m sure there are things that we could have improved on.
Finally, what are you working on now and is there anything you’d like to plug? :)
I’m working at Devil’s Details in Sheffield and I’ve just finished work on Table Top Tanks for the PSVita which is doing very well. It’s an Augmented Reality game, check it out!