mapeditor / tiled

Flexible level editor
https://www.mapeditor.org/
Other
11.18k stars 1.76k forks source link

Missing Tile Layer Format Options When Making a New Map #2004

Closed AntumDeluge closed 6 years ago

AntumDeluge commented 6 years ago

System: Windows 10 64-bit Tiled: 1.1.6 64-bit (installed via MSI)

When creating a new map, the options for Tile layer format listed are CSV, Base64 (uncompressed), & Base64 (zlib compressed). But for existing maps there are two additional options: XML & Base64 (gzip compressed). Not sure if this is intentional, but why not list all supported formats in the New Map dialog?

New map: new_map-no_gzip

Existing map: existing_map-gzip

bjorn commented 6 years ago

The reason is that the "gzip" format is considered deprecated, since the "zlib" format is always better to use in this scenario. But for backwards compatibility, the "gzip" format is still supported.

As Mark Adler himself wrote:

The main difference between zlib and gzip wrapping is that the zlib wrapping is more compact, six bytes vs. a minimum of 18 bytes for gzip, and the integrity check, Adler-32, runs faster than the CRC-32 that gzip uses.

Similarly, the XML format is also deprecated since it is very inefficient. If you need human-readable data it is likely always preferable to choose CSV for the layer data instead of XML. But again, purely for compatibility reasons it is still supported.

Do you personally have a use for either the gzip or XML layer data formats?

AntumDeluge commented 6 years ago

The reason I ask is because the project that I am a part of uses maps with gzip compression. I'm not sure at this point if our software supports zlib compressed maps as all the ones I have looked at are gzip compressed. I suppose I will have to test it.

I was helping another member create a new map, & they were confused at my instructions because they couldn't find the "gzip" option. After messing around with it, I discovered that after the map is created it could be changed. So I just thought it was strange that gzip compression is supported but not listed when creating a new map.

It just seems a bit trivial to me to not list it in the new map options when it is supported. Not a big deal though.

Thank you for responding promptly. :)

bjorn commented 6 years ago

The reason I ask is because the project that I am a part of uses maps with gzip compression. I'm not sure at this point if our software supports zlib compressed maps as all the ones I have looked at are gzip compressed. I suppose I will have to test it.

Stendhal is such an old project, they started using the Java version of Tiled long before I rewrote it based on Qt. And Tiled Java never supported "zlib" compression, which is mostly because of an oversight since it's actually very easy to support.

I've added support for "zlib" compression to libtiled-java in commit 3371ebd4e31ea11d1e741099b2b8e53acd418978, and I expect any necessary change on your side to be similarly small.

I'll close this issue, since I would prefer not to bring those options back in the New Map dialog. Of course it would be trivial to have them, but the additional choices have been removed there because they do not add value, and would be only a source of confusion (like choosing between zlib or gzip) or frustration (like getting huge files that are slow to load with the seemingly sensible "XML" option).

bjorn commented 6 years ago

It's nice to hear Stendhal is still being worked on, btw! From 2004-2009 I worked on a similar project which was called The Mana World. It was the main driver for Tiled's development for quite a while. Right now I just don't have time for more projects, but I still hope to return to work on such a game again in the future.

AntumDeluge commented 6 years ago

Ah yes, I've played a little of the Man World. There is another fork of it called Evol Online. I might play those more if I weren't a part of the Stendhal team.