Animation component & resource

#1

Issue on GitHub

For me, cutout animation is a must in an engine : it doesn’t require a lot of power, and save a good amount of memory, that’s why Spine models are efficient and compact. But Spine models requires a software, which are often non-free.

That’s why I wanna discuss about adding a custom animation resource & component in Defold, to be able to make custom animations. Plus, they might be used in other ways (non visual applications), for example, controlling the gravity of a player while jumping to have more control over the jump curve (more hang up time, faster fall, …). This can be done very easily with a curve/animation.

3 Likes

#2

Thank you for your feature request. This is definitely one of the things we’d like to see implemented in Defold, but it’s a pretty big feature and we have so far prioritised other things. I hope we will be able to start planning this feature later this year.

1 Like

#3

I find myself very limited with the go.animate() that is the recommended method for animating game objects, and when the amount of game objects is very high the the performance lost is considerable when comparing go.animate() and using direclty go.set() on every update. That can be seen on the Bunny-mark project. example.

A full animation tool like the one on Godot, that mix several properties on a single timeline is a big task, but to get there (if the feature is assigned some day) I guess you’ll need first to “link” a curve editor to an individual float property. And this is what I wish and dream to have sooner for Defold.

Explaining Ideally is:

  • Using the current Curve Editor that we always have there next to the Console.
  • Allow saving a Curve as a file asset or component.
  • Use new function similar to go.animate that instead of an easing curve it takes a Curve component ID.

After developing a few prototypes with Unreal Engine where have curves and Timelines I feel to much slower looking on the Defold Docs every time I need to remember what does every easing curve name. And some times the exact curve don’t work for me. Having a curve editor I quickly design the curve that I have in mind, the best custom curve for my case and can reuse it later if needed.

Another issue is that (maybe because I was no familiar with easing), Is that they don’t work at all if the ending value is the same that the starting value. In that case I need to make two go.animate calls in sequence.

1 Like

#4

Interesting ideas! We actually already support completely custom easing functions/curves but we have no editor tool to create them:

0 Likes

#5

Yes, it’s great we have custom easing functions and today finally I realize that I didn’t understand how easing actually works:

Sniffing in the engine source:

t = dmEasing::GetValue(anim.m_Easing, t);
float v = anim.m_From + (anim.m_To - anim.m_From) * t;

Easing acts on the timing not in the values! :man_facepalming:
That’s what I cannot get any movement when the From and To values are the same.

float v = anim.m_From + 0 * t;

In order to get funcionality similar to UE4|Godot curves we’d need simply the curve as function to plot the values in time:

v = Curve_func( t )

That way I can design a curve from t=0 to t=1 where I know exactly what value will be set to the property at any time.

This could lead also to implementation of “Follow a Path”, where you provide the curves or polylines for the 3 components (x,y,z) of a vector.

1 Like

#6

@britzl Also for me custom easing curves are very interesting. But, if I am not wrong, there is still an issue about using them. See here: Lua.Refs keeps growing (DEF-3841)

Of course a curve resource via the curve editor is incredibly useful in my opinion.

Ciao!

2 Likes

#7

@piXelicidio It is exactly what easing is, a (in general) non-linear interpolation of time NOT of values.

3 Likes

#8

I thought that had been solved. I’ll look into it

0 Likes