Unable to create multi column tileset

Hi, I’ve downloaded and begun working with Tiled, but run into a problem. I’ve created a tileset based on an image I made but tiled only seems to recognize the first column of tiles in the image.

Everything works fine if I make the image one long column (and I could use this workaround) but if I try to create the tileset using an image with any more than one column it simply ignores the rest of the image and only ‘sees’ the first column.

Obviously, I’ve gone wrong somewhere as all the examples utilize images with more than one column but I don’t seem to be able to make it work.

All the times I tried to create a tileset always put the number of columns as ‘1’ and does not allow me to edit this number.

I tried editing the .tsx manually and increasing the ‘column’ count manually, but this has no effect. (All the examples I found have a higher number than 1 tiled/examples at master · mapeditor/tiled · GitHub)

Is there someplace else this is done? The documentation isn’t much help, it just says this number is ‘read only’.

When creating a tileset, you set your tile size, not the number of columns, and Tiled automatically calculates the number of columns. Make sure you set your tile size correctly. You can edit it by editing the Image property of the tileset in Tiled.

The column count is read only because it’s just calculated as floor(imageWidth / tileWidth). The tile size is what determines it, in other words.

Thanks for the response.

I understand that, and I can correctly set the tile size. The tiles it recognizes look just fine. The problem is that Tiled just *does not * recognize any tile after the first column.

In other words, if I have an image of 1000 x 1000 dimensions, containing tiles of 100x100 in size. If I try to create a tileset using said image, setting the tile size to 100 x 100 tiled only ‘sees’ the leftmost 10 tiles. (The first 100 x 1000 pixels) It ignores everything after the 100th pixel in the horizontal direction.

The tiles it DOES recognize are the correct size and work fine.

If I try to use the same file but enter a deliberately incorrect tilesize, that works too. It recognizes the first N pixels of whatever I set the tilesize to but ignores the rest of the image.

Here’s an example of what I’m talking about. ON the left is my source image. It has two columns, On the right is the tileset in Tiled. . . it ignores everything in the second column. Where did I go wrong?

Interesting! This is unusual indeed.

Could you check what the spacing value is on the tileset (ediable/viewable in the tileset Image property)? I wonder if it’s perhaps somehow too high, causing Tiled to think the remaining tiles are part of the space between the first column and the “nonexistent” second column. The value should probably be 0.

Thank you! That does help.

The spacing was set to 1, when I tried to create a new tileset with the spacing set to 0, it correctly shows all tiles, but now the tiles at the end of the file are misaligned. (It seems there really is a ‘space’ of 1 that creates a creeping misalignment if ignored. )

So. . . that was progress but not a solution. =D I’ll try to jigger with the file some, maybe add an extra pixel to the margin?

What size is your tileset? If it’s 2 columns with 132px wide tiles and 1px spacing, it needs to be at least 265 pixels wide.

Better yet, would you mind posting your tileset image? it doesn’t have to be the whole thing, just the top row or two would be enough to test with.

Edit: I wonder, could it be that you have vertical spacing of 1px but no horizontal spacing? Tiled doesn’t let you set those separately, so you need to make sure your horizontal spacing is the same as your vertical spacing.

2 Likes

Yes, the image was 264. When I added an extra pixel to make it 265, I was able to make it work with 1px spacing.

I think that’s got my issue solved. . . at least it looks right in Tiled. I’ll see if I can actually use the map in software and get back.

Thank you again, for the quick help!

EDit: Looks good, I think this is sorted now. Thank you!