Google Summer of Code 2022 - The ENIGMA Team

Week 8-9: Roadblocks, confusion and finally a conclusion

Contributor: Kartik Shrivastava
Project: Add Tiled compatibility to/from Enigma
Guided by: fundies

Highlights:
  1. Added libEGM as module in Tiled EGM importer PR #3435
  2. Planning for second phase



Details

Hitting a roadblock

The second phase had to start with the implementaion of EGM importer in Tiled project. So accordingly I started out linking the libEGM to a brand new Tiled plugin. This importer will be served as a plugin in Tiled. Lot of functionality required to read an EGM file is already present in Enigma's libEGM, so we decided to import libEGM in the Tiled plugin as a Qbs module (Qbs is used as a build system in Tiled).

But soon after I started working in EGM importer, I encountered a road block. It has to do with the way I've implemented the current TMX importer. Current TMX importer does not do a one-to-one conversion of Tiled resources to EGM proto fields and neither it preserves the identity of some Tiled resources (as in there are few many-to-one relations between TMX resources and EGM proto fields). This leads to a one way importer, which means that a user can not reproduce the same project and project structure on importing EGM file back in Tiled which was previously exported from Tiled and imported in RGM as TMX.

This is a huge problem because it defeats the purpose of simultaneously working on same project in both Tiled and RGM.


The confusion and the resolution

After initial discussion with mentor fundies, we decided to update the current Room.proto(which is equivalent of Tiled map in Enigma) to store the missing TMX properties but this updation is prone to breaking the existing functionality for existing Game Maker formats. So we arrived at an alternative a little later.

So here are the final steps we came up with to resolve this roadblock:

  1. Rename Room.proto to GMRoom.proto
  2. Add EGMRoom.proto, this will replicate Tiled TMX format
  3. Update TreeNode to hold EGMRoom.proto instead of Room.proto/GMRoom.proto
  4. Update Enigma's code wherever it depends on older Room.proto to now point to EGMRoom.proto
  5. Write a routine/function to translate GMRoom.proto to EGMRoom.proto. This is required as GMRoom.proto will still be used to load Game Maker formats, but to represent it in TreeNode heirarchy it has to be converted to newer EGMRoom.proto
  6. Add EGM importer in Tiled using the updated libEGM
  7. Test correctness of same project in both Tiled and RadialGM editors

So integration of EGM importer in Tiled started with a hiccup, but I hope to cover it up and get something useable in coming weeks and out of this project as a whole for fellow game designers. Thanks for reading!