Monday, July 23, 2012

Odds & Ends

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...



Thursday, June 14, 2012

60 FPS

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...

Saturday, June 02, 2012

Interview with Spectrum legend Bill Harbison

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!

Bill Harbison - Then & Now

Saturday, May 26, 2012

OutRun Inspired Commercial

Check out this OutRun inspired commercial for the Sonic drive-in restaurant chain in the US.


Monday, May 21, 2012

Verification

I implemented the AI code to handle automatically driving the Ferrari in Attract Mode. This means I've been able to test the accuracy of the ported engine in a number of ways, which is where my time has been spent recently.

The AI code works by reading the upcoming road layout and traffic data. It outputs appropriate acceleration, brake and steering values which are read by the standard game logic. I've been able to compare my ported game engine against the emulated game engine to ensure key values are identical.

I made both MAME and my port spew out a selection of values relating to the AI, car road position, car x coordinate, car speed and so forth. By comparing the outputs, I discovered and fixed subtle bugs that weren't noticeable by playing the game.

Unfortunately, about 330 frames into attract mode the values diverged. The difference was subtle. The culprit was the Ferrari handling logic reading different x coordinate values from the road data between versions. Assuming the road rendering code was flawed, I debugged the precise position in both versions by manually setting the distance into the level and executing the routine to generate the screen x coordinates from the raw data. Both routines output identical values, so that wasn't where the problem resided.

After much debugging and some head scratching, I realised the subtle difference was due to the CPU interleaving. For my port, I run the main CPU for a full tick, run the road CPU for a full tick and then call the vertical interrupt code. However, on the original game both CPUs run in parallel. (MAME simulates this with some rough CPU interleaving). This means the road x values read by the main CPU, which are previously generated by the road CPU can be subtlely different. The difference depends on the precise number of cycles used by the code path of the road CPU.

There is no point in simulating this behaviour as it would massively complicate the codebase. It makes no visual difference, as the AI logic still behaves identically and the Ferrari crashes at the same points in each stage. I would suspect that the hardware differs from MAME again as a result of this but I haven't verified this theory. (Whether the difference is noticeable to the naked eye is another matter). The Saturn port, perfect in many respects, also differs in this area as a result of the timing differences.

Verifying this may have been overkill, but accuracy is important to me. In this case, the difference is thankfully inconsequential. I'm now moving on to a couple of other bug fixes I've identified, which will be tricky to track down!

Tuesday, May 08, 2012

Crash Bang Wallop!

All collision and crash routines are ported.




So where are we with the project? Well, amazingly, the entire core game engine is now ported and fully working! Wooo! (It's amazing to me, when I think back to starting this impossible task a few years ago). 

There's still plenty to do before the initial port can be considered done, even if the remainder is somewhat easier. Let's take a look at what's coming next in no particular order:
  • Bonus sequence code. (This is going to be easy, but quite boring to port unfortunately)
  • Start sequence code. (Ferrari driving in from side, countdown lights and man waving flag)
  • Attract Mode AI
  • High Score Screen
  • Course Map Screen
  • Game Logic (Timers, HUD, Switching between various game modes)
  • Music Selection Screen (Somewhat started)
  • Attract Mode (Some areas started)
  • Service Mode (For completeness!)
  • Sound
And then we can move onto the optional enhancements, and the features that make this project really exciting. 

Sunday, April 08, 2012

Traffic Code Ported

Porting Update:
The traffic code is now ported and the end result is 600 lines of C++ and what appears to be the correct behaviour.

One aspect that the 80s home conversions missed, is that OutRun's traffic is relatively smart. If you drive up slowly behind it, it will accelerate to stay out of your way. It will also attempt to change lanes where possible to avoid the player and other AI traffic. Each traffic object has a series of flags to denote its proximity to other road objects.


The traffic logic works by grabbing the traffic objects from the ordered sprite display list. This has the advantage of meaning that the traffic is already z ordered correctly as an optimisation for proximity checks. The display list references the original objects and the logic code then goes to work on these. 

Next I'll be working on the ferrari crash routines. You may remember that I posted about them here a couple of years ago. Yes, it's been that long!

More bugs?
I know this attention to detail is becoming increasingly pedantic but today's random bug in the original game relates to the positioning of the passengers in the car. Come to a complete stop. Gently accelerate and you'll notice both man and woman shift to the right by a pixel. Slow down and they will shift left again. 

I've found the line in the original code that's causing this, but I'm not sure if this is a bug or intentional behaviour? I'm pretty sure the programmers got a check for the horizontal flipping of the Ferrari inverted when setting the passenger offsets. What do you think?

Scoring
It's been a while since I've written something non-technical. So let's explain OutRun's scoring logic:
  • You will score when both Ferrari wheels are on road. The amount you score depends on your speed. This value will be incremented 30 times a second.

    The table of values is as follows. The player's speed is used as an index into this table:
    0, 10, 20, 30, 40, 50, 60, 80, 110, 150, 200, 260, 330, 410, 500, 600, 710, 830, 960

    To score the highest value (960) you must be travelling at 287 kph.
  • Overtaking a car: 20,000 points
  • 100,000 points per 0.1 second of bonus time on game completion