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

TMX resources cannot handle tile sets that leave a rest at end of rows #778

Open
jan-xyz opened this issue Aug 2, 2021 · 2 comments
Open

Comments

@jan-xyz
Copy link
Contributor

jan-xyz commented Aug 2, 2021

I build this map with Tiled and imported into the adventure demo and somehow it mixes up some of the assets. It looks fine in the editor. Do you have any advice, or could this be a bug?

In-Game render:
Screenshot 2021-08-02 at 02 13 07
Tiled Map Editor:
Screenshot 2021-08-02 at 02 13 20

Those are the assets I tried out: https://opengameart.org/content/whispers-of-avalon-grassland-tileset

@jan-xyz
Copy link
Contributor Author

jan-xyz commented Aug 2, 2021

I debugged this a bit on my side, and it seems to be related to the size of the image. The tiles are supposed to be 32x32 but the entire image is not divisible by 32 and it seems like the engine doesn't properly scale the tiles accordingly. Does that make sense? When I resize the image to a multiple of 32 then it looks better although the proportions are a bit skewed and there are gaps (e.g. left side of stairs).
Screenshot 2021-08-02 at 03 39 06

@jan-xyz
Copy link
Contributor Author

jan-xyz commented Aug 2, 2021

I was now able to get a workaround it by cropping the tile set. I looked closer at how Tiled handles it and they do the cropping automatically, should Engo do it as well? Attached are the view of the tileset in Tiled and the original PNG with a 32x32 grid on top of it(see how there are incomplete tiles on the bottom and right). I now cropped the image and that fixed it, but maybe we can improve the TMX handling here a bit and mimic how Tiled is doing it. If you point me in the direction then I can file a PR for it.
Screenshot 2021-08-02 at 13 14 23
Cliff_tileset_checked

In-game render with the cropped tileset:
Screenshot 2021-08-02 at 16 05 47

@jan-xyz jan-xyz changed the title TileMap resources render the wrong tiles TMX resources cannot handle tile sets that leave a rest at end of rows Aug 2, 2021
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

1 participant