How much of performance overhead does using the built-in animation tool have vs using an imported spritesheet?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By user41420082
:warning: Old Version Published before Godot 3 was released.

I’m trying to decide whether to commit using the built in animation tool for Godot vs importing a spritesheet generated from an external image editing tool. Which of the two would be better performance-wise specially when we’re talking lots of moving sprites like varying enemies (so naturally a lot of Scene files)? Would it be wise to do all of the animation on Godot?

What do you mean “built in animation tool”? Do you mean skeletal animation? If you have a sprite sheet you still have to animate it with AnimatedSprite or an AnimationPlayer.

rgrams | 2016-10-17 11:49

This is question worth exploring with experimentation. You’ll have to create some stress tests with some reasonable approximations of what you plan on using.

Creating animations inside the engine through the Animation Player can arbitrarily range from simple to insanely complex, depending on what you desire. You would also get other benefits tied to having it embedded in a scene structure.

Then your spritesheets can also have metrics involving their memory footprints and compression used, etc.

It’s something you’d be better off creating a reasonably accurate test for and measuring it. Rather than relying on a blind guess of someone on a forum. X)

As Zylann remarked, one is a trade off of memory for CPU cost, and the other is the opposite.

avencherus | 2016-10-17 15:32

It’s something you’d be better off creating a reasonably accurate test for and measuring it. Rather than relying on a blind guess of someone on a forum. X)

Yeah I realized that but I don’t have many time to spend on the project so I cannot make a bunch of similar animations both inside Godot and using external software at the same time. Zylann’s answer is very helpful though because it gives me an idea on the downsides of both methods.

user41420082 | 2016-10-19 03:03

:bust_in_silhouette: Reply From: Zylann

Comparing the import of a spritesheet and the way it is animated makes little sense.
However, maybe you mean “skeletal animation” vs “spritesheet animation”?

Skeletal consumes more CPU but less memory and involves less sprites. There is also work to be done to animate, either with Godot’s editor or an external tool like Blender COA or Spine.

Spritesheet consumes less CPU but more memory as you have to store every image of the animation, and it requires more sprites. Also, a smooth animation will require a lot more frames, unless you want a retro style.

Choosing either of these is up to you, depending on what you want it to look like, and how comfortable you feel with the techniques involved.

Thank you, this is the explanation I am looking for, the pros and cons to each approach

user41420082 | 2016-10-19 02:57