Skip to content

Map serialization broken since URL revamp #284

@steffen-wilke

Description

@steffen-wilke

The serialization of maps doesn't work properly anymore. Prior to the switch to URLs, it was possible to just save a map XML to a folder (e.g. utiLITI export) and save the external tileset next to it to have a functional map that is compatible with the Tiled editor.

Since we switched to URLs, we're not compatible to the default .tmx format anymore. And the external tilesets can't even be properly exported anymore.

Original:

<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" tiledversion="1.1.5" orientation="orthogonal" renderorder="right-down" width="44" height="47" tilewidth="16" tileheight="16" infinite="0" nextobjectid="0" nextlayerid="0" name="1_1">
...
<tileset firstgid="1" source="tiles-hospital.tsx"/>
...
</map>

After import/export:

<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" tiledversion="1.1.5" orientation="orthogonal" renderorder="right-down" width="44" height="47" tilewidth="16" tileheight="16" infinite="0" nextobjectid="0" nextlayerid="0" name="1_1">
...
<tileset firstgid="1" source="../../../../../E:/repositories/dr-lepus/tiles-hospital.tsx"/>
...
</map>

Right now, the engine will still find the tileset by name (alias) in these cases but the map is not usable after the export anymore.

We shouldn't introduce anything that makes our .tmx handling different from the default format. I don't see any benefit in this.

We can use URLs internally but we also need to make sure that we stay compatible to the default .tmx format.

This is somewhat related to #273

Metadata

Metadata

Assignees

Labels

MAJORThis label is intended to distinguish major features from all the others.bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions