   Tilemap representation
  Hi guys,I would make a reply of World 1-1 of Super Mario Bros 3. I'm pretty new on the 2D world, because my main interest is on 3D rendering.For this work I intend to use SFML library.I've found here the world map, and I'm working to extract all the tiles elements (16x16) from this map. When I done the tilesheet I will use Mappy to create the world map.The question is: and then?What is the way for represent tile map, in a game? Mappy provides an exporter for a proprietary format, but I can write my own exporter.   
  Getting very general, you essentially use an array to store the tile map information of what to render where. Then have a "Tileset" with corresponding ID's.I personally go about this in 3D API's like opengl and have a single texture hold all the tiles. Then each tile ID becomes a UV coordinate on the tile texture. This means that rendering the whole map needs no texture binding calls.There's countless other ways to do it.   ;  GodBeastX pretty much said all there is to say. However I would add a couple quick mentions.1) For small maps like this, you can probably just store the array, render the whole thing and let the GPU figure out what to clip. For larger, multi-scrolling maps, however (something like an RPG world map, or one of the early free-roamers like metroid) a simple quad-tree implimentation could speed things up. If the game is screen-based (Legend of Zelda), then I'd use screens as the smallest unit of measure. Same for uni-scrollers (vertical or horizontal, but not both). For a multi-scroller I'd go down to maybe 4x4 blocks.2) Although a hardware restriction of the NES, tiles are actually 8x8 rather than 16x16, and support horizontal and vertical mirroring. If you take this fact into account, it may explain some otherwise anomoulous-seeming data in some games. The reason most "tiles" seem to be 16x16, is because the NES graphics processor shares the palette bits between 4 adjacent 8x8 tiles in a square quad. Most games went 16x16 because its easier to deal with, but clever use of the palettes allowed some games to get away with smaller tiles.I'd wager that those multi-colored (metal?) platforms with the screws are made up of a handful of 8x8 tiles indexing different background palettes and flipped as needed.   