Monday, July 14, 2014

Tile Editing

One of the problems with CannonBall feature development is that many of the remaining tasks are hard to achieve. Take the music selection screen for example; it's one of the parts of the game that isn't widescreen and remains letterboxed.

Now it would be easy to simply drop in a replacement graphic at this point and bypass the original code to display it. In fact many people have sent me such an image over the last couple of years in the hope I would do just that. But that's not really true to the ethos of what CannonBall is about. The real solution is to extend the original tilemap and use the tile layer to render the screen, rather than hack in a replacement.

Unfortunately, this approach needs a full tile editing tool, which is a rather complex way of achieving something that will look no different to the end user. Nevertheless, I'm writing such a tool so that tilemaps can be edited, new tiles created and the screen finally widened.


Currently I have the ability to import the music selection tilemap, edit tile data and edit tile maps. I'm in the process of creating the new tiles to extend the image to widescreen. As you can see above, the right hand side is relatively easy to extend and I'm just starting to tackle the more complex five columns on the left hand side. 

OutRun contains plenty of unused tiles, which can be replaced for this purpose. For example, the larger Space Harrier font exists in the tileset, which is of course unused. 

Now that tiles can be edited, I can also move on to create HUD graphics for the High / Low gear change, a MPH display and so forth. The next version of CannonBall will feature these improvements. 

UPDATE: And here is the final result in CannonBall. The observant among you will notice that I've based the new tilemap on the 3DS version. 


It was a lot of work for something that looks simple. One of the complications with the System 16 tilemap format is that bits have a shared usage, that I'd previously overlooked. After all, the complications of it don't really matter when simply rendering existing data. For example a typical word of the tilemap is configured as follows:

 MSB          LSB
 ---nnnnnnnnnnnnn Tile index (0-8191)
 ---ccccccc------ Palette (0-127)
 p--------------- Priority flag
 -??------------- Unused

As the index and palette share bits, this locks tiles to certain palettes dependent on their index. Therefore the previously identified unused tiles are not usable. Instead the new tiles end up being scattered through the tilemap from location 4096 onwards. I also had to create new palette entries to map to these tiles.

This explains why Sega games have tile duplication, where the same tiles appear multiple times in the graphic roms. It enables them to be used with multiple palettes. In practice I can't help but think it would have been simpler to double the tilemap memory, thus giving the palettes their own distinct bitrange and avoiding tile duplications. I guess this may have been a cost saving measure.

8 comments:

barito said...

Your work is awesome! Thanks for sharing and keep it up!

Kungfu Steve said...

Nice work getting an editor in there for tiles. Is this pretty much the same for sprites, road objects/signs? As that would be great to change the graphics of a level.

As for Gear change display, I hope its optional.. as I think thats very cheesy / tacky.. as it takes away from the beauty and the fantasy of the game. Its a reminder that you are playing a game, and with a generic cartoony Shifter-Icon spoiling the beauty of the game. Much like how powerlines spoil a wonderful scenic photo.

If you look at Turbo Outrun's gauges.. you can compare how that really changes the look ... in a bad way. Its thick outlines, gaudy graphics, and distorted blocky numbers.. cover a lot of visual space. Where as the original game puts the spedo as a thin line.. and spreads out the other stuff thin around the boarder.


It makes one consider the possibility of a mode where you can turn off a lot, or ALL, of the displays...

Which then would propose the idea to make an output expander board.. (or program the stuff into the code) to control a set of physical Dashboard devices, such as a speedometer, oil, Temp. gauge, Tachometer, rollovers or digital mileage? (which could double as the score?) Maybe even a gas gauge, which could double as the "Timer".

Dbn Poldermans said...

What Kungfu Steve said in the last paragraph.

yt said...

There's nothing to stop anyone taking the CannonBall source code and programming some crazy expansion peripherals. ;)

I think you got the wrong idea of what I was suggesting with the gear display. I was just proposing making the 'H' / 'L' look a bit less crappy.

I like the idea of minimizing the HUD in the game, maybe have it on a toggle.

yt said...

As for Sprites, actually editing the raw data is quite easy.

However, there are a bunch of supporting lookup tables for each sprite and a lot of hard-coded dependencies that would need to be dealt with if you wanted a truly flexible system.

I'll probably work on sprite editing at some point but it's not as plug and play as you might hope!

Kungfu Steve said...

I figured, that since you were developing a hardware board.. that adding special hardware output, wouldnt be much of an issue.. because it would be a specific device and specif controller. Again, this is why its so much easier to add things like stereo 3d on an arcade monitor... where as that wouldnt be easy to do via a windows environment / pc controller.

Adrian Smethurst said...

Looks great! Well done! It's a shame that we'll never see the widescreen version of Out Run running on the original hardware but I guess as widescreen arcade monitors weren't around in 1986 it would look out of character to the original game even if it was possible to get a resolution of 400x224 out of the original board.

It would look nicer if the FREE PLAY/CREDITS text were moved to the left slightly, but I see that even the widescreen 3DS version still has that text in the original 4:3 position, so you're just being consistent with that version! :-)

Well done buddy!

yt said...

Yes, I think a few HUD related options could be nice...

- Minimal HUD
- Optional re-positioning for widescreen

I also reworked the Course Map screen so that the waves reach the edge of the screen correctly in widescreen. And the gap in one of the waves on the left hand side is now optionally fixed for 4:3 mode.