Saturday, January 26, 2013

Cannonball 0.17 - Analog Controls

The latest release of Cannonball finally supports analog controls. I've only tested with my Logitech Momo Racing wheel and pedals, so would be interested to get some feedback on how well it works for you, as your hardware may differ.

You can enable analog controls in the Settings -> Controls menu. You should also redefine the gamepad buttons accordingly for start/coin in etc.

There are a few advanced options you might need to edit in the config.xml file. These include which axis the steering and pedals are mapped to. You should be able to check this using the driver software provided with your wheel. Ensure that each control is configured to be on a separate axis in your driver software.

There is a further setting to denote how much of the turning circle of your wheel should be used. For example, I personally prefer tighter steering, so turning 50% left is in fact a hard left.

I will investigate force feedback at a later stage. I think the term force feedback is somewhat misleading though. OutRun didn't offer force feedback. The steering was centered by two large springs. A motor would essentially move the steering column when driving off-road or during a crash sequence creating a vibration effect.

The version of FinalBurn with force feedback actually uses the moving OutRun deluxe motor code to affect the wheel, so it's more akin to vibration. I can look to implement something similar in the future once I figure out the best approach; the stable release of SDL doesn't support this out of the box.

It's fun to finally be able to play with a proper racing setup. It makes some parts easier and some tougher. And we can finally claim that Cannonball is the ultimate version of OutRun.

Update: Also fixed a bug where time trial scores didn't initalize correctly from a new install. If you failed to record a best score in time trial mode previously, then this should be fixed!

Wednesday, January 23, 2013

Cannonball Future Plans

Things are going well with Cannonball. It's great to see some of you getting your hands dirty with ports! One of my original objectives was to bring the definite version of OutRun to every platform known to mankind. And we're slowly getting there ;)

I've added some brief information for those porting Cannonball on the following wiki page.

I plan to work on two features next. The first is analog control, including pedals. I picked up a Logitech MOMO Racing wheel cheaply on ebay. I just need to wait for an adapter plug to arrive in the post and then I can give it a spin.

Force Feedback support will probably arrive later, given that it's not in the current stable version of SDL. It's possible we can patch it in for some platforms though.

