Skip to content
New issue

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

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

Already on GitHub? Sign in 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
Milestone

Comments

@steffen-wilke
Copy link
Collaborator

@steffen-wilke 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

@TheRamenChef

This comment has been minimized.

Copy link
Collaborator

@TheRamenChef TheRamenChef commented Jul 29, 2019

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

This comment has been minimized.

Copy link
Collaborator Author

@steffen-wilke steffen-wilke commented Jul 29, 2019

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

This comment has been minimized.

Copy link
Collaborator

@TheRamenChef TheRamenChef commented Nov 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.