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. 

11 comments:

Obiwantje said...

Just wanted to let you know how much I enjoy reading your blog and your enthusiasm for our favorite Outrun game! Much, Much appreciated!

yt said...

Good stuff - I've enjoyed coding the project, it's always satisfying when there are some happy gamers!

Legooolas said...

Hey yt, this is pretty straightforward to get it building on Linux (same as the Pandora really, and I have a couple of fixes to get it to build with optimization turned on with GCC (template definitions need to be available in the same place as the declarations).

Should I just create a fork and make a pull request on github?

(I'm also interested in helping make it run faster :)

yt said...

@Legooolas: Make your changes from the master branch.

Send me a diff file created by GIT with the results.

I'll integrate anything decent of course and will happily help you in any way I can.

Nice one.

E-mail me here:
http://www.javagear.co.uk/images/email.png

yt said...

Have also added some info to the wiki here:
https://github.com/djyt/cannonball/wiki/Helping-Out

d from Shmups said...

You rule. This is too good to be true. The HD mode is a big improvement.
In the future would it be possible to be able to select a resolution and render the game at that resolution?
Like 1366x768. That is the resolution of my tv and computer. I know the game will still have the low res feel, but the scaling will improve if it is done in an even higher selectable resolution.
1000 thanks for Cannonball

yt said...

@d: Let's say we ran at 1366x768, and rewrote the code to always use the highest resolution sprites, things would actually look a little weird.

You'd end up with a situation where objects in the distance were consistently crisper and more defined than those in the foreground.

This would be the inverse of reality, and make the depth perspective feel wrong.

Sprite scalers suffer from this to some degree (when you get really close to the objects), but what you suggest would probably exaggerate the problem.

The original sprites simply don't offer the clarity to benefit from a higher native resolution. You'd be looking at a complete art swap to make this work I think.

matt said...

You're not joking that it causes a performance hit. I can only run the hi-res version at single scale on my 2.5GHz i5 with AMD Radeon HD 6750M. Full screen brings my machine to its knees.

yt said...

You need to lower your desktop resolution before starting Cannonball.

If you're upscaling to thousands of pixels by thousands at 60fps, that's going to have a performance hit on even the fastest PCs.

matt said...

I take it that there's no hardware acceleration support? Thanks for the workaround.

yt said...

That's right, it's pure software scaling at the moment.

A fun task for someone (maybe me when I get round to it) is to implement an OpenGL based renderer.