let me ask this in a better way,
In MonkeyTrap example animation system, we have the idea of interpolators and tasks, tasks can be paused/stopped or we can have unknown duration for continuous tasks. (for examples mobility animations like idle/walk)
seeing how stock tasks in MonkeyTrap have similarity to stock tweens we have in JME3.3
So how are the task and tween different???
Can we think of the task in MonkeyTrap example as a tween in the new animation system? Or tween is actually just an interpolator?
If tween is just an interpolator, then should the idea of tasks be added to the new animation system in JME 3.3 thus that the AnimComposer actually become a TaskComposer which runs tasks instead of raw tweens?
MonkeyTrap is kind of an ancient take on ideas that would evolve into something better that become Lemur’s animation system.
Remy based his JME animation refactoring on Lemur’s animation system but as I recall, it’s not a 1:1 mapping.
Lemur has the idea of Tweens and Animations. A Tween is something that will perform some kind of tweening between 0 and length. It can run forward/backward between 0 and length.
An Animation is responsible for making a Tween “go” based on timely updates. (public boolean animate( double tpf ) So an Animation would be the thing that loops. Pausing an animation is just not updating it anymore. Continue to update it and it will continue to go where it left off.
I don’t remember how/if these concepts were translated exactly into JME’s animation system. But I do know that animations loop (and tweens don’t or at least they shouldn’t) and if you were to stop updating then things wouldn’t move anymore.
Say you have a complicate chained tween which somewhere in the tween execution it attaches a spatial to rootNode and will remove it sometimes later in tween execution it can be at the end of tween for example, and suddenly the current tween is switched with another tween while it is running and we do not have a way to tell it to stop so the child tweens can do their cleanups when tween stoped. But using the Task mechanism you added in MonkeyTrap we can do such kind cleanup while pausing or stopping the task.
No, it’s all controlled from AI system in server. MobAnimationState in client listens to CharacterAction’s send from server. and there is possibility of an action to be failed or interrupted in AI thus it will reflected on the client an will stop or switch currently executing animation on the client.
Hmm…, I guess the problem is that the AnimComposer in the new animation system directly tries to make a Tween to “go” and does not use any means of external thing like ‘Animation’ or ‘Task’.
Both ‘Animation’ (in Lemur) and ‘Task’ (in MonkeyTrap) can wrap tween/interpolator and they expose a method for canceling, which could be overridden by the user to do whatever he wants when it is stopped.
Actually, the new animation system uses an ‘Action’ class to wrap other tweens but ‘Action’ itself is a tween and could not be thought of like an Animation or Task I guess?