Tiles ID different when export

Hi, i’m new in this great worktool and i’m having trouble with the tiles IDs, but just in one especific computer, others are working properly. I have a github with all the .tsx files and the images with the tilesets related. When someone downloads it from the repo and import to the Tiled, than they can generate the map with the same Tile’s IDs and I have no trouble in mapping it in Unity. But, in just one pc, the tile are exceeding the ID value, the maximum should be 255, looking manually on the tiled properties, but when generate the .xml file in CSV, there are some tiles with 267 and 264. And that’s causing errors to me. Someone can give me hint? what can be happening? I tought it could be something related to the gid, but they have the same gid, because the .tsx is the same file because they are getting it from the git repo

By “.xml file in CSV”, do you mean a TMX file with the CSV Layer Data Format? Or do you mean something else?

It’s very odd that one PC would have trouble that others don’t have, so pardon is these are dumb/obvious questions:

Are you certain there’s only the one tileset in the map, and that another one hasn’t been added by accident? Are you certain that the user is using the exact same tileset? Perhaps they’re using a modified local version with a different size and therefore different tile IDs.
If the user of the affected PC places the 0th tile, what’s the GID it gets? The easiest way to check this is to put the 0th tile in the top left corner of the bottom-most layer, so it shows up first in the file. If the GID is as expected (1), then check what tiles show up in Tiled in those slots. If you right-click the tile in Tiled, it should take you to that tile in the tileset.

1 Like

Yes, I meaned CSV Layer Data Format.

Cool, i’m new, so i’m not concerned about it

Yes, I have controlled remotelly the computer and it seems okay, the person have only imported the .tsx that is on the repo and when i verify every tile ID on properties, it looks okay. But when generate, it has IDs exceeding the last ID.

I’m not sure how to verify this, maybe because my english is not that good, but when I check the level generate by me and a level generated by the affected PC, it generates a ID different, but looking at the .xml file, I see that the tileset has the same firstgid. I found out that the affected pc uses the windows 64 bit snapshot version and all the others, uses the first option download to windows. That should be important? In the moment, I have no acess to the affected PC, but as soon as I get acess I will try to compare the Tile’s gid on the .xml and post here, thanks for the reply.

<tileset firstgid="1" source="../Tileset/MixAndJam/MixAndJam3.tsx"/> <tileset firstgid="257" source="../Tileset/Image Colection/ObjectsCollection.tsx"/>

That last line has your problem :smiley: The second tileset, “ObjectsCollection.tsx”, is the source of the tile IDs higher than 256. The first tileset has tiles 1-256 (or 0-255, once the firstgid is subtracted), and tiles from the second tileset have larger IDs. If you subtract that tileset’s firstgid from the global IDs (e.g. 264 - 257 = 7), you’ll get the local tile ID for that time, within this “ObjectsCollection.tsx”.

2 Likes

The problem is happening with the first tileset that has firstgid=1, I forgot to mention that. It is generating tiles like 264 ID or 267. The second tileset is working fine, I just use the second one to place objects and not tiles on the map.

The snapshot shouldn’t produce different results for this, I don’t think layer data storage was modified in that.

When you encounter a tile ID like 264, it usually means the tile is in the second tileset rather than the first.
Global Tile IDs 1-256: first tileset
Global Tile IDs 257+: second tileset
If your local tile math is correct, you should never get a value for the first tileset that’s above 255 even with a broken map. How are you calculating the tile IDs?

Is there any chance you could share the files in question? There might be something else that I could notice if I actually had them to compare.

Later I will have acess and do the tests that you mentioned, and I will post here, including the files. But just answering, i’m getting the firstgid and subtracting it from the gid to get the ID. But when I say 264 or 267, its the gid located on the file.

Okay, I thought that

The GID in the file being 264 means that somehow, tiles from the second tileset are being put onto the layers. And this is apparently happening without the user making any changes to the file aside from just saving it?
Are most of the tiles above 256, or is it just a few?

My guess would’ve been that the tilesets are somehow getting reversed in order, but you said they’re not. Very odd.

Yes, most of them are above 256, just a few is exceeding it.

Is it possible to put objects on a Tile Layer? Maybe some how, i’m not seeing it, but it is there, breaking the layer.

I will try too erase everything and paint again to see if somehow this doenst happen again.

It is possible that i’m not checking properly what you’ve asked, so when I get the files it will become more clear, I think. Thanks for the replies, you are being so helpful.

You can’t put objects on a tile layer, but the art from "ObjectsCollection.tsx” can be used as regular tiles. The Tile Objects you’re placing are just objects with tile artwork attached to them. Nothing’s preventing those tiles from being used as tiles :]

If most of the tile IDs are wrong, then it sounds like the tilesets just got switched around somehow, but your importer isn’t picking that up - either something went wrong in Tiled (unlikely, but possible), or your importer is making assumptions about the tileset order that it shouldn’t.

I don’t have the snapshot to play with here, so just in case: @bjorn Is there any chance at all that the snapshot build might be messing up tileset order or otherwise mismatching firstgids with the actual tiles? I’d like to rule that out if possible, so I can focus my effort on more fruitful lines of thinking.

1 Like

Can’t be 100% sure without testing, but I think we can rule that out.

2 Likes

That solved the problem. I verified the Tiled, now that a have acess to the PC, and, the person that created the map, used a specific object that was the same “visual” as the tile. Like a falling plataform, that is in the “ObjectsColletion.tsx”, so the ID is correctly, working properly and it was a human mistake, the user was using a object on a tile layer, like you said.

Sorry for wasting your time in a stupid problem. Thanks for the replies, you helped a lot.

1 Like