Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.


#1 2013-05-27 05:00:55

New member
Registered: 2013-05-27
Posts: 3

Map Zapper - a work-in-progress background map import tool

I made a really lazy client-side HTML5 web application to let you drag a background image which adheres to the background tile restrictions of the GBC, and it will let you export the resulting tileset, palettes, and map data which can be used to construct the original screen. The tool will automatically detect paletes and unique tiles in the image. It will reject any image that doesn't conform to the GBC art limitations of 4 colors per 8x8, 256 max tiles, 8 palettes max of 4 colors each. I've only tested in Chrome, but it should probably work in Firefox as well.

The most relevant formats for GB exporting are these ones:
- .chr files are raw 2-bit character data in GB tileset format.
- .pal files are a collection of palettes of 4 colors each, in 15-bit RGB format (So 2 bytes per color * 4 colors * palette count).
- .tiles.dat and .attributes.dat files are tile maps with the following data format: width : uint16_t, height : uint16_t, data : uint_8[width * height]

There are also bunch of utility features to allow you to turn tilemap images into tmx files you can edit with Tiled, and minor junk like that, which might be handy depending on what you want to do.

- Improved error reporting. Right now the errors will just throw uncaught exceptions, but I'd like this to recolor the source image with RED in bad parts of the image (too many colors, too many tiles, too many palettes, etc).
- A setting to enable unique tile detection that is invariant to flips, and export flips as data in the attribute map.
- Specifying a tileset (rather than using the autodetection) and verifying tiles in the map are only from that tileset
- Specifying a master palette and verifying colors used in the tiles are only from that palette (eg. that all colors are from the NES palette). Allow exporting of palettes that index into the master palette rather than specifying RGB values.
- Customization of the tile and attribute region sizes. eg. 16x16 attribute regions, 8x8 tile chunks (NES specs).
- Allow compression of the map data, probably via RLE, or "metatiles" (MxN tile regions that contain distinct arrangements of tiles, in the same way that tiles are reuse of pixel data), and maybe "metametatiles" (the same process applied again).
- Figure out some way to handle maps where the attribute size is much smaller than the tile size (like MSX art restrictions, where it soundssss like you can change the palette on every 8x1, but tiles are 8x8?)

Last edited by Overkill (2013-05-27 05:11:53)



Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson