2D Toolkit Forum
2D Toolkit => Releases => Topic started by: unikronsoftware on January 28, 2014, 04:50:04 pm
-
Please read the migration guide before updating. 2D Toolkit 2.x is not API compatible with 1.x.
http://unikronsoftware.com/2dtoolkit/docs/2.3/migration_guide.html
Documentation available at:
http://unikronsoftware.com/2dtoolkit/docs/2.4
Be sure to run "Setup for JavaScript" after importing if you're using JavaScript/UnityScript or Boo.
What's new
- Custom / Advanced collider shape support. Docs here (http://unikronsoftware.com/2dtoolkit/docs/2.4/advanced/advanced_collider_shapes.html)
- Data driven sprite collections - preview feature. It is far from complete and probably will never have 100 percent parity with the GUI, but we will add most requested features quickly. Docs here (http://unikronsoftware.com/2dtoolkit/docs/2.4/advanced/data_driven.html)
- Sprite data unloader enabled by default - should stop / greatly reduce memory leak in editor with png textures
- New UI demo - dynamic list. Shows how a VERY large list of items can be implemented using 2D Toolkit UI. The demo easily handles 100K+ entries, can cope with more if data is streamed in dynamically.
Bug fixes and improvements
- tk2dCamera now works with split screen. Using normalized device coordinates to change viewport will maintain pixel perfection unless told otherwise.
- Separate X and Y tiling option for sprites
- Fixed sprite resizing with negative scales
- Added workaround for Unity bug in 2D mode where textures were reimported incorrectly (streaked alpha regions in demo scenes).
- Fixed png atlases in tilemap editor
- Fixed tk2dTileMap.GetTileFracAtPosition returning out of bounds values
- Fixed tk2dSpriteAnimator ping pong mode
-
Awesome!
Question...
Will these new advanced colliders and negative scaling, allow me to successfully flip a complex GameObject from a positive X scale to a negative X scale? Currently in Unity there is a bug that causes colliders AND joints to get mangled and resized erroneously when trying to flip on the X axis.
Thanks
-
Nice! So, will the 2.4 final version include the memory leak patch you were offering by email?
-
Awesome!
Question...
Will these new advanced colliders and negative scaling, allow me to successfully flip a complex GameObject from a positive X scale to a negative X scale? Currently in Unity there is a bug that causes colliders AND joints to get mangled and resized erroneously when trying to flip on the X axis.
Thanks
The advanced colliders don't actually create physics colliders at the moment. You can hook into the sprite changed event and manage the collider creation as needed if that will help.
-
Nice! So, will the 2.4 final version include the memory leak patch you were offering by email?
Yes, its turned on by default in 2.4.
Did that patch help in your case? You've probably got one of the heaviest tk2d games right now, so would be interesting to see if it helped.
-
This is great! Going to test the scriptable atlases.
Had a quick look at the docs and the syntax looks crisp and clear.
-
This is great! Going to test the scriptable atlases.
Had a quick look at the docs and the syntax looks crisp and clear.
Very little is wired up at the moment, but please feel free to create a thread requesting stuff to be in there, happy to add non obscure requested stuff before the final release
-
Nice! So, will the 2.4 final version include the memory leak patch you were offering by email?
Yes, its turned on by default in 2.4.
Did that patch help in your case? You've probably got one of the heaviest tk2d games right now, so would be interesting to see if it helped.
We were waiting for the next full stable version to be released before making some changes. We want to re-build our game from scratch due to some internal development adjustments, so we will keep you up to date as soon as it's released and we deal with such madness :)
-
Totally forgot about the new UI demo.
Just updated the change log.
-
Hey unikron, we finally made up our minds and updated to 2.4, and I'm afraid that I have bad news for you. Now, since a screenshot speaks a thousand words...
(http://imagizer.imageshack.us/v2/800x600q90/69/gofk.png)
Just after hitting Play. Happens with the executable as well once we reach that scene. As you can see, we have tens of sprite elements per scene (nearly 100 gameObjects on this scene only), and we need a lot of collections for several purposes (although we are planning on reducing their amount in the following weeks due to some rearrangement on our core game), and I'm afraid that the total size of the collections/atlases is huge.
If you need further insight or some sort of repro case, I'll help.
I'm adding the shot as an attachment so you can see it bigger.
-
The specific issue doesn't affect runtime at all - it was an editor only issue. If you're getting the error at runtime, its pretty much that you've properly run out of resources / memory. Unity uses more memory when loading a PNG atlas, as it has to decode it from memory and do the usual stuff it does, so it will be understandable if it crashed when using PNG at runtime but not normally.
I think you may have to change your strategy here. Have you considered making your textures paletted? You could save significant amount of memory (about a quarter) at the cost of some shader instructions + one or 4 dependent texture reads?
-
We are thinking on re-building the game again and designing each scene to have only 1-3 collections (way less PNG atlases, diced). Would that help with this?
-
Yes it will, but you could probably do much much better if you used paletted textures. Feel free to drop me an email if you'd like more details.
-
We will most likely email you, we don't know anything about paletted textures, to tell the truth.
-
We will most likely email you, we don't know anything about paletted textures, to tell the truth.
Hey, why mail... keep the discussion public, we are curious :)
-
We will most likely email you, we don't know anything about paletted textures, to tell the truth.
Hey, why mail... keep the discussion public, we are curious :)
You're right. We have already emailed unikron but I will post everything here (or in a dedicated thread if necessary). I also like to keep these things public :)
-
Just because its long and messy and I won't have time to proofread, and it more or less only applies only to them as they're the heaviest (ab)users of the system. No other reason. Happy for TekuStudios to post in private support forum if others will like to follow.
-
I'll create a dedicated thread on the private forums then :)
-
We will most likely email you, we don't know anything about paletted textures, to tell the truth.
Hey, why mail... keep the discussion public, we are curious :)
Here's the thread:
http://2dtoolkit.com/forum/index.php/topic,3539.0.html (http://2dtoolkit.com/forum/index.php/topic,3539.0.html)
-
We're rebuilding our game and we tried to make a very large collection (with multiple atlases) - not PGN, but Unity texture based. And after hitting commit the same memory leak fatal error raised. We are investigating it to seek a repro case for you.
Anyways, we are trying with smaller collections, just in case.
-
There is a limit on how many textures you can add to a collection. All the textures need to be loaded in memory when it builds the atlas. Its not a good idea to make a very large collection with multiple atlases especially with the kind of textures you've got. Unity textures take up a LOT of memory, so if your'er building the equivalent of 4-5 4096s at a time, it WILL run out of memory.
-
Yep, we saw that. Well, our biggest collection is now four 4096x4096 atlases, so I don't expect to face new errors from now on.
-
Get this error after update to 2.4b1 when working with sprite collections in editor.
NullReferenceException: Object reference not set to an instance of an object
tk2dEditorSpriteDataUnloader+TransientData.Purge () (at Assets/TK2DROOT/tk2d/Code/Sprites/tk2dEditorSpriteDataUnloader.cs:41)
tk2dEditorSpriteDataUnloader.EditorUpdate () (at Assets/TK2DROOT/tk2d/Code/Sprites/tk2dEditorSpriteDataUnloader.cs:134)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions ()
It generated many times, over 999+ errors.
-
You can turn off the unloader (tk2dEditorSpriteDataUnloader.cs first line), but can you email some details about how you're getting this to happen? Eg. what features you're using, unity version, etc? Need to get to the bottom of this.
-
This isn't a big, editor-breaking bug, but you may want to check it out:
(http://imageshack.com/a/img812/4781/d395.png)
No matter how much we resize the SpriteAnimation window, it doesn't show everything completely (see the right side of the pic). It still happens when we insert the tab in the main Editor window. We've tested this with different resolution settings (2560x1440, our main computer's screen resolution, and below 1080p) and the results were the same.
-
Oh, I just found out that each section of the SpriteAnimation tab can be resized. I feel dumb.
-
Glad you've got it sorted ;)
-
Just to verify:
Is the "experimental PNG atlas usage detection and unloader" feature the same in 2.3.3 final as it is in 2.4 beta?
I'm looking to do our (hopefully) final 2DToolkit upgrade before ship and would rather be on an official release than a beta, and I don't think 2.4 has anything else we absolutely need. (We absolutely need PNG atlases)
Thanks,
David
-
There are some newer fixes which aren't in 2.4 beta 1 and as a result works a lot better. Drop me an email at support and I'll give you the updated file
-
Hey - what is this PNG unloader exactly?
Do I need to take special care when using PNG atlases? I intend to use them almost exclusively.
-
Its something that works around how unity manages memory in the editor. Theres nothing to worry about or indeed care at runtime, this just affects how things are unloaded in the editor, as png atlases aren't assets - they simply linger forever (or until unity crashes). The unloader keeps track of things and unloads unused pngs.
-
Understood, thanks.
-
So, problem.
Using tk2d 2.3.3 I just noticed Unity started leaking memory every time I press play. So if I understand correctly, this PNG unloader is a part of 2.4 branch yes? So, I need to either avoid PNG atlases with 2.3.3 or use the 2.4 beta?
-
PNG unloader is disabled in 2.3.3, and theres a bug in 2.4 beta1, drop me an email and i'll sort you out with the update. One file to drop in, works both in 2.3 & 2.4