Can't figure out tilemaplayer

Godot Version

Godot 4.7

Question

So I have not been able to figure out how to use the TileMapLayer. Looked through a few videos and posts but I can’t get it right.

So here’s the tilemap I’m trying to use:

I’m trying to use the tilemap to make very simple buildings and rooms like this:

And right now I have it set up like this:

So my questions are:
Is that pattern enough to get the tilemaplayer to work how I want? If not what am I missing here?


uh for what? platformer?

Yeah side scroller platformer

In your atlas shot the grid looks like it’s cutting through the middle of the artwork instead of framing each piece, so I’m wondering if the Texture Region Size doesn’t match how the sheet was drawn, or the sheet has a border or gaps between pieces that aren’t being accounted for. Select the atlas in the TileSet and check Margins and Separation. Margins moves where the grid starts and Separation is the gap between cells, so between those two you can usually line the grid back up without recutting the image.

The other thing I noticed is the art isn’t all one footprint. The hexagon, the window panes, the big room shape with the curved bottom, the arch, those are all different sizes, so no single region size is going to frame every one of them. What I’d probably do is set the region size to the smallest piece that repeats, then for the bigger ones drag the handle on the tile in the atlas so a single tile spans several cells.

What are the pixel dimensions of the sheet, and what did you set Texture Region Size to? Those two numbers would tell us whether it divides evenly in the first place.

Dimensions of the map is 2000x2000 I believe. Texture region I have it at 32x32

Im making a similar game rn (Shadows of Fire by FreddyM1111) - tile maps can be annoying but they do the job
If you try offsetting the margins more that should frame your art in the correct region

2000 over 32 gives you 62 cells and a 16 pixel sliver left over, which on its own isn’t that crazy since Godot just won’t make a cell in the remainder. The thing that matters more is the spacing of the art itself, and margins shift where the grid starts without changing how far apart the cells sit, so if the pitch isn’t 32 the grid will keep landing mid artwork no matter where it begins.

Maybe try opening the sheet in an image editor and measuring one of the small repeating pieces, from its left edge to the left edge of the next one along. That number is your Texture Region Size, and if there’s a gap between pieces the gap part goes in Separation.

I’m getting it now, makes sense and I feel silly for skipping the math part of this whole thing. Setting the range to 50x50 Fits the map nicely, and the tilemap’s working well. Gotta try to make the slopes and other fancy tiles but at least I got a good idea on how it works now. Thanks for all the help!