Export in deprecated "pure XML" format

I’ve been using Tiled for various projects for some time, mostly connected with game level editors. At the moment, I’m working on modding a game called Endless Legend (ENDLESS™ Legend on Steam). This game has the functionality to import maps created with Tiled - but because it’s not exactly a recent game, it uses the “pure XML” .tmx format that was deprecated back in version 0.15. I understand why this format was deprecated - as a data storage format, it holds no advantages and a lot of disadvantages compared to the xml-csv hybrid of the modern tmx format - but it seems there’s at least one game that’s still quite popular and insists on this old format for its maps.

I think I have the following options:

  1. Download Tiled 0.14 from Github specifically for working on Endless Legend maps. Works, but I lose out on a lot of new features, and I hate having two versions of the same software installed. Also, asking other people who want to edit maps to download software from 2015 feels bad.
  2. Write a Javascript plugin to enable exports in pure XML. A lot of effort, especially since I don’t actually know Javascript.
  3. Write a Python plugin to enable exports in pure XML. I actually know Python, but there’s still the obstacle that I can’t find a format specification for the pure XML format. Plus anyone else using the map editor will have to install Python. Plus it seems to be disliked in favour of JS plugins.
  4. Write a C++ extension to enable exports in pure XML. I don’t even really want to consider this one.
  5. Create a pure XML style .tmx file and load it into Tiled as a starting point. Tiled can perfectly happily export as pure XML when that’s what it starts from. This is incredibly hacky, but less effort than writing my own plugin. The problem is that because the format is deprecated, it could suddenly stop working in a future Tiled release.

Thoughts? Ideas? Ways to re-enable XML export without plugins?

I answered this on Discord, but just to have it here as well:

You can select “XML (deprecated)” as the Tile Layer Format in the Map Properties, and that will save the data as pure XML. The option isn’t available when creating new maps since it’s deprecated, but you can change the data format at any point after that, and Tiled will save the layer data in that format next time you save.

I wasn’t aware Endless Legend actually required the XML format. Since at this point it’s unlikely that this game is going to be updated to support CSV or compressed tile layer data, it might make sense to add the option back to the New Map dialog with a more visible warning.

On the other hand, if you’re creating a map for Endless Legend you’d likely not want to start with a new map, but rather open their template and save that under a new name.

Actually, the reason I’m here is that their template stopped working when the Inferno DLC came out, and I’m building a whole new template that can actually be imported, as part of the community modding efforts.

Pure XML doesn’t need to be un-deprecated - but I would like to make sure support isn’t removed entirely in future releases.

(The game also has an infuriating quirk where it expects blank tiles to be in the format <tile gid="0"/> rather than <tile/>, but that can be addressed with a simple find-and-replace. The Community Patch removed that requirement, but not everyone uses it.)

Not so nice that they ended up breaking it, but it’s great that you’re able to make a working template again!

Rest assured, the “pure XML” format will never entirely go away.

Ouch! In the past Tiled always wrote out empty tiles in the first format, but at some point it was optimized on request to just leave the empty gid element away. I thought it would be pretty harmless, but you’re not even the only one bitten by this change.

I really doubt anybody depends on that change, so maybe I should just revert it?