Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
608
Reaction score
1,432
First Language
English
Primarily Uses
RMMZ
Tutorial topic: TileIDs, including Autotiles!

Brief description: I'll be going over how to determine a tile's TileID (which is used in the map data file) using the tilesheet and the shape of the desired autotile (if applicable). This info will most likely be useful for scripters, though @Shaz has just released an awesome new plugin to change a map tile during your game, and this can be useful for her plugin as well.

Requirements: RPG Maker MV, a reason to know the tile IDs

Tutorial body:
Before we start, some terms:

Tile: One square on the default map grid. For MV, a tile is a 48 x 48 pixel square.

Tilesheet: One PNG file containing multiple tiles or autotiles arranged in a predefined pattern, with no empty space between the tiles.

Tileset: A collection of tilesheets defined in the editor, that can consist of up to nine tilesheets designated A1, A2, A3, A4, A5, B, C, D, and E. Each map can use only one tileset.

TileID: A number stored in a map data file that tells the game which tile from the map's tileset to draw in which location. The number's position in the file corresponds to the grid location on the map. The value of the TileID corresponds to a particular tile from the tileset.


Tilesheet numbering

Strangely enough, tile IDs start with the non-autotile sheets first. This means we start with TileID 0 on the top-left tile of the B tilesheet. (Note: Therefore, TileID 0 always corresponds to a blank tile!) Then we proceed left-to-right, then top-to-bottom, through the B tilesheet, then C, D, E, and finally A5 tilesheet (being the only non-autotile A sheet). We'll get to autotiles in a little bit.

Here are the tile IDs for the non-autotile sheets:
Tilesheet B: 0 - 255
Tilesheet C: 256 - 511
Tilesheet D: 512 - 767
Tilesheet E: 768 - 1023
Tilesheet A5: 1536 - 1663

And here are some template PNGs you can lay over your tilesheet PNG image to see the numbers directly!
B:
tilesheet B numbering sheet.png
C:
tilesheet C numbering sheet.png
D:
tilesheet D numbering sheet.png
E:
tilesheet E numbering sheet.png
A5:
tilesheet A5 numbering sheet.png

For those paying attention, your eyes are not playing tricks on you; TileIDs 1024-1535 do not correspond to any tilesheet (at least as far as I can tell!). This is also true for TileIDs 1664 - 2047. I assume room was left here for future growth, but that's only a guess.


Autotiles

Here are the tile IDs for the autotile sheets:
Tilesheet A1: 2048 - 2815
Tilesheet A2: 2816 - 4351
Tilesheet A3: 4352 - 5887
Tilesheet A4: 5888 - 8191

Figuring out your tileID is somewhat more complicated for an autotile, as you might expect. First of all, the tilesheets are NOT numbered in a straightforward left-to-right, top-to-bottom fashion. Secondly, each autotile corresponds to up to 48 different shapes. (Note: There are only up to 47 unique shapes, but one shape repeats to give the math-friendly number 48.)

To make it easier, I've made a set of images to show you how to find your autotile TileID. For each tile you'll need to consult two images; the tilesheet numbering sheet and the autotile type shape sheet. There are three different types of autotiles: floor, wall, and waterfall types.

1) Find the starting TileID and the autotile type from the tilesheet numbering sheet. You can even place this image over top of your tilesheet to help you out. (Note: A1 autotiles contain animated autotiles. These look like three nearly-identical autotiles, but are actually treated as one autotile.)

2) Look on the correct autotile type numbering sheet to find the autotile shape you want, and add the corresponding number to the starting TileID.

Note: The plus signs (+) are located on these sheets to help you remember that you need to add the two numbers together to get your tileID.

Here are the template PNGs for autotiles!
A1:
tilesheet A1 numbering sheet.png
A2:
tilesheet A2 numbering sheet.png
A3:
tilesheet A3 numbering sheet.png
A4:
tilesheet A4 numbering sheet.png
Floor Type:
floor type autotile shapes.png
Wall Type:
wall type autotile shapes.png
Waterfall Type:
waterfall type autotile shapes.png

And there you have it! You now know how to find a TileID for any tile. Hopefully this information is helpful to some of you. :)
 
Last edited:

Anchovy

A Fish Called Amy
Veteran
Joined
Jan 9, 2019
Messages
40
Reaction score
26
First Language
English
Primarily Uses
RMMV
I'm definitely going to use these as templates. Thank you for creating and sharing these!
 

huanggaole

Villager
Member
Joined
Feb 29, 2020
Messages
13
Reaction score
17
First Language
Chinese
Primarily Uses
RMMV
Thank you! I'm using RMMV to generate random maps.
It's very useful to know how to code a map!
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
566
Reaction score
243
First Language
English
Primarily Uses
RMMV
For those paying attention, your eyes are not playing tricks on you; TileIDs 1024-1535 do not correspond to any tilesheet (at least as far as I can tell!). This is also true for TileIDs 1664 - 2047. I assume room was left here for future growth, but that's only a guess.
Just wondering, is it possible that some of these missing IDs correspond to shadows placed with the shadow tool? I'm not sure if those shadows are implemented as a tile ID mind you... they might be more of a terrain tag sort of thing...
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,441
Reaction score
2,553
First Language
English
Primarily Uses
RMMZ
I used to know the answer to this, but I've forgotten exactly why that's the case. There is a reason for it though.
 

Sigony

Crusader Masochist
Veteran
Joined
Aug 18, 2020
Messages
76
Reaction score
501
First Language
English
Primarily Uses
RMMV
This was very helpful, thank you.
 

Latest Threads

Latest Posts

Latest Profile Posts

Make a Game in RMMZ Streams are going to remain in hiatus this week. Too much to do! 4 things will be announced on Monday though! Look forward to that.
Typed a long-ish reply to a post... forgot to actually HIT the post button, and moved to a different page.... finally noticed, don't remember what all I had typed and don't feel like trying to re-type it all.... smh....
Their tactics are evolving. They've learned to call for help when cornered. Never trust a mammal!
Good morning all. I still have a post up on video editing for cinematic trailers. Please make sure to check that out and give me a message as its still active in offers.
Hey everyone! I'm back :D

Snow White? More like Snowhere to be seen amiright? Hahaha I'm so sorry!! :kaocry:

Forum statistics

Threads
112,371
Messages
1,067,842
Members
146,017
Latest member
Anselmo00
Top