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

bevy behaves weird with reference to a relative path for Tiled TMX tileset references #484

Closed
erayerdin opened this issue Oct 27, 2023 · 2 comments

Comments

@erayerdin
Copy link

Already pointed out here but let me elaborate.

Let's assume we collect our level files under assets/levels/level1.tmx and such.

tmx files refer to tilesets in their XML structure like so:

 <tileset firstgid="1" name="terrain_tileset" tilewidth="32" tileheight="32" margin="32" tilecount="216" columns="18">
  <image source="../kings_and_pigs/Sprites/14-TileSets/Terrain (32x32).png" width="608" height="416"/>
 </tileset>

Image source path is relative, but that does not work with bevy as expected:

2023-10-26T21:40:10.300148Z  WARN bevy_asset::asset_server: encountered an error while reading an asset: path not found: /home/erayerdin/Projects/Trash/bvplatform/assets/levels/levels/../kings_and_pigs/Sprites/14-TileSets/Terrain (32x32).png
2023-10-26T21:40:10.300199Z  WARN bevy_asset::asset_server: encountered an error while reading an asset: path not found: /home/erayerdin/Projects/Trash/bvplatform/assets/levels/levels/../kings_and_pigs/Sprites/11-Door/Idle.png
2023-10-26T21:40:10.300250Z  WARN bevy_asset::asset_server: encountered an error while reading an asset: path not found: /home/erayerdin/Projects/Trash/bvplatform/assets/levels/levels/../kings_and_pigs/Sprites/14-TileSets/Decorations (32x32).png

The path defined in TMX is ../kings_and_pigs/Sprites/14-TileSets/Terrain (32x32).png. On the other hand, it is resolved as levels/levels/../kings_and_pigs/Sprites/14-TileSets/Terrain (32x32).png. levels directory is added twice for some weird reason.

@mbrc12
Copy link

mbrc12 commented Dec 3, 2023

Since I ran into this recently as well, as pointed out by @divark, here is minimal example using their 0.12 fixes branch, but the issue should be the same with the 0.11 version of this library as well: https://github.com/mbrc12/minimal-example-for-tiled-issue.

As mentioned in my comment in #489 (comment), and then clarified by @divark subsequently, there is an issue with how the tiled crate parses paths now.

@StarArawn
Copy link
Owner

Wont fix. As long as tiled examples work that is enough its not meant to be a fully featured loader.

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

No branches or pull requests

3 participants