Games with 16x16 background tiles

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Games with 16x16 background tiles

Post by Oziphantom »

Let me make it clearer
Oziphantom wrote: Fri Jul 01, 2022 11:05 pm No background image
iNCEPTIONAL

Re: Games with 16x16 background tiles

Post by iNCEPTIONAL »

Oziphantom wrote: Sat Jul 02, 2022 12:41 am Let me make it clearer
Oziphantom wrote: Fri Jul 01, 2022 11:05 pm No background image
So, as the game designer, level designer and artist, I don't have to give a crap about the background/tilemap or its limits so long as I build my level map only from tiles in the tileset (presuming I don't plan on switching in any brand new tiles at any point in the level for now, so just using that one tileset for the whole level map for this layer)--I simply give the programmer the tileset and level map (one of each for each layer)*--and the background/tilemap restriction thing is just for the programmer to worry about?

*And, of course, the "level map" for some layers could actually just be say a 1x1 screen-size image that endlessly loops, like some mountains in layer 4, for example.
Last edited by iNCEPTIONAL on Sat Jul 02, 2022 1:46 am, edited 1 time in total.
creaothceann
Posts: 611
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Games with 16x16 background tiles

Post by creaothceann »

iNCEPTIONAL wrote: Fri Jul 01, 2022 5:41 pm The one thing that still confuses me is exactly what assets I give to the programmer if I have a level that's many screens long so he can actually put this in the game as intended by the artist and level designer:

So, for each background layer in the level, do I give him the tileset containing each of the unique tiles that will be used for everything in that full level background layer (up to 1024 unique tiles at 8x8 or 256 at 16x16, presuming I don't plan to load in any brand new tiles), the background/tilemap image (that's 1/1x2/2x1/2x2 screens large)*, and an image of the layer that shows the layout across the full level multiple screens wide so he knows where and when to actually place the tiles as the background scrolls by to match the level layout as I've designed it?

*And, if I got the stuff above correct, I don't really quite get why I need to give him the background/tilemap part anyway (or even have to think/worry about this at all for that matter), since wouldn't that technically be included in the full level image by default (be it a level one screen wide or twenty screens wide), unless I'm missing something here?
Theoretically you only need to hand out the full level bitmap (1 per background). There has to be some program that converts bitmaps to SNES-compatible data structures, and this program could also automatically create the tileset for each screen.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
iNCEPTIONAL

Re: Games with 16x16 background tiles

Post by iNCEPTIONAL »

creaothceann wrote: Sat Jul 02, 2022 1:46 am
iNCEPTIONAL wrote: Fri Jul 01, 2022 5:41 pm The one thing that still confuses me is exactly what assets I give to the programmer if I have a level that's many screens long so he can actually put this in the game as intended by the artist and level designer:

So, for each background layer in the level, do I give him the tileset containing each of the unique tiles that will be used for everything in that full level background layer (up to 1024 unique tiles at 8x8 or 256 at 16x16, presuming I don't plan to load in any brand new tiles), the background/tilemap image (that's 1/1x2/2x1/2x2 screens large)*, and an image of the layer that shows the layout across the full level multiple screens wide so he knows where and when to actually place the tiles as the background scrolls by to match the level layout as I've designed it?

*And, if I got the stuff above correct, I don't really quite get why I need to give him the background/tilemap part anyway (or even have to think/worry about this at all for that matter), since wouldn't that technically be included in the full level image by default (be it a level one screen wide or twenty screens wide), unless I'm missing something here?
Theoretically you only need to hand out the full level bitmap (1 per background). There has to be some program that converts bitmaps to SNES-compatible data structures, and this program could also automatically create the tileset for each screen.
Well that's what I was hoping regarding the tileset part. It would be a right pain in the ass trying to pick apart my level map images in reverse to build the tileset from them, since I don't generally start with a fixed tileset and build the level from it. I just try to not create too many individual tiles when building my level maps for each layer, repeating elements as often as looks acceptable, and check in SnesGFX every now and then that I've not reached the unique tile limit (I tend to stay way below the max unique tiles number just to be sure).

