Driftwood2D / Driftwood

Driftwood 2D Tiling Game Engine and Development Suite
http://tileengine.org/
MIT License
24 stars 1 forks source link

Tileset image paths should be searched for relative to the Tilemap JSON path #126

Closed pmer closed 7 years ago

pmer commented 7 years ago

If I have a tilemap areas/my_map.json that loads a ../tiles/my_tiles.png, Tiled thinks it resolves to areas/../tiles/my_tiles.png but Driftwood thinks it resolves to ../tiles/my_tiles.png.

seisatsu commented 7 years ago

This is a problem with Tiled always saving paths relative to the current working directory though, if I'm not mistaken. I usually remedy this by working from the root directory of the world.

pmer commented 7 years ago

I remember doing that on Linux. :) Unfortunately it looks like Tiled on macOS doesn't support that. :(

seisatsu commented 7 years ago

Research if anyone else has had this issue.

pmer commented 7 years ago

Found a C# Tiled map loader with the same issue:

https://bitbucket.org/vinull/xtiled/issues/19/external-tileset-directories-are-relative

I also found one with Unity, but the issue was with how Unity packages its game assets in an odd way so it's only partially related to this. Ergo, not linking it.

pmer commented 7 years ago

Here is what I have tried:

In the first two cases, Tiled will start with its $PWD set to $HOME. In the third its $PWD will be set to the current directory I'm in. However, in all three, I experience the problem related in this issue.

pmer commented 7 years ago

This was changed in Tsunagari in 2014. https://github.com/pmer/TsunagariC/commit/bdf693f7

pmer commented 7 years ago

For those Linux users who prefer the command line, this change will mean you'll have to launch Tiled with (cd path/to; tiled map) instead of tiled path/to/map.

seisatsu commented 7 years ago

Why not both?

pmer commented 7 years ago

Oops, I think I misunderstood your first comment and forgot how Tiled works on Linux.

So nevermind—there is no difference between those two command inocations.