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
TileFlags are serialized wastefully #85
Comments
Hi there, @vvnurmi. I'm having difficulty reproducing this behavior. Is it possible that the TMX maps in your scene have had their connection to the TMX prefabs broken? In other words, I wonder if the maps in your scene are no longer prefab instances but instead are the fully-formed game objects? If you can send me your Unity Project (email: sean@seanba.com) it may help me track down what has happened. Thanks. |
Hi again, @vvnurmi. Now I am seeing of this behavior and it is related to prefab modifications but I'll have to dig down and try to figure out what is going on. My apologies I may not get to it for a couple of days. |
Potential fix for long-standing issue #5 using AssetImportContext to reduce wild number of prefab modifications on our collision geometry. (Switching generation type from Manual to Synchronous also was a contributing factor). Also, fix for issue #85 which was the main impetus of this bug as prefab modifications were being recorded in our scenes for every tile transformation. Bumped up to version 1.5.2
Hi again, @vvnurmi. Version 1.5.2 fixes this issue. It turns out that under some conditions Unity was saving out a ton of "prefab instance modifications" to scenes - even if the "modifications" were the same as the original value on a prefab. Luckily, changing the way a Tiled Map was saved to a scripted importer fixed the problem. In my case, my test scene went from 400kb to 11kb. I expect you will have similar gains. There is one caveat though: These modifications are now baked into your scene and have to be removed. Normally, you can do this through the However, there is currently a bug in most current Unity versions that is crashing if you try to do this. But, you can fix this by deleting the prefab instance in your scene and replacing it with a new one. If you happen to be on an alpha or beta build of Unity (which I don't recommend, honestly) then you may be okay with just reverting the modifications in your scene. Thanks. |
Someone recently pointed out this fix crashes projects using 2018.3 so I'm going to re-open this issue until I have the fix conditionally compiled out. Sadly, this means you'll have to be on Unity 2019.1 or later to get the benefit of the fix. |
This is "fixed" with version 1.5.4 of SuperTiled2Unity but unfortunately means users on Unity 2018.3 will not have these prefab override fixes. |
After upgrading from SuperTiled2Unity 1.4.6 to 1.5.1 our scene file grew in size from 241 kB to 7 MB. The extra space is used up by serialized TileFlag data that looks like this:
It seems to use five lines of YAML to store the flags for one tile of the tilemap. This not only looks incredibly wasteful but makes it quite difficult to try to understand what changes I'm committing to my scene files. Even with small changes of the tilemap, the diff of the scene file is full of these serialized zero flags.
This happens in version 1.5.0 but not in 1.4.6. I wish the serialization could be done in a much more compact format.
The text was updated successfully, but these errors were encountered: