Export Json, understanding wrong

Hi,

I am used to use Tiled to create very nice map for Pygame. For the 1st time, I’m trying to make something different: I want to export my map into a Json and use it for a web project.

In every topics, you have layer’s data that looks like a CSV

"layers":[
        {
         "data":[8, 8, 45, 14, 44, 8, 8, 3, 3, 25, 1, 1, 1, 1, 1, 44, 8, 8, 8, 8, 1, 1, 1, 34, 1, 1, 1, 44, 8, 45, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 54, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 4, 4, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 13, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 33, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 4, 5, 4, 4, 4, 52, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
         "height":15,
         "name":"background",
         "opacity":1,
         "type":"tilelayer",
         "visible":true,
         "width":20,
         "x":0,
         "y":0

But what I get is something I can not understand in “data”

         "compression":"zstd",
         "data":"KLUv\/WCAJJUAADAAACgAKgADUAIAl9H\/0d\/6Dw==",
         "encoding":"base64",
         "height":80,
         "id":9,
         "name":"Zaap1",
         "opacity":1,
         "type":"tilelayer",
         "visible":true,
         "width":30,
         "x":0,
         "y":0

Is it because of the compression ? How can I have something that look like a CSV ?

Thanks for your help guys !
Regards

Yes, this is because of the compression. You can set CSV as the Tile Layer Format for the map in the Map Properties to get CSV output.

You should at least consider using compressed output though, as it makes for much smaller files, and can even be faster to parse than CSV as a result. Tiled offers a few different compression options, in case you don’t like Zstandard.

1 Like

Thanks, I did not find a way to modify the settings once the map is done, so I decided to make a new map & change the before when I created it :slight_smile:

Rgds,

Quentin

You can modify the settings at any time. To access the map properties, go to the Map menu, and Map Properties should be near the bottom.

2 Likes