Page 1 of 1

I want to animate mobs more dynamically

PostPosted: Sun May 22, 2016 14:56
by burli
I want to make better animation for mobs, for example turning the head independently from the body and make rotation smoother.

Currently mobs are static. They can move arms, legs or heads only on predefined animations by Blender. I want to be able for example to rotate a head from the script.

And I want to make animations smoother. Currently a mob did not rotate, he is just set to the new direction.

Is this possible with the current engine? And how does it work? If not, what has to be changed?

Re: I want to animate mobs more dynamically

PostPosted: Sun May 22, 2016 18:04
by burli
I have two ideas. I can use the same methods like the playeranim mod, but I think this will cause lags.

The other idea is to split body and head. The body can be animated with keyframes like now. The head can be attached to the body with set_attach()

Re: I want to animate mobs more dynamically

PostPosted: Mon May 23, 2016 18:29
by azekill_DIABLO
set_attach() does lag and bugs... will the head will be the player and the body follows??

the head might sometimes float in air...

but anyways, great idea!

Re: I want to animate mobs more dynamically

PostPosted: Mon May 23, 2016 18:43
by burli
No, body would be the player/mob. Body should play normal keyframe animations. Head should follow and yaw will set by script

Re: I want to animate mobs more dynamically

PostPosted: Tue May 24, 2016 09:25
by azekill_DIABLO
but that mean the head would turn instead of the body no?may be hard to do... but it's interesting ! i'm thinking to do a WoT subgame with tanks with turets turning...

Re: I want to animate mobs more dynamically

PostPosted: Tue May 24, 2016 09:44
by burli
azekill_DIABLO wrote:but that mean the head would turn instead of the body no?may be hard to do... but it's interesting ! i'm thinking to do a WoT subgame with tanks with turets turning...

No, the body is moved/rotated by the "AI". The positition of the head follows because he is attached. I don't know if the rotation is also applied automatically to the attached object. If not this will be done by the script.

To let the head look left/right and up/down I will add a vector to the current direction

Re: I want to animate mobs more dynamically

PostPosted: Wed May 25, 2016 18:19
by Calinou
Smooth rotation (interpolating entity/player rotations) needs to be done in the engine. It's been proposed for a while now.

Re: I want to animate mobs more dynamically

PostPosted: Wed May 25, 2016 18:37
by burli
I know, rotation in a script would be a bad hack. But minetest really needs better mobs, and smooth animations and a independent head are one step