So I’m currently creating a library extension to the Slick2d library called TiledMapPlus. It aims to provide greater support to the people using Tiled, and faster access to data etc.
One of the aims of the library was to provide dynamic map editing, therefore the ability to write a new map to a stream.
I implemented this today and yesterday and now need your help. There is something wrong with my code.
So the basic problem is, the XML layer data is malformed, and cannot be read by the TiledMap parser/editor.
I have gone through numerous tutorials trying to compress the data into a GZIP compressed, BASE64 format. I have finally resorted to using this with the GZIP compress option.
However every time I compress the data etc. It always outputs larger than the Tiled2d editor does and it outputs corrupt data. Why is this?
Links to Files:
A Tiled Map automatically generated by the TiledMap editor
A Tiled Map generated from the above TiledMap, using my library
Thanks Liam I’ve actually been following every possible thing I can find that you’ve written and it was your code in TiledMapPlus that finally solved this for me.
Here is the solution that works correctly taken from Liam’s code:
I am using my same data generation techniques and passing in any id number I want and it is accepting and encoding it perfectly!