2D Toolkit Forum

2D Toolkit => Support => Topic started by: test84 on March 29, 2014, 05:42:56 pm

Title: Question regarding dicing.
Post by: test84 on March 29, 2014, 05:42:56 pm
Hi,

First of all, thank you for this package.

I have a question regarding dicing. I have some very large spritesheets that I need to put in the game via tk2d and alot of those single sprites in that sprite sheet have a lot in common as each of them only is different slightly than the other one and wanted to know if it's possible for sprites to share same pool of diced sprites.

Let me rephrase it since it might not have been clear.

When I import a sprite sheet and make a collection out of it, I can change their render mesh to dice so the parts that are duplicated, would not take additional space and that's great. BUT is it possible for several sprites in same collection to share a pool of diced sprites so like 10 sprites that have a lot of texture in common would take less space?

Thanks man.

BTW, if you have any other suggestion on how to handle such sprite sheets in tk2d, I would be more than happy to hear it as I have to deal with 4 of these.
Title: Re: Question regarding dicing.
Post by: unikronsoftware on March 29, 2014, 06:05:32 pm
It won't be a good idea to dice small sprites in a sprite sheet like this - I'm guessing you are going to animate these, animating diced sprites is considerably more expensive than normal sprites and isn't recommended. tk2d already shares dicing between textures - if you dice a bunch of sprites, it will compare dices with everything else in the collection not just itself.
Title: Re: Question regarding dicing.
Post by: test84 on March 29, 2014, 06:17:56 pm
Hi,

Thanks. You are right, they will be animated. Sprite sheet's size is 1890x860 and contains 9 instances of 210x860. So you suggest to not even do dicing and leave everything on default?

Also from that 4 files, each 2 of them are very similar and share a lot, if that helps to suggest a better method.

BTW, I was reading this:
http://www.unikronsoftware.com/2dtoolkit/docs/latest/advanced/sprite_dicing.html
and the last part regarding advanced dicing seemed like what I asked here but could not figure it out, is it reverent to my question here?
Title: Re: Question regarding dicing.
Post by: unikronsoftware on March 29, 2014, 06:22:54 pm
No that part isn't relevant to your question. I wouldn't dice animated sprites as that path allocates memory at runtime. Feel free to try it if it you understand the implications :)
Title: Re: Question regarding dicing.
Post by: test84 on March 29, 2014, 06:24:54 pm
I think you are suggesting that it will generate a lot of garbage somewhere.

It's strange that when I go with dicing, I get 24% more wastage on my atlas, no matter what size I choose for dicing's x and y, it's always around 20 percent bigger in dice mode than default.
Title: Re: Question regarding dicing.
Post by: test84 on March 29, 2014, 06:27:53 pm
One quick question,

Is it better to store 2 1024x2048 or 1 2048x2048 on Android to get most compatibility around fragmented spectrum of devices?