Thursday, April 14, 2016

After break

I took some break from writing on this blog but I had busy last few months. In this time I done a lot of changes in engine one of biggest "finished" one are changes in file system. But this time I don't to talk about what I done but more about what will come and what I working on right now.

And I do some stuff with which I'm not feel most comfortable: Animation system. So I decided to seek some advice and explain what I do, why and how I would like to improve it. So be free to comment and critique.

I don't fell that system I have right now is what I really want to have.

This is this weird felling when you fell that system that you created is working but you fell that it's limiting you. Because of this felling recently more often I turn of computer and sit down with pen and notebook and think what I really want to do with this system. So far my conclusion is because I'm iterative develop White Rabbit Engine technology I didn't notice till now that what was I searching for was different thing from what I have now. 

What I have now is "decent" system for playing animation using blends trees. And what I was searching for are behavior trees. I already have some idea how to make this system part of existing code. This will require some changes because I want blend trees to be just input nodes for behaviors nodes. Everything so whole system was consistent on all levels.

New movement system
Right now there is simple system which apply on character: orientation from pad/keyboard relative to camera direction and then play walk/run animation. This work but don't look nice when you try to change direction.

Because of that currently I started experimenting with simple system which based on direction vector try to choose the animation which will allow to get root bone position to destiny point. How it will work I don't know this is more R&D. So far I'm still not convinced by result. I will also probably postpone this "task" to first do proper behavior tree which will allow me on easier experimenting.

I am doing animations so if it possible I want to optimize whole workflow as much as I can.

This is for more simpler problem than it may sound. Currently I can create "Animation Database" (AnimDB) resource which contain link to animations resource and blends trees inside. 

Sound good but it's not because I cannot reuse the same blend tree between different AnimDB. This was one of this problem I didn't thought so much when I was doing initial system and if I decide to do different animations for each race in Little Big Adventure: Remake it would require from me supporting multiple copies of the same tree which would be really inefficient. So I need to fix :)

Animations in White Rabbit Engine are used to locomotion of character.

Right now this happening by calculating root bone relative movement and applying this to kinematic physics in each frame. This works nice but you need to be really careful how you do animations because slight foot movement may result in sliding effects of foots.

What I would like to experiment with is possibility to lock one of bones in world space and retrieving root offset from this.This would look like we have animation with marked when left or right foot touch ground and when it do it I lock position of marked bone in world space (b.w.s.) and store local animation position (b.l.a.p) of it. Bone is locked as long as distance between stored (b.l.a.p) and current (b.l.a.p) won't be bigger then some delta. I would use this lock to apply corrections to root offset so even if foot slightly move in animation in engine it would still look good

Conclusion

As you can see I think about a lot of stuff and try to improve a lot of different issues. Right now we redoing assets for Little Big Adventure: Remake. Thanks to that we don't need to put extra effort into changing content. But once I will define whole workflow there will be only place for small improvement. 

There will be no second chance so it would be nice to do it right so I'm going back to my pen and notebook to figure out in my head how I want this whole stuff to work. When whole idea will be in my head coding should be the easiest part.

No comments:

Post a Comment