Hello Guest

Author Topic: Equivalent to SM2's Managed Sprites  (Read 5860 times)

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Equivalent to SM2's Managed Sprites
« on: May 10, 2013, 03:22:40 pm »
Hi there, truly sorry if this has been asked before, I couldn't find anything about it in the doc or on the forum, might not be looking for the right things.
I've been using SpriteManager2 for a while now and it works alright but I'm gonna try 2d toolkit cause I've heard good things about it and it seems cool right off the bat.

One feature I can't find in 2dtk is the equivalent to SM2's Managed sprites where you can have many sprites combined into one skinned mesh.  I made a tool that exports my flash timeline animations to unity and it will animate a bunch of sprites (exemple: a character with all its body parts), with a specified depth and that are combined into a flat skinned mesh so it's 3d but ends up flat like a billboard but it's still a bunch of separated, movable sprites.

Is there something similar? I've seen the static sprite batcher but that won't work as I still need to animate and move and scale the individual sprites.
You can see a tutorial of managed sprites that explain the feature well.
http://www.anbsoft.com/middleware/sm2/managed/index.html
I've used this many times and I hope there's something equivalent in 2dtk.

Thank you!


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Equivalent to SM2's Managed Sprites
« Reply #1 on: May 10, 2013, 04:25:30 pm »
No there isn't something like this in the released version, and mainly for the fact that performing operations on sprites like that kinda disguises how much it really costs - i.e. changing color on one will trigger a mesh rebuild, which is fine in itself, but similarly changing to a sprite in another collection will increase draw calls and require mesh splitting, etc.

I've never really thought of a way of making this foolproof, without shooting myself in the foot with support requests asking why something "so simple" slows their game down so much.

Having said that though, in 2D Toolkit 2, you will be able to add a lot more things into a static sprite batcher (text, sliced sprites, etc), and bones to move objects is in the pipeline. Also I do have a sample that takes a bunch of sprites and makes a skinned mesh out of them which you can have if you want, though you can't animate color on them.

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Equivalent to SM2's Managed Sprites
« Reply #2 on: May 10, 2013, 04:36:34 pm »
Yeah I'd love that sample.  Thank you.  Worst case is I'll keep using SM2 when I need this kind of feature.  it's only crucial when I need this type of 2d animated character in 3D, managed sprites are squished into a flat animated skinned mesh so that works well.  With an ortho cam though, I don't need them combined and 2dtk would work just as well with my flash-to-unity system.
I already bought 2dtk and intend to give it a shot for this fighting game I'm working on, so far I love how simple the workflow is going through the doc.
and thanks for the quick response!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Equivalent to SM2's Managed Sprites
« Reply #3 on: May 10, 2013, 04:52:59 pm »
One more question about this - what do you actually animate with something like this? pos-rot-scale-color? or do you swap sprites too?

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Equivalent to SM2's Managed Sprites
« Reply #4 on: May 10, 2013, 05:14:14 pm »
I animate the anchor point of the sprite (transform point), the position, rotation, scale, alpha and brightness.  Animated parts can be animated sprites as well yes, for instance there's a blood splat in the animation, so the blood splat is animated as part of the main animation and that object happens to be an animated sprite.

You can see how it's used here in my game
https://www.youtube.com/watch?v=dHjaDeWB908

All the animations are made in flash and transfered to unity with my system and SM2
« Last Edit: May 10, 2013, 05:19:05 pm by Evil-Dog »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Equivalent to SM2's Managed Sprites
« Reply #5 on: May 10, 2013, 05:59:13 pm »
With that specifically...
Why couldn't you do that with loose sprites positioned slightly in front of one another, set up as a hierarchy?

Updating loose sprites (meshes) is far more efficient than uploading a composite mesh like that.

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Equivalent to SM2's Managed Sprites
« Reply #6 on: May 10, 2013, 06:09:04 pm »
Cause loose is loose, doesn't look right when they're offseted even with a small offset.  Then you get Z-fighting when they're too close and you get back with the cam.
But like I said, that's only an issue with a 3d cam like that game, with an ortho cam you don't need the composite mesh at all.  My system offsets them based on the layer order in flash.
« Last Edit: May 10, 2013, 06:12:14 pm by Evil-Dog »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Equivalent to SM2's Managed Sprites
« Reply #7 on: May 10, 2013, 07:18:15 pm »
Fair enough. Didn't realise you used a perspective camera - I can see why you'd want something like this with a perspective cam.