Hello Guest

Author Topic: Best way to manage layered animations from spritesheet to prefab.  (Read 3446 times)

grofit

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
So currently I am toying with some ideas, and I basically want to have the notion of equipment on the character, now currently I have the following workflow:

Quote
- Create body spritesheets with animations
   - human_male_idle_1.png
   - human_male_walking_right.png
   - orc_female_idle_2.png
   - etc

- Create Helmet spritesheets with animation
   - human_male_leather_helmet_idle_1.png
   - orc_female_leather_helmet_idle_2.png
   - etc

- Continue for other armour pieces for each body type

- Import all bodies into one sprite collection

- Import all equipment into another sprite colleciton

- Create animation for each object matching animation names with body
   - human_male_animations
   - human_male_leather_helmet_animations
   - orc_female_leather_chest_animations

- Create body prefab for race/gender

- Add child entities on prefab for helmet, chest, pants

- When body type animates, it ripples same animation command down to children (i.e everything will play idle_1 animation)

So that then would define the base naked bodies without any armour (they would have loincloths or something), then as you can equip helmets, pants and chest pieces I would then need to make armour animation spritesheets to overlay on top of the given person.

So as far as the player can tell it just looks like 1 person, but its actually a body with overlayed sprites which all have the same animations, so when the player is idling, the body and all child items beneath are idling too, so all animations should match.

Now it works, but it feels a little heavy handed and I am sure this is a common sort of use case, so was wondering if there was a better way to handle these sorts of use cases, as currently EVERYTHING has to have same animation names (idle, idle_1, walking_right, walking_left, running_right etc) but that means that everything has to be its own animation file so the names dont conflict.

Here is an example of what I mean by layering, although this would just be body, entire armour, right hand item, left hand item.


http://gyazo.com/b2d771f3a4f98822902bcf010430784b

So anyone else done anything similar or any recommendations on how to best use tk2ds functionality to simplify stuff here?
« Last Edit: February 12, 2015, 10:19:36 am by grofit »

invicticide

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Kickbomb Entertainment
Re: Best way to manage layered animations from spritesheet to prefab.
« Reply #1 on: February 12, 2015, 11:36:22 pm »
I think you should look into Spine, which is a 2D skeletal animation solution designed to solve exactly the problem you're describing. Spine has a Unity/2D Toolkit integration, too, so you can still use 2D Toolkit to manage your sprite collections and sort order and all that.

grofit

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Best way to manage layered animations from spritesheet to prefab.
« Reply #2 on: February 13, 2015, 08:34:05 am »
Hey,

Thanks for the answer. I have looked at spine and other alternatives, I just dont like the animation styles you end up with. Don't get me wrong it is GREAT for vector based art and more higher res stuff but I have yet to see any good pixel style animations with it, although maybe that is just down to the target audience who uses it.

Even if I were to use spine though that would still not improve the layering aspect, as my question is 2 things basically:

1) Am I going about generating the animations in tk2d correctly?
2) Is there a better way to have layered animations and trigger them all from a parent?

Now the spine bit may improve some of the animation concerns, however the layering is still a question I am interested in, and there may not be a better way to do it, but I would rather ask the question just incase there is some wisdom out there on the subject.