Hello, I’m really new here, not just at the forum but as a user of this program, so, I wanted to know what is the information stored inside the ‘data’ field in the exported file.
I’m trying to develop a game just for fun, and I exported my tilemap I created in json format, so I can load it inside my game in a easy way.
But, then I thought something like, what is the value of inside this array?
I found out that the field is an array of Gids (Global IDs), but, the reason I’m asking this is because my exported .json file, has some crazy IDs inside this array, something like: (copy-pasted) 3221225493, 1610612751 and 21.
This is the question: These numbers represents different tiles inside a same image. But, how can I read this? Is there some format regarding it or it’s something internal to the tiled application? How can I know which ID references which tile in the json file?
Ah, the information is not corrupted as I tried to open the file using tiled, and it worked as expected.
This is the image i’m using right now, which has those crazy IDs
This is the entire map
And this is a printscreen of the data matrix inside the “data” field in a background layer, that has only the gray bricks and the red carpet in the image:
I editted it in sublime text 3 adding a ‘\n’ character to separate the lines of that big array to a more friendly matrix view, which represents the entire image.
I uploaded as a image bc when i try to upload the .json or .tmx file it says that I can’t because I’m new to this forum.
These strange values are probably cause by the tile flipping flags that flip the most significant bits of the integer, hence producing a negative value in the json.
I see… I will look at it… the problem is that I am coding my game with Lua, which doesn’t have binary operators by default (Corona SDK), like standard C. But I will look at it and try to resolve myself, thanks for the reply!
Oh yes, that works as well. I was already searching for a Lua library to do all this work but this is easier
But if you (that is reading this right now) are like me, that has lots and lots of spritesheets and don’t want to consume 4x memory, you might take a look at this link: https://docs.coronalabs.com/plugin/bit/index.html