Hello Guest

Author Topic: Is 2D toolkit the right tool for me?  (Read 10441 times)

kebrus

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 58
    • View Profile
Is 2D toolkit the right tool for me?
« on: October 21, 2012, 11:04:05 pm »
Hi everyone, sorry if i'm posting in the wrong section.

I have a very simple question, i want to know if 2D toolkit is the right tool for me. I've been trying the free tools like Othello framework and spritemanager 1 for the past few weeks and i've been having some difficulties in integrating them in the workflow pipeline an others regarding performance. I've been looking for the paid versions and i'm still not convinced so now i'm looking into 2D toolkit. but since i can't really try it for myself it's hard to tell if it does what i need.

I'm gonna say what i need and why and hopefully you might have a better answer for me

  • Camera Rotation - the game i'm working uses a isometric perspective (like diablo 2), there are a few stuff on the scene moving around (lets say characters and other objects) i need to be able to lay down all these objects in a plane since they interact with each other using unity physics, all i want i a way to rotate the camera to a plane other than the top down or side view and then move it in its local axis, i managed to make a few changes to spritemanager in order to achieve this but not yet in othello, do i get locked in axis view with 2D toolkit?
  • Sprite Sorting - since i have a few objects moving around they are constantly changing their depth position from each other and from the scene itself, i thought i could simply drop the objects around and let unity take care of it because of how it renders accordingly to the distance of the camera, but batching things together seems to ruin this. SM for instance lets me sort manually with a single sprite manager, but not with other sprites that belong to other sprite managers
  • Atlasing - i have multiple objects with multiple animations i need to save as much space as possible, does 2D Toolkit has some sort spritesheet generator or atlasing that trims the non used alphas but keeps the anchor of the sprite intact? this would save my team a lot of work because the animations are being rendered with extra empty space on all sides
  • Performance - i couldn't really tell how 2D toolkits works, does it reduces draw call and has automatic batching of some sort?

I think these are all the of the major problems i'm having for now, thx in advance for the answer.

Cheers

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Is 2D toolkit the right tool for me?
« Reply #1 on: October 21, 2012, 11:25:58 pm »
Hi,

1. Axis isn't locked, you're free to do what you want. Nothing imposed on cameras. You can use ortho or perspective cameras too.

2. You don't have explicit control over this, you will have to be clever with z depth. If you want multiple sort layers, you can use multiple cameras with different "depth" values and different layer masks to get this control.

3. Yup, it does all of that - one thing you didn't mention is that 2D Toolkit also rotates sprites to try to get best fit. 2D Toolkit also will generate multiple atlases from your textures (atlas spanning), but I strongly recommend NOT using this feature however tempting that may be if you have large numbers of sprites. It isn't as efficient as manually doing it yourself. Animations are free to span atlases, so no issue there.

4. It uses Unity dynamic batching, so you get whatever performance boost with that. Having said that, there's also a built in Static Sprite batcher, which lets you batch static sprites (backgrounds and such) in the editor.

Hope that answers your questions, Feel free to ask if you have any more.

kebrus

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 58
    • View Profile
Re: Is 2D toolkit the right tool for me?
« Reply #2 on: October 22, 2012, 12:12:14 am »
Thx for the quick answer
  • so the sprites aren't always facing the camera? do i need to rotate them manually to face the camera? its not a big deal, i'm asking just to know how it works
  • what do you mean by multiple sort layers? do i need to specify a group to auto sort the sprites?
  • That is pretty cool
  • thats something i have to consider because i can see it having about 30 to 50 types of different objects at any given time and i'm not sure how good of a job can unity dynamic batching do to reduce the draw calls

so if i understand correctly 2D toolkit uses simple quad polygons to render sprites similarly to what i could accomplish by importing a quad and scripting a spritesheet animator with the extra features of atlasing, workflow and all that jazz, i'm asking this bluntly because i need to understand if it functions similarly to spritemanager (generating the quads on the fly) or if it integrates with how unity functions, i've been burnt before with z-sorting stuff and i see it happening all over again with spritemanager, but if it functions within unity wont it render correctly using the depth buffer? this goes into my question number 2

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Is 2D toolkit the right tool for me?
« Reply #3 on: October 22, 2012, 12:21:12 am »
1. By default they face the Z axis. If you want them to face another axis, you will need to rotate them.
2. Generally sorting by z works fine, but if you need extra control, you can use multiple cameras with different depth values.
4. That really depends on how many atlases your objects are in. There is no way to do cross atlas batching - just won't work with the graphics hardware.

It creates quads and/or other geometry with a lot of tools to help do all the boring nasty stuff. If you want to use the depth buffer, your only option is to use alpha test (cutout) instead of blending. Then you get perfect sorting with no effort. If you can do this in your game, then this will just work. If you need blending, the sprites must be drawn back to front, and sorting (and batching) here will become very much more complex.
There isn't much of a way around that apart from writing a custom batcher, but you'll have to do the same work to position all your sprites at the correct z anyway.

I can go into a lot more depth about this when I next get a chance.

kebrus

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 58
    • View Profile
Re: Is 2D toolkit the right tool for me?
« Reply #4 on: October 22, 2012, 12:31:37 am »
Thanks for all the replies, tomorrow i'll be discussing this with the rest of the guys and if viable you'll get one more customer ^^

thx again and cheers