I'm also going to start work on an interactive track editor of sorts. This is likely to take me some time, so don't hold your breath on this (and I'll probably divert to working on the steering wheel stuff before). 

I like the idea of rendering the level as you will see it in the game, dynamically adjusting elements of it, and then being able to race it on the fly. 

click for full size version

I've started reimplementing the mode I had in the early tech demo, where you can step through a level and adjust the camera in order to facilitate this. Although now we have hi-res and widescreen as an added bonus. 

Sunday, January 20, 2013

Cannonball 0.16 - High Resolution Mode

This version adds what I am calling 'high resolution mode'. The standard game resolution is doubled. The sprites and road are rendered at a higher resolution where possible. If you look at the screenshot below, you'll notice that the road is more defined and the scenery less pixelated.

This mode isn't perfect. The high resolution road layer has mixed results. This is because the original code isn't fantastic to begin with. If you look at the screenshot below from MAME, you'll notice that the road lines aren't always rendered correctly. (OutRun issue, not a MAME bug just to be clear).

When running in high resolution mode, some of these problems become more noticeable. The optimal solution would be to rewrite the OutRun road code. But this would be a mammoth job!

The other thing to note is that OutRun uses five differently sized frames for each piece of scenery. 

The relevant frame is selected, and then scaled in hardware. In high resolution mode, we still want stuff that is in the distance to be more blurry or pixelated than the foreground. Therefore, for now, I haven't changed the actual frame that is initially selected, it's simply the scaling itself that benefits. The results are relatively nice and it's somewhat faithful as we're still using the original artwork.

You will need to enable high resolution mode in Settings -> Video. It's disabled by default. 

Other changes

You can now play the prototype Coconut Beach level. It can be enabled in the Settings -> Game Engine menu. This will swap out the standard Coconut Beach level. 

Lots of video options have been added to the Settings -> Video menu that were previously only available by manually editing the config.xml file. 

I've also made some changes to the build system to facilitate ports. 

Cannonball Mac OS X Port

Marcus Herbert has kindly ported Cannonball to OS X. Congrats! It currently runs on OSX Leopard, Snow Leopard, Lion and Mountain Lion.

Marcus writes "It currently is fluid on a Core i3 iMac (you get some stuttering at some place if you choose 60 fps)". You can grab it from here.

I'll work on getting his changes back into the main source tree in due course. 

Monday, January 14, 2013

Higher Resolution Mode

I'm working on running OutRun in a higher resolution using the native graphics (i.e. no new graphics are required). 

In the below screenshot, I've split the image between the original resolution scaled up (left) and the higher resolution (not using scaling). Ignore the fact that the road and background are missing for now, as this is still work in progress.

You can see that the start sign and road signs on the right are much clearer. 

This doesn't help objects really close to the camera, as the original sprite files aren't particularly high resolution to begin with. But it does help images in the distance. The Dreamcast port does something similar

OutRun actually has five copies of each sprite, manually tweaked to look as good as possible at different zoom levels. I made an initial attempt to go one step further and completely replace the lower resolution sprites with their higher resolution counterparts. But the results didn't look good. I'll keep working on this. 

Sunday, January 13, 2013

Cannonball 0.15 - Time Trial Mode

Time trial mode is here. Here's how it works:

Select TIME TRIAL from the main menu. Choose the number of laps you want to race for. You can select the maximum amount of traffic you want on-screen at any time. You can also disable traffic completely, so it's purely you and the race track with no random elements.

Select the track you want to race by pressing left or right. The lap time in the bottom left shows your best time for the selected track. The course map screen is reused as an attractive level select:

And we're off. You're reminded of the time you have to beat when you start the stage. Normal scoring has been replaced with a counter that represents the number of vehicles you've overtaken. 

In the screenshot below you can see I've just started my third lap of the track, and achieved the best time. Yay. You'll notice that the lap times you've achieved so far are shown top right. I wonder where I got the idea for that?

After the final lap, you're presented with some nice (or useless depending on your point of view) stats:

Both the Japan and World tracks are playable in this way. Each set of tracks have their own unique times. 

I also added a config.xml option to toggle some of the bugs and a music test menu. In the original service mode (which isn't ported yet), Last Wave can't be selected, but now you can.

Please report any bugs below. I changed some of the core code to implement the time trial mode. Hopefully I didn't break anything too badly in the process.

Update (15th Jan): Fix for redefine keys not working.

Saturday, January 12, 2013

Unused Prototype Coconut Beach Track

Whilst working on the track select for time trial mode, I uncovered an unused OutRun track layout.

It appears to be an early prototype of Coconut Beach; and is found in all versions of the game. It is significantly different from both the Japanese and World versions of this level. It's tougher, with sharper bends although the final chicane is missing.  You'll notice there are a few scenery changes, as well as small amounts of ground debris. There are also scenery errors with directional signs pointing the wrong way.

Here is a video I recorded in MAME:

The level can be enabled only by using the MAME debugger. You will need to set the following breakpoint on the master CPU (Revision B romset):

focus 0
bpset e4ea,1,{b@260010 = 3A; g}

This breakpoint will swap out the final Coconut Beach track for the prototype.

UPDATE: This track is now playable in Cannonball.

Wednesday, January 09, 2013

Videos of Cannonball & Enhanced Edition

Here are two videos showing the projects on this site in action!

Cannonball running on the Pandora platform:

OutRun: Enhanced Edition running on real hardware:
I love this guy's enthusiasm. He is pretty bad at OutRun though! ;)

Sunday, January 06, 2013

Time Trial Mode

I'm working on a time trial mode. Choose any track, choose the number of laps and aim to achieve the fastest lap time! I'm also going to record other stats, including the number of overtakes. Here's a screenshot:

This is a genuinely new mode, focusing on track mastery as opposed to linear progression and the first small step towards taking Cannonball in a new gameplay direction.

Suggestions welcome in the comments, although aiming to keep the scope of this first project manageable in order to have something released this month. 

Saturday, January 05, 2013

OutRun: The original game shipped with corrupt sound samples

Thanks to David Haywood for alerting me to the following information. Checkout his blog if you haven't already, it's a terrific read.

It would seem that OutRun shipped with a corrupted ROM containing some of the percussion samples used by the music tracks. Every music track bar Last Wave, is affected by this. Even the original sound track CDs, recorded from the production boards, contain the glitch!

The offending rom, opr-10188.71, appears to have a single bit stuck high (xx1xxxxx). The sample data is distorted as a result.

Hiro Kawaguchi, the composer, had this to say on January 18th 2007 when discussing the 20th Anniversary Edition release:
Isoda (recording engineer) listened the sound of OutRun before recording, then he noticed that drum sound is very noisy. This is strange, so he checked the board. Then he found one of the ROM is bad (bit6 is always ON)." 
Using Google translate, he goes onto say they recovered the original samples from the CP/M format disks for the 20th Anniversary boxset.  Listening to the 20th anniversary rendition, it is indeed correct. However, older versions, including the 1996 Sega Saturn release appear to contain the glitch.

You can visually see the problem in the screenshot below. The bottom waveform is the glitched version. The top waveform is a corrected version. Unfortunately, we're not certain of the origin of the fixed version. Was it provided by one of the original developers, or manually fixed?

The fixed version has not made it into MAME, due to their focus on reproducing the original experience accurately. However, there's no reason this fix can't be incorporated into Cannonball or the Enhanced Edition.

The samples in this file include the wood blocks and big cymbal crashes. The most noticeable difference is for Splash Wave, which uses many of these samples in it's introduction.

The improvement is most noticeable when using decent headphones or studio monitors.

Edit: I updated OutRun Enhanced Edition with a patch for this issue. 

Cannonball 0.14 - Japanese Tracks & Scanlines

As mentioned in my previous post, Japanese tracks are now supported. And yes, the Japanese version really does have those violent horizon changes - it's not a bug! You can enable Japanese tracks in the Settings -> Game Engine menu.

You will need to copy the following files to your roms subdirectory:


These files should match the romset known as outruno in MAME.

Each set of tracks has its own high-score table, as their difficulty varies. Clearing high-scores in the settings menu now clears the scores for the track you have selected.

Scanlines are also supported. I was initially reluctant to offer scanline support. I view MAME as the optimal solution for playing games with filters if you want to simulate that CRT experience. However, it was the most requested feature (alongside analog control support), so I decided to press ahead with them. And to be honest, I quite like the result.

It's the Japan course map, with scanlines.

You can toggle the scanline intensity in the config.xml file. Scanlines have two caveats: they are disabled in 'stretch mode' (i.e. when the final image is stretched to fill the entire screen, losing its proportions). In full-screen mode, there may be additional bordering to ensure the scanlines are even. Scanlines are disabled by default. 

Bugfixes: Two minor bugfixes; an issue with numerals when changing the music selection text and a bug where the Ferrari didn't rev at the start line when using custom WAVs. 

I would also like advice on a good force-feedback wheel to purchase for the PC. Ideally something we can easily hook up to Cannonball.