Skip to content

Internal representation

ComputerNerd edited this page Dec 2, 2018 · 7 revisions

Note this article does not apply to palettes and regular tiles.

One important concept to grasp is the fact that in Retro Graphics Toolkit when you load file it is actually converted to it's own internal representation which may support more information than the target console. For example you can load far more tiles than the target system can store in ram and then assign each tile on the map using a tile that exceeds the maximum index for a tile [1].

So why does Retro Graphics Toolkit let you do this? The reason is so that you have the flexibility to get the art the way you want it to be and then let Retro Graphics Toolkit automatically optimize your art for the system by removing duplicate tiles and in future versions very similar tiles if removing duplicates is not enough. By letting Retro Graphics Toolkit automatically deal with system limitations you preserve the intent of the artist's to the maximum extent possible. For example you create a tilemap that uses many tiles then you save your project then use the remove duplicate tiles function and now your art will fit in VRAM and you just saved yourself lots of time and got the same end result and from there all you need to do is export your data and you are done.

As an extreme example I imported a tileset ripped from a game which was stored as a PNG file. Upon importing the tileset it took 57600 tiles but after generating a palette for the image and dithering it and removing duplicate tiles it now takes only 657 tiles. You would have to be very crazy to want to do that by hand. Don't waste hours of your time doing something by hand that Retro Graphics Toolkit can do very quickly.

  1. On the Sega Genesis the tile's value for each tilemap entry shall not exceed 2047 and on the NES the limit is 255.