how to decode the map data build with tiled map editor

  ... discussions about development with the GLES1 branch of AndEngine.

how to decode the map data build with tiled map editor

Postby eclipse2011 » Mon Nov 14, 2011 6:32 pm

how to decode the map data:

<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="100" height="100" tilewidth="32" tileheight="32">
<tileset firstgid="1" name="fire" tilewidth="32" tileheight="32">
<image source="fire.png" width="256" height="256"/>
</tileset>
<layer name="llllll" width="100" height="100">
<data encoding="base64" compression="zlib">
eJztzgENAAAIA6C3sX9DY3w6SEACAAAAXDLtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8twM2ACg=
</data>
</layer>
</map>


eidt width tiled
the data is:
eJztzgENAAAIA6C3sX9DY3w6SEACAAAAXDLtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8twM2ACg=

how to conver to 2d array ?

thank you! 谢谢. :D
eclipse2011
 
Posts: 1
Joined: Mon Nov 14, 2011 6:28 pm

Re: how to decode the map data build with tiled map editor

Postby kblood » Wed Nov 16, 2011 11:43 pm

Here is a bit of information about the TMX format:
https://github.com/bjorn/tiled/wiki/TMX-Map-Format

And this one might be better on the decoding part:
http://sourceforge.net/apps/mediawiki/t ... map_format

But you will probably learn the most from the AndEngine source:
http://code.google.com/p/andengine/sour ... iled%2Ftmx

I think this might be one of the specific files used to do it:
http://code.google.com/p/andengine/sour ... edMap.java

But it used these:
import org.anddev.andengine.util.SAXUtils;
import org.xml.sax.Attributes;

But those files seems to give some idea about how they are decoding the TMX, except its hard to see exactly how it is done. Because it just gets the data from these SAX utility parsers I guess. And I am not even sure it is something that can be used to make a isometric TMX map loader, which I hope you might be working on. But a good start would certainly be finding a way to decode the data and figure out how to read it. Even when the data is read it is just a bunch of numbers and it probably wont be easy to figure out which numbers goes where, but the first two links should help with that quite a bit hopefully.
kblood
 
Posts: 333
Joined: Wed May 25, 2011 10:13 pm

Re: how to decode the map data build with tiled map editor

Postby patricia » Sat Mar 31, 2012 7:06 am

Hey there..!! I have been following your post since last six months and I must say I found so many information from here..!! Thank you for sharing this with us..!!
patricia
 
Posts: 1
Joined: Sat Mar 31, 2012 6:51 am
Location: Australia


Return to GLES1

Who is online

Users browsing this forum: Exabot [Bot] and 14 guests