And I actually presume the programmer can similarly just load the image into a program like SnesGFX and export it in the format they need to actually add it into the game, because I really don't have clue what SnesGFX outputs when I try to save out the image from there anyway (it looks to be what SNES requires but it's not a file format I can use in any meaningful way as the game designer, level designer or artist).

Similarly with the palette restrictions: I just try to not create any tile using more than the three colours available in Mode 0 for tiles, and I try to make sure I stick to the 8 3-colour palettes (plus transparency) in total (per layer). And then I once again check the total colours in the layer image both in Photoshop 7 and in SnesGFX every now and then to make sure I've not accidently added in too many colours. Sometimes I accidently put one pixel using a colour from one of the other palettes in a tile or whatever, but it's usually not a huge deal to go in and fix any errors like that.

Probably not the most efficient or reliable way of doing things but it works for me (I'm just really comfortable using Photoshop 7). LOL

Interestingly, up until now, I have indeed just been handing the programmer some .png images, one for each layer, and letting them re-format those into SNES-compatible files and get the likes of the palettes and tileset from them on their end. I just make sure to create the images with the tile restrictions, palette restrictions and indeed SNES-specific colours in mind. And I also consider whether an image will simply be a constantly repeating background that's maybe only one screen wide or whether I'll need to build a longer image that represents an actual level and its layout. Plus there' some thought about maybe animating some tiles and possibly switching in some brand new tiles at points too when I maybe want to change up a chunk of the background for something else entirely. Hopefully that's all good. :)
Last edited by iNCEPTIONAL on Sat Jul 02, 2022 3:34 am, edited 3 times in total.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Games with 16x16 background tiles

Post by Oziphantom »

a single bitmap won't do. you can't just extract all the tiles. the placement of parts of the pallete in the palette are very important, if you need to do flashing, cycles etc. Also you may want different colour tiles, so they will need colours in the right spots in the palette and the correct tile number with the correct tile number. a png will not give you this information, you need to make a map with a tool that understands this or at least lets you make duplicate tiles with different palettes with a fixed palette, and then you have a bunch of tile 1026 is 234 pall 3 etc patches for the raw data. Making a full large level on the limits needs a level built and designed in this way.
iNCEPTIONAL

Re: Games with 16x16 background tiles

Post by iNCEPTIONAL »

Oziphantom wrote: Sat Jul 02, 2022 2:07 am a single bitmap won't do. you can't just extract all the tiles. the placement of parts of the pallete in the palette are very important, if you need to do flashing, cycles etc. Also you may want different colour tiles, so they will need colours in the right spots in the palette and the correct tile number with the correct tile number. a png will not give you this information, you need to make a map with a tool that understands this or at least lets you make duplicate tiles with different palettes with a fixed palette, and then you have a bunch of tile 1026 is 234 pall 3 etc patches for the raw data. Making a full large level on the limits needs a level built and designed in this way.
Yeah, I've not come across the palette cycling issue yet because I've not used that in any of my levels, but I do actually intend to, and I did think that might cause an issue with the way I'm doing things right now. Although, since Mode 0 only allows for three useable colours per tile anyway, I was hoping it wouldn't be that hard to just mess around with the order of one or more palettes manually if I were to start thinking about using them for palette cycling and the like, to see what order would make best sense to prepare the tile and palettes for such a use. Probably not ideal but I don't currently have any experience with any other art creation programs than Photoshop.

The problem for me thinking beyond that is that I don't have experience with any other art creation tools (and it takes me a long time to learn new things) and also that the SNES has not only up to 256 different colours per layer (even just the multiple 16-colours palettes starts to get a bit complex imo) but 32,768 colours to choose from, so I simply don't know how to manage that up-front. I don't know how to create the full set of palettes (especially relative to each background mode, because they're sometimes very different), and I really don't know how to do anything around the full colour range beyond posterizing the image in Photoshop when I'm ready to save it to make sure it's at least using only SNES-compatible colours.

