Sunday, September 20, 2015

Animation System Changes: Part 1

After weeks of work (probably I could even say months) and hundred resolved tasks and bugs new animation system finally start working ;] Check final effect:


If you think that it is look no different from my old animations then you are almost right :D Currently this new system have even less functionality than old one. Because of that I needed to disable big part of gameplay.

Was it worth it ? 

Short version: I think that: YES. 

Long version:

New animation system is based on resource system which can be summarize quickly as:
Raw data (shader/material/model/texture/animation) is converted by resource system to binary data (Resource). System taking care of checking if there is need to update binary data, if dependencies changed, processing of raw data and few other stuff.
This is one of the system which still need some love but even without it its work nicely. Resources bringing first nice advantage to this animation system: Everything is unified

There is no weird code path for building animations, models and rig. This is important especially in so small development team as CoffeMonsters (1 person). The less code path I have, the more time I can spend on polishing them.

Next gain from this is that new code is a lot simpler than old one. I expected that because after all I have a lot more experience with animations right now. When I started writing my old system the engine was still single threaded. So right now I can say that comparing to new system the old multithreaded code seem right now a little bit like glued to single threaded system.

Anyway you can check yourself deploying and processing of new animation job:

* code:

Other good thing which was brought by changes is build in conversion for coordinates system: XZY -> XYZ. In old system exporter needed to take care of this. Right now this happening in process of building resources which simplified exporter and will save me tone of work when I will need to support some other editors than Blender. 

The last one but not the less important one are improvements that I needed to make to implement this system. There were tone of it. Some of them are easily visible on this Object Tools window:

Updated Object Tools Window

  1. Multiple instances of components (2x GOMesh containing different meshes)
  2. Sharing of rig between meshes (GOMeshes use the on GORig).
  3. Adding this is simple to user and allow on some really nice stuff like here where cloths use different GOMesh. Changing of them is just changing resource for it.
So what next ?
What I achieve right now is just some base framework. Its not finished and I don't see it as fully functional system because it miss i.e blending of animations, manipulations of animations layers, events support.

On other hand I see this as most important step because without it none of the other can exist. Right now my biggest goals are:
  • remove completely old system code,
  • bring back blending,
  • bring back animations events
  • management of animations layers
  • recover game. 
  • clean up Object Tools Window from unused stuff.
In the end even if some of this stuff may seem similar to stuff I had they will be on higher quality and you will see this in next post from Animation System Changes series.

Greg


No comments:

Post a Comment