Seanba / Tiled2Unity

Export Tiled Map Editor (TMX) files into Unity
Other
495 stars 120 forks source link

Skia Library Exception #147

Closed BRokal closed 5 years ago

BRokal commented 6 years ago

Hello, I'm experiencing a problem with the latest version (1.0.13.2), in my Windows 7 64-bit system, the program Loads the map but throws an exception, the Output log ends as follows:

Loading summary Succeeded: 1 Parsed: C:\Users\KevinBerrocal\Desktop\Mis Varas\Unity\ProjectTS\Assets\Tiled2Unity\Mission1-1 Ver2.tmx Warnings: 2 Warning: Rectangle has zero width or height. Line 240

Disabling preview due to image library exceptions. You can still export. Errors: 1 Skia Library exception: Referencia a objeto no establecida como instancia de un objeto. Stack: en Tiled2Unity.TmxImage.FromXml(XElement elemImage, String prefix, String postfix)

On the Errors section the exception roughly translates to "Object reference not set to an instance of an object"

I tried to ignore the error and Export the map anyways, however, in Unity the map is clearly glitched

This is the map in Tiled image

And this is in Unity image

I already discarded that the problem is with Unity (so far the format of the texture worked until this problem) mainly because the tiles bend in the corners like so (Being clearly a error of Translating Tiled into Unity): image

This error also happens with every other maps i have made

Thanks for taking your time, Tiled2Unity is a fantastic software and I really, REALLY don´t want to drop Tiled just because of this small problem, thank you and keep the good work :)

peledkfir commented 6 years ago

Experiencing the same issue.. did you found any solution?

Seanba commented 6 years ago

The Skia exception can be a texture format that is not supported by the graphics library I'm using. If you send me the texture used for the tiles I can check it out.

I can see how does bent lines look like such an obvious error on Tiled2Unity's part but it's due to how tiles are drawn in Unity. Sadly, even the new Tilemaps that come with Unity 2017.2 have this.

These are known as seams and you can read a bit more about them in context of Tiled2Unity here: http://tiled2unity.readthedocs.io/en/latest/fixing-seams

FWIW, I am working on a newer version of Tiled2Unity that fixes seams for good through building a Texture Atlas. It will also build maps out of Unity's Tilemap instead of using meshes. I'm still in the early stages of this work, however.

CaptainBeardMan commented 5 years ago

When I encountered the SKia problem, it ended up being that I saved my tile asset file as a TIFF image format. 1) Saved my .TIFF as a PNG 2) Made a new tileset in Tiled based on the PNG 3) Remade the mapfile in TIled 4) Successfully imported into Tiled2Unity

Thank you Seanba for that last comment, it saved the day.

Seanba commented 5 years ago

FWIW, I have (finally) released the brand new version of Tiled2Unity (named SuperTiled2Unity) that, among other things, takes care of the seams problem automatically.