Question about TMX maps - Layer formats

Dyson,

It looks like the Tiled TMX map needs to have the “Layer format” set to XML.  And you are right that the load time for this map takes a LONG time - about 11000 - 12000 ms!  Do you think MTE will support Base64(XXXX) layer formats, maybe csv.  I believe that this might help with the load times since the file sizes are much smaller.

Some interesting numbers on the CastleDemo map:

  • As a TMX with Layer format as XML - 2.3 MB
  • As a TMX with Layer format as Base64(Uncompressed) - 643 kb
  • As a TMX with Layer format as Base64(gzip) - 26 kb
  • As a TMX with Layer format as Base64(zlib) - 26 kb
  • As a TMX with Layer format as CSV - 279 kb
  • As a JSON file - 400 kb

Noral

I also noticed that the memory reported while running in the simulator as a JSON file is 6-8 MB where a TMX file is 45-50 MB.  That is a LOT of resources.

I’ve had a few people mention this to me! I’m definitely looking into alternative data formats for the TMX support at this point and will let you know when things are set to change.

The active memory in the simulator being 45-50MB… now that is news to me and simply shouldn’t be. I’ll look into that presently, try to figure out what’s causing the bloated figure.

Apparently most of that memory is garbage generated by the TMX parser. Calling garbagecollect() after mte.loadMap() will zap it all. There are also futher optimizations I’ll be working on on my end to speed things up and hopefully keep garbage under control.

How large is your map, out of curiosity, and what device did you test to get those long load times? 

EDIT: By the way, I saw your email and I’m looking into the CastleDemo improvements you mentioned. I saw the original as well, but as work piled up it slipped to the bottom of the stack, so to speak.

I also noticed that the memory reported while running in the simulator as a JSON file is 6-8 MB where a TMX file is 45-50 MB.  That is a LOT of resources.

I’ve had a few people mention this to me! I’m definitely looking into alternative data formats for the TMX support at this point and will let you know when things are set to change.

The active memory in the simulator being 45-50MB… now that is news to me and simply shouldn’t be. I’ll look into that presently, try to figure out what’s causing the bloated figure.

Apparently most of that memory is garbage generated by the TMX parser. Calling garbagecollect() after mte.loadMap() will zap it all. There are also futher optimizations I’ll be working on on my end to speed things up and hopefully keep garbage under control.

How large is your map, out of curiosity, and what device did you test to get those long load times? 

EDIT: By the way, I saw your email and I’m looking into the CastleDemo improvements you mentioned. I saw the original as well, but as work piled up it slipped to the bottom of the stack, so to speak.