Support for ENIGMA's .egm format

Hi,

I want to know that, will it be feasible for Tiled to support Enigma’s .egm format in future, which will make it easier to import/export files from/to Enigma dev environment easier?

Is this something which you would like to add in your codebase?

GitHub - enigma-dev/enigma-dev: The Extensible Non-Interpreted Game Maker Augmentation.

Kind regards,
Kartik

A plugin that ships with Tiled isn’t likely, but if you’re interested, you could write a custom importer/exporter script in Tiled, which would achieve the exact same thing without having to be compiled and shipped with Tiled.

See the scripting docs for more info on custom map formats: tiled | Tiled Scripting API

As far as I know, custom map/tileset formats implemented using the JavaScript API have roughly the same limitations as the C++ plugins that ship with Tiled. This means that, regardless of whether one uses C++ or JavaScript, there will be challenges in dealing with packed textures, sprites, etc. Tiled currently requires that any images (and fonts, for Text Objects) be external and has no API to allow custom image parsing (e.g. to extract them from the EGM file as needed). This means that upon importing EGM, your script will probably need to completely unpack all the relevant assets from the EGM file so that Tiled can reference them. The exporter would need to pack the entire EGM. This means that your importer and exporter will also need to be aware of any irrelevant resources in the EGM too. Since EGM is apparently essentially a ZIP file, you may be able to accomplish all this with a ZIP library without needing to completely unpack those irrelevant resources.

Actually, images can be created by a map or tileset loader using the Image class, either from the raw data (fast) or by setting each pixel (slow).

However, with ENIGMA being written in C++, it might be easier to write this as a C++ Tiled plugin. I am not generally opposed to shipping it with Tiled, there are several other game or engine-specific C++ plugins shipping with Tiled after all. But the first question is, who’s going to work on it?

Hi @bjorn, this is actually a part of GSoC(Google Summer of Code) idea of Enigma to add support to Tiled tmx import/export in Enigma. However, another better option is to add egm import/export support in Tiled.
I’m interested in working and contributing in this project. I’ll discuss it with Enigma devs that whether it will be a part of GSoC project or just an open contribution, and will reply back.

1 Like

@kash Alright, that’s interesting. Actually Tiled also applied to GSoC this year, but sadly we did not get accepted. I would anyway be open to mentor you in case you’re going to write it as a Tiled plugin and the ENIGMA devs would be fine with that.

1 Like

Oh, I had no idea this worked!
Can the resulting Tiled maps be saved as TMX/TMJ?

In that case the image would probably get embedded as a base64-encoded PNG. If the idea is to convert some format to tsx/tmx files, you would likely want to use the Image class to save the image to a file and then just set the image file name on the tileset.

1 Like

Hi @bjorn, thanks for showing willingness to mentor without GSoC, I realize that’s the main goal of GSoC anyway. I’ll revert once Enigma-devs reach a conclusion regarding integration.