This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Generating map data from a big image

Generating map data from a big image
by on (#76830)
Does a tool exist for generating map data (metatile definitions, map data, CHR data) from a "big" image file?

I have been previously using Mappy for that but my current method (LUA scripts) requires indexed images with the color indices matching the NES background palette indices. I'd rather supply a separate palette image as organizing the palette is sometimes hard. For example, in some cases there's no way to (EDIT: automatically) properly convert RGB images to paletted in Photoshop so that the color indices match the NES palette indices.

by on (#76831)
I'm not sure if YYChr does this, but it seems to have something that looks like it might work. No idea of the output format though.

Run YYChr 0.99 beta (current version is on the author's site). Rename the file "yychr.ENG" to "yychr.ENU" to get English support working correctly. Then in the upper-right area of the main application window, there's an icon that says "BG Set". Check that out.

by on (#76832)
koitsu wrote:
I'm not sure if YYChr does this, but it seems to have something that looks like it might work. No idea of the output format though.

Run YYChr 0.99 beta (current version is on the author's site). Rename the file "yychr.ENG" to "yychr.ENU" to get English support working correctly. Then in the upper-right area of the main application window, there's an icon that says "BG Set". Check that out.

Nope it doesn't. I have tried the beta earlier and that's simply a nametable editor. I need bigger maps. :)

by on (#76835)
A "map editor" with plugin support is on my icing list. :D

by on (#76850)
cpow wrote:
A "map editor" with plugin support is on my icing list. :D

Looking forward to that. :)

In the meantime I think I have to (once again) code the tool myself.

I was thinking about a possible feature: seamless bankswitches to allow more than 256 tiles per map. AFAIK Jurassic Park does this. Has anybody here used the technique or know any other games that do so? I'm wondering if it's possible to automate the data generation for this. The biggest problem is finding the best split points and how to organize the CHR data... Not sure if it's worth the trouble. :)

by on (#76851)
thefox wrote:
I was thinking about a possible feature: seamless bankswitches to allow more than 256 tiles per map.

In my game I do this manually: I have object types used to modify palettes and tiles, and when these objects are reached they just do their thing.

My map editor doesn't know about this feature though, so editing such maps can be a bit tricky. I basically have to give my map editor a different tileset depending on the section of the level I'm editing, which means it's not possible to see the entire level with the correct tiles/palettes if such changes are used.

by on (#76860)
thefox wrote:
I was thinking about a possible feature: seamless bankswitches to allow more than 256 tiles per map.

The MMC2 does this. :P Once it encounters a "bankswitch tile", all tiles to the right of it will be from a different bank.

by on (#76861)
I think this is more about map areas than physical tiles, so MMC2 isn't the right comparison here.

Oracle Of Ages used many tilesets depending on where you were, but it's not a continuous scrolling game. But still, some of its ideas would work here too.
Oracle of ages marked a graphics set as either "Load before entering" or "load after entering". So you could have an adjacent area with only common tiles, then a more specific area with specialized tiles. So to generalize this to a continuous scrolling game, you'd need areas which trigger loading in a graphics bank as the area enters the screen, and it would need to be surrounded with areas using only common tiles.

If you need to do this with CHR-RAM instead of CHR-ROM, you'd need hint areas to indicate that it should start gradually loading in graphics for another area.

The tiles do not necessarily need to be "common" as in global to all areas, you just need two tilesets per screen, and areas which surround a more specialized area should only use the secondary tileset.

by on (#78198)
Dwedit wrote:
I think this is more about map areas than physical tiles, so MMC2 isn't the right comparison here.

Yeah (thanks for the OOA info btw).

Anyway, I wrote this tool, it mostly works. There's only one problem: it's impossible to have two metatiles that look exactly the same, yet have different tile types (solid/nonsolid etc). Most of the time that's not needed, but it might be useful for secret areas and so on.

I was thinking of having two ways of specifying the tile type. One would be to have an image with each metatile row specifying the type (first row = type 1, 2nd row = type 2, it's up to the programmer to decide what each type means, if tile isn't found in this image it gets type 0). Additionally the tile type could be overridden with another (optional) image that's exactly the same size as the map, the color of the tile specifies the tile type.