Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Map serialization broken since URL revamp #284

Closed
steffen-wilke opened this issue Jul 28, 2019 · 3 comments
Closed

Map serialization broken since URL revamp #284

steffen-wilke opened this issue Jul 28, 2019 · 3 comments
Assignees
Labels
bug MAJOR This label is intended to distinguish major features from all the others.
Milestone

Comments

@steffen-wilke
Copy link
Contributor

steffen-wilke commented Jul 28, 2019

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

@steffen-wilke steffen-wilke added bug MAJOR This label is intended to distinguish major features from all the others. labels Jul 28, 2019
@TheRamenChef
Copy link
Collaborator

It looks like the tileset is saved under a different partition than the map. Were you trying to export it to a different partition than the original tileset?

@steffen-wilke
Copy link
Contributor Author

Yes, I did. I was exporting it to the Desktop (C:\\...) and my repsitories are on the E:\\ partition as you can see from the example.
I'm not sure if the source property should even contain the absolute path. The original contains a relative path to the tileset (same directory as the map). After the import, the local paths of my machine are backed into the map which basically makes this information useless on any (other) machine with different paths.

@TheRamenChef
Copy link
Collaborator

I'm truly sorry it took me this long to return to this, but my commitment is a fickle thing.

While I should be responsible for this bug, I don't think I can fix this myself. I'm not familiar enough with UtiLITI. I think this could use a modification to the URLAdapter to handle resources in bundles.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug MAJOR This label is intended to distinguish major features from all the others.
Projects
None yet
Development

No branches or pull requests

2 participants