PyxelEdit To Tiled Conversion Tool

PyxelEdit is a tool I’m using for tilesets and animations, and Tiled is a map editor I’m using for making some maps in The Enchanted Cave 2.  PyxelEdit’s great for working on the fly at creating new tilesets and maps at the same time, but normally to get the map in the game, I would have to rebuild the map in Tiled from an exported tilesheet.  I noticed that the both have an option to save and write maps as xml files, so I wrote a tool to convert the map data from the xml file PyxelEdit creates to the .tmx file that Tiled reads, and wanted to share it for any other devs that use both tools or were considering it:

You can download the .zip file here.

You can also download the source here if interested: (It uses HaxeFlixel)

Screenshot: 

Not too flashy, but it doesn’t have to be. 🙂

Instructions are all there in the program, and the .tmx file is saved to the same folder as the .exe.  The name of the output .tmx is automatically set to the same name as the xml file when you select that, but you can name it anything you want.

PyxelEdit doesn’t have the capability to have a different tileset for each layer like Tiled, so if you’re like me and have a separate layer in Tiled for hit detection or objects, you may have to re-do those each time… However a relatively easy workaround for this if the number of tiles in your tileset hasn’t changed since last time is to open your old .tmx file in Notepad++ or whatever (it’s just xml) and manually copy and paste your objects and hit collision layers over to the .tmx the conversion tool spits out.

If the number of tiles in your tileset has changed it’s a bit tricker to copy and paste the layers you need because tiled’s “firstgid” properties on the tilesets will be off.  What you can do is manually adjust these by the difference in number of tiles from last time, and you should be good.

Finally, Tiled’s default format is to compress the data with zlib compression, so if your game uses those files and decompresses them in-game, you’ll just need to open the created .tmx, and set the “Layer Format” under Map -> Map Properties to the zlib compression because it will be set to XML.

I hope this helps some people!

7 thoughts on “PyxelEdit To Tiled Conversion Tool

      1. Hello again!, have you abandoned this tool ?, I think you need a small update, it seems that there is a small error with the transformations.

  1. Hi there!

    I found your tool when searching for a good way to convert Pyxel Edit .xml files to .tmx, but when I try to open the program I get this error:

    “Could not load module systools@systools_init_0”

    Any idea what could be causing it?

    Thanks!

    1. Looks like I wasn’t including a “systools.ndll” file in the build so it wasn’t working if you didn’t have that haxe library installed.

      Just uploaded a new version if you’d like to re-download and try again!

Leave a Reply

Your email address will not be published.