So far, what I've done has worked for the current levels I've designed and created the art assets for and the programmers helping me have managed to take the layer images I've provided them and get them working on SNES--they've got the bridge level and ice level running pretty much the same as I mocked them up in Game Maker 8.1--but maybe I've just been quite lucky until now. I guess the fact I've not done any palette cycling or swapping and the like has helped avoid any major issues to date.

:shock:

Edit: OK, I'm installing Tiled (one of the programs you recommended). So I'll have a look at that and see if I can get my head around it. . . .

Edit 2: Right out the gate it's very confusing, with terminology that makes zero sense to me (Stagger Axis, Parallax Origin, Tile Render Order, Tile Layer Format, etc--when all I want to do is create some really very simple images with 8x8 tiles, using 3 colours per tile, and using 8 palettes with 3 useable colours in each). I feel like it's going right beyond the way an artist thinks and more into programmer-thinking territory instantly. I can't even see where the brush/pencil tool is, or even any palettes (be it pre-made ones or how I would go about setting palettes up myself), in order to start drawing the details into any tiles. Literally, I can't figure out how to even start drawing. Also, it looks like it saves out in specific formats that mean I couldn't then open it up in say Photoshop 7 if I wanted (which I probably would because I can do a lot of stuff really intuitively in there, like set one of the layers to semi-transparent to view how the overall level using all the layers might look with colour math applied for example), so now I end up stuck only working on stuff in Tiled it seems (could I even quickly view said files in Windows photo viewer just for fun every now and then for example--sometimes I just like doing that)? And I can't see anything at all that corresponds to the SNES' particular limitations and requirements outside of setting the tile size, such as the SNES' specific colours and the very particular palette setups for example (where do I even setup 8 palettes with 4 colours each, 3 useable and one transparent, or even find the SNES'-compatible master colour palette of 32,768 colours to pick said colours from?). Where can I switch different palettes in out on tiles to check the thing you were talking about regarding palette cycling? If none of that stuff is there, how is this program useful for, as well as the other general layer/tile/colour stuff, making sure I'm using palettes in such a way that I would also be able to use colour cycling on one of the palettes if I wanted for example? :shock:
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Games with 16x16 background tiles

Post by Pokun »

Well everyone does these things differently, so you would have to discuss with the programmer what's the easiest way for both of you.

In my case I like to keep the technical and artistic parts separated, I usually make a simple metatile system which the game can read and translate into the proper VRAM values automatically as the game is scrolling. When doing level design I don't have to think about the technical side much since my engine is already designed to take this simplified level data and knows what to do with it. I design levels by setting numbers in a grid in a text document basically, where each number is a full metatile (which may correspond to 2x2 tileset entries in VRAM).
This way I won't be able to see how the levels really looks like until I fire it up in an emulator though, but my workflow has made that very quick to do.

I'm not sure how well such a system works in a team. Since I'm both the programmer and the artist as well as the level designer, there are no communication problems. But I haven't really done anything spectacular as my programming skills are still quite limited, my games tends to be on the simple side.

Tiled is very powerful and therefore also very complicated and hard to get into (much like Photoshop). I have started to use it myself in order to make maps a bit easier, but I haven't fully grasped everything. It has many more features than I actually need.
I suggest to follow a tutorial and see if you can get it to apply to your case.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Games with 16x16 background tiles

Post by Oziphantom »

Tiled is a map not a graphics tool. you can not draw any images in it, set up any pallets or do any image manipulation in it. its for laying out tiles from an image into a map only.
To use it you would need to duplicate all of your 1024 tiles in each sub palette, then you place them into the map from there. This way tiles 0-1023 use palette 0, 1024-2047 use palette 1, 2048-3071 use palette 2, 3072-4093 palette 3 and so on.
iNCEPTIONAL

Re: Games with 16x16 background tiles

Post by iNCEPTIONAL »

Oziphantom wrote: Sat Jul 02, 2022 7:49 am Tiled is a map not a graphics tool. you can not draw any images in it, set up any pallets or do any image manipulation in it. its for laying out tiles from an image into a map only.
To use it you would need to duplicate all of your 1024 tiles in each sub palette, then you place them into the map from there. This way tiles 0-1023 use palette 0, 1024-2047 use palette 1, 2048-3071 use palette 2, 3072-4093 palette 3 and so on.
Unless I'm missing something and/or confusing what you're saying, they're already like that in Photoshop: Each layer image for my Mode 0 game uses only the set of eight 4-colour palettes specific to that layer, each tile in the layer only uses one of those palettes from that set (with three colours and one transparent), the image is built from the tiles (those that would constitute the tileset for the layer), I repeat and flip/mirror tiles all over the place to not go over the tile limit, and I posterize it to 32 levels so it's using only SNES-compatible colours. So what is Tiled adding here?
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Games with 16x16 background tiles

Post by Oziphantom »

it actually knows which tile you used and flipped rather than just a large image with all the pixels in it for something to then try and work it out 100% how you mapped it. Tile data and the colour data are separate, so you should make a tile map that has each tile for each possible palette, then you place from that master list, this way the map will record which tile, which palette, and which H, V settings you want. This way if you need one tile to be mapped with a cycling palette and not the fixed palette you can. because now you specify the tile, the palette ( view the tile number ) and the H and V. rather than just these pixels here in these colours.
iNCEPTIONAL

Re: Games with 16x16 background tiles

Post by iNCEPTIONAL »

Oziphantom wrote: Sat Jul 02, 2022 8:58 am it actually knows which tile you used and flipped rather than just a large image with all the pixels in it for something to then try and work it out 100% how you mapped it. Tile data and the colour data are separate, so you should make a tile map that has each tile for each possible palette, then you place from that master list, this way the map will record which tile, which palette, and which H, V settings you want. This way if you need one tile to be mapped with a cycling palette and not the fixed palette you can. because now you specify the tile, the palette ( view the tile number ) and the H and V. rather than just these pixels here in these colours.
Well, unless I don't understand how it works (and this is possible), SnesGFX outputs a file with the tile data (normal, flipped and mirrored) and palette data (created from the colours in the tiles) that can be used with SNES, so I presume the programmer can use that to get most of the data they need, correct?

Then all I would need to figure out is a way to let the programmer know what palette I'd want to palette cycle (and I presume this automatically applies to every tile that uses that palette*), and I guess, if I want to do so, any tiles I'd like to animate too, yes?

*Or can I cycle a palette on a single tile even if other tiles are also using the same palette (I wouldn't have thought so)?
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Games with 16x16 background tiles

Post by Pokun »

No, as you already understand, all tiles sharing the same palette will be affected if you modify that palette.
none
Posts: 117
Joined: Thu Sep 03, 2020 1:09 am

Re: Games with 16x16 background tiles

Post by none »

When making maps I've noticed that you can run out space very quickly, in different ways. The main reason why I've not continued working on my game because I've noticed I wouldn't be able to fit a world of the size I wanted into a few MB of ROM.

Also there are advantages with using a tile based map editor - I usually first create parts of the level in an image editing program and then create tilesets from that manually. Then I continue working with a tile map editor and then I will go back to step 1 iteratively when I notice something is odd or missing, or when I've got new ideas for things I want to have in a level. This approach has a few advantages - when you experiment with a tileset you might notice that you can use certain tiles in ways you didn't think of before, for example by using the h/v mirroring or using a different palette for the same tile.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Games with 16x16 background tiles

Post by Oziphantom »

yeah, you rarely store a raw tilemap in ROM, using blocks either on a strict grid or abstract placement along with other compression methods is common.
none
Posts: 117
Joined: Thu Sep 03, 2020 1:09 am

Re: Games with 16x16 background tiles

Post by none »

even with compression level data tends to get big quite fast, but it's also depending on the level of detail you want to achieve of course.
Post Reply