Using Tiled as map editor for Petscii Robots?

Hello,

I’ve written a small level editor for Petscii Robots by The 8-Bit Guy:

https://github.com/radi0sus/robots-mapedit/tree/main

While exploring features I could implement, I came across Tiled - which, surprisingly, I had never heard of before. It’s clearly far more powerful than my little script, so I started wondering if I could use Tiled as a map editor instead.

I’ve already written a script that converts Robots level files into Tiled’s TMX format (thanks to the great documentation of the TMX format):

https://github.com/radi0sus/robots-mapedit/blob/main/lvl2tiled.py

In my approach, the map tiles are included as tiles, and everything else - robots, player, hidden objects - is represented as Objects in Tiled. But I’m unsure if this is the best way. Would using additional tile layers be a better option?

The game has specific limits:

  • 28 robots
  • 16 doors/transporters
  • 16 hidden objects (like guns, bombs, keys, etc.)

Each object can have up to 5 properties. More details on the 8-Bit Guy website, Petscii Robots Map Editor (there is only a version for the Commodore PET).

I’m trying to figure out how to enforce those limits - for example, to prevent adding a 29th robot. Also, when a unit is deleted, it should remain in the file as a zeroed-out entry rather than being completely removed. Any suggestions on how to handle that?

I’d really appreciate your thoughts - especially on whether using Objects is the right approach, or if there’s a better alternative.

My next step would be to write another script that converts TMX files back into a Robots level.

Thank yo very much!
Sebastian

I finally made a script that converts maps from Tiled to a Robots level file: tiled2lvl.py. You need to start from an existing level, and the number of certain units must be kept constant. Under these conditions, it seems to work.

I’ve not used petscii but I run the tiled xml through an asset processor that converts it to binary and makes it fit any requirements I need for my engine. The asset processor runs every time I build so it’s invisible to my workflow.

Thanks for the insights. In principle, it’s the same procedure with the Python scripts for the level files, though it’s more of a manual process.