Wednesday, April 16, 2014

CannonBoard Motion Control Part 2

The CannonBoard interface is progressing really nicely. Colin sent me this video earlier of the full moving cabinet working in conjunction with CannonBall.

You can see the motor calibration code is ported which moves the cabinet left and right at startup before finally centering. The in-game motor code, which I'd originally ported for force-feedback PC based steering wheels, can now be used as originally intended - to drive the cabinet's motor!

The dream is slowly becoming a reality and it's great to see the level of care and attention Colin has been pouring in to get the hardware just right. He is continuing to work on the audio interface next. 

Wednesday, April 09, 2014

CannonBoard Motion Control

In between changing nappies, I've had a small amount of time to work on the software side of CannonBoard. We're starting to get full motion control working with the sitdown cabinet.

The below video shows Colin demonstrating his OutRun cabinet connected to the Cannonboard interface. Currently the Arduino is running a ported version of the motor calibration code. This shows the interface is working and we'll be able to control the motor hardware from a PC running CannonBall.

In addition to this, we've verified that the previous work on the controls works via the original cabinet. It's a bit tricky to demonstrate though as the monitor output is to the PC currently.

My next steps are to finish the in-game motion control code and ensure the cabinet is moving correctly with the interface. Then controls and movement will be proven.

Colin is working on a version of the interface that removes the Arduino entirely. He is also working on the cabinet audio hardware interface. 

Saturday, March 15, 2014

CannonBoard First Steps

As a reminder CannonBoard is a project to enable OutRun machines to be cleanly swapped to a PC running CannonBall. A modern PC connects to an Arduino which in turn is connected to the CannonBoard hardware. The OutRun controls then plug directly into the CannonBoard hardware.

Colin posted me a prototype CannonBoard PCB last week. Click the images for a larger version.

Here's a shot from the back so you can see how it connects to the Arduino.

Here it is connected up to my chaotic test harness with the original OutRun connectors:

To make testing simpler, I'm using my hacked together OutRun controls. I normally attach these to an original OutRun PCB, but they're perfect for testing this setup.

Some LOL wiring here. It all works though. Note the stylish shoebox. 

CannonBall is currently working with the controls, which means there's no reason this shouldn't work with the original controls in a proper cabinet now. I've sent a test version back to Colin to play around with. In the meantime, I'm just pleased to have my name on a PCB.

I have another project in the pipeline - Project Baby. It's due to start any day now and will likely consume a fair chunk of time ;) Aside from that, I'll be working on the CannonBoard interface mostly during my moments of spare time. I'm looking forward to getting the motor outputs hooked up among other things.

Monday, January 27, 2014

CannonBall 0.22a - Continuous Mode

This release features a number of new features, important fixes and other changes.

  • Continuous Mode
    Play all 15 stages sequentially. This mode features its own high-score table.
  • Ability to toggle the fixed audio rom in the settings menu. It should be named opr-10188.71f and be placed in the roms directory. The fixed rom can be generated using bspatch and the relevant patch file from the enhanced edition pack
  • Fixed split axis support. XBox 360 pads should now work.
    The FAQ has some basic configuration advice. Thanks to baritonomarchetto for donating the pad. Rumble will also be supported in the future, but it means I'll have to upgrade the project to SDL 2. So it's a little more work than might be expected.

Core Engine Fixes:

  • Fixed a vehicle sprite bug that affected the angle of certain traffic sprites. Info here
  • Fixed two audio bugs that caused traffic noise to stutter under some circumstances, or not play correctly.
  • Corrected the pitch of PCM samples, they were played too quickly before. 

Other Minor Enhancements:
  • Ability to use controllers on other ports. This is configured in config.xml.
  • Support for arcade cabinets with a separate switch for high and low gear. This can be enabled in the gear options. 
  • The High Score table can display longer times to support Continuous Mode.
  • Added two handy game modes to toggle between 'original arcade' and 'enhanced' presets.

Quite a lot of code ended up changing to support Continuous Mode, so let me know if I broke anything in the process. Feel free to discuss the release on the forum

Download it here.

Update: Fixed the reported crash in continuous mode. This was a nasty bug that only materialized on a single level, when the code was compiled in release mode. 

Tuesday, January 14, 2014

CannonBoard Hardware Update

Colin Davies has been making solid progress on the CannonBoard project. This is the plug and play hardware interface that allows you to cleanly swap a modern PC into an original OutRun cabinet and run CannonBall.

"The audio is now hooked up to the original connectors. There is also a power supply input and dummy experimental load resistors to keep the Outrun PSU happy as it requires a minimum load (about 1 amp / 5 watts). This is important to balance the 5v for reliability and for the rest of the electronics on board to function. It will be optional whether the board runs from the Outrun 5v or the Arduino 5v."

The analog inputs still need to be hooked up; you can see the I/O layout below.

Soon we'll be at a point where we can start running some tests with CannonBall.

Tuesday, December 24, 2013

CannonBall 0.21 - New Views & Attract Mode

This is a minor update I've been working on for just a couple of days, but it contains some fun features. Get it here.


The first is the ability to change the camera viewpoint. There are a choice of three views: original, in-car and overhead. You can use the shift key to toggle between them, although this can be redefined. You can toggle the view at any point during gameplay. 

Original View

Overhead View

In-Car View

The in-car view is rather experimental. As OutRun doesn't use a true 3D engine, it's not really possible to implement such a view correctly from a camera perspective. However, it's kind of fun to play with.  The overhead view probably makes the game easier, as you can see more of the upcoming road. 

Attract Mode

I then decided to recode the attract mode to show off the viewpoints.  Doing so also reminded me how awful the attract mode AI is. The existing AI works fine for the first stage, but after that tends to crash continually. Combined with the Best OutRunners overlay showing every 20 seconds or so, attract mode never really showed the game's full potential. So I recoded the attract mode AI too. 

Some of the improvements to the AI are as follows:
  • Better at driving tracks without crashing into scenery.
  • No weird car shaking/juddering when turning corners.
  • Reduced brake light flickering
  • Can drive any stage in the game competently.
  • Selects a true random route, rather than a pre-defined route (as a result of the above)
  • Can handle split tracks correctly.
  • Handles the road split better. 
The AI code I've written is a lot simpler than the original code. It works differently, by looking at a distant position of the road and then adjusting the steering to drive towards it. If it gets too close to the road edge, it brakes. 

It still crashes into scenery occasionally, but I think that's ok. The AI is ultimately a compromise between driving safe and racing aggressively. And you want to see a crash sequence sometimes, just not at every bend.

Some of the original code still makes no sense to me, and I'm pretty sure it became a case of saying "this sort of works, let's ship it" towards the end of the project. One example of this is that the original code actually brakes when passing traffic, even when that traffic is right on the other side of a 6-lane road. You can spot this during the first two curves. The new code takes into account the x and z position of the traffic before braking. 

My AI still has difficulty passing trucks, as these drive slower than other traffic. Actually fixing this would probably take a fair chunk of code and I wanted to keep things simple. Plus the original AI suffers from this problem too, although arguably worse. 

You can toggle between the original attract mode and my new version in the game engine options located within the settings menu. The original mode uses the old AI and the new mode uses my rewrite. The code is here, if this sort of thing interests you.  

Other New Options

I finally implemented the ability to preview the audio track during the music select screen. You can enable this setting in the sound menu. Thanks to James Pearce who also submitted a fix for this.

Finally, there's a FPS counter that can be enabled in config.xml too if desired.

Following on from this I need to decide what to work on next. Most of the easy pickings are now done. Stuff like ghost-racing, multiplayer and so forth would be great but also a lot of coding work. :)

Tuesday, December 10, 2013

LayOut Open Pandora Port

Sebastian is working on a port of LayOut to the Pandora handheld. I didn't expect to see the editor ported to a handheld before anything else! Imagine, you'll be able to design and play OutRun levels whilst on the train to work. Here are some screenshots:

Grab it from here.

The forums were recently reset, so sadly a few posts were lost. They're back up and running now though. Be sure to checkout this cool CannonBall cabinet project from Mart, using an old Monaco GP cabinet he's salvaged from inevitable scrap!