2D Toolkit Forum

2D Toolkit => Releases => Topic started by: unikronsoftware on January 28, 2014, 04:50:04 pm

Title: 2D Toolkit 2.4 beta 1
Post 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



Bug fixes and improvements
Title: Re: 2D Toolkit 2.4 beta 1
Post by: Kurius on January 28, 2014, 05:54:52 pm
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
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 28, 2014, 05:56:50 pm
Nice! So, will the 2.4 final version include the memory leak patch you were offering by email?
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 28, 2014, 06:01:56 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 28, 2014, 06:02:09 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: DannyB on January 28, 2014, 06:02:52 pm
This is great! Going to test the scriptable atlases.
Had a quick look at the docs and the syntax looks crisp and clear.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 28, 2014, 06:03:57 pm
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
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 28, 2014, 06:06:52 pm
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 :)
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 28, 2014, 06:18:24 pm
Totally forgot about the new UI demo.
Just updated the change log.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 29, 2014, 10:37:04 am
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 29, 2014, 11:12:49 am
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?
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 29, 2014, 12:12:58 pm
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?
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 29, 2014, 12:15:07 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 29, 2014, 12:17:21 pm
We will most likely email you, we don't know anything about paletted textures, to tell the truth.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: DannyB on January 29, 2014, 12:19:16 pm
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 :)
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 29, 2014, 12:22:08 pm
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 :)
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 29, 2014, 12:51:26 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 29, 2014, 01:06:19 pm
I'll create a dedicated thread on the private forums then :)
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 29, 2014, 05:07:37 pm
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)
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 30, 2014, 11:39:02 am
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on January 30, 2014, 12:35:47 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on January 30, 2014, 04:04:47 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: Kea on February 03, 2014, 05:33:53 am
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on February 03, 2014, 10:51:47 am
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on February 03, 2014, 04:26:45 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: TekuStudios on February 03, 2014, 07:00:33 pm
Oh, I just found out that each section of the SpriteAnimation tab can be resized. I feel dumb.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on February 04, 2014, 09:16:12 am
Glad you've got it sorted ;)
Title: Re: 2D Toolkit 2.4 beta 1
Post by: David Kalina on February 10, 2014, 05:54:39 pm
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
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on February 10, 2014, 06:12:38 pm
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
Title: Re: 2D Toolkit 2.4 beta 1
Post by: DannyB on February 10, 2014, 06:21:30 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on February 10, 2014, 06:25:57 pm
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.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: DannyB on February 10, 2014, 06:40:16 pm
Understood, thanks.
Title: Re: 2D Toolkit 2.4 beta 1
Post by: DannyB on February 11, 2014, 03:37:57 pm
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?
Title: Re: 2D Toolkit 2.4 beta 1
Post by: unikronsoftware on February 11, 2014, 03:39:28 pm
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