godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.82k stars 21.14k forks source link

Animation Library saves animations as binary .res instead of text .tres by default? #77243

Open rakkarage opened 1 year ago

rakkarage commented 1 year ago

Godot version

v4.0.2.stable.official [7a0977ce2]

System information

Windows 11, Core i5-12400F, RX 6600

Issue description

When click the disk icon and select "Save As" in Animation Library:

Steps to reproduce

n/a

Minimal reproduction project

n/a

AThousandShips commented 1 year ago

This was added along with the feature itself in #59980, not sure if intentional

smix8 commented 1 year ago

You do not want to have animations stored by default in a slow and bloated text format. Having binary as the default for animations protects beginner users from performance issues caused by the choice of file format.

Most new users do not know or understand the differences between text (e.g .tscn and .tres) and binary (.scn and .res) until it is already too late and they have a lot of performance issues with their assets stored in inefficient formats.

Especially in the case of skeletons with bones you are talking about thousands of transforms and small float numbers stored in an inefficient text file format that is very slow to load at runtime and consumes a lot of project disk space.

In my opinion even more resources should be changed to binary by default to protect beginners from making bad default choices.

rakkarage commented 1 year ago

all .tres are slow and bloated not just anim? idk my animations are small and simple 2d sprite animations never too late to convert idc

smix8 commented 1 year ago

If you have a small 2D animation it usually does not matter but the text format scales poorly with more complex and heavy files.

E.g. one of the major user complains with slow scene loading and saving is caused because they have embedded large resources like a TileSet or Mesh in that scene as raw text. If you have an AnimationPlayer with a lot of complex animations stored as text and not in dedicated binary files you face a lot of the same performance issues.

TokisanGames commented 1 year ago

I am storing over a hundred animations for my main player as text, organized into several animation libraries based on type (base walk/idle, armed versions, attacks, crouching, torch holding, etc) for our 3D adventure game. "text scales poorly... facing performance issues" has not been my experience.

We use tres so that if I change even one animation parameter, like a name or loop mode, I don't have to upload the whole binary file to git. Instead just the minor difference is uploaded. I have long recommended every resource in Godot be text for teams that use git, except textures, sounds, and anything Godot does not fully support in text (e.g. Meshes.)

Meshes work fine as text, but the core devs keep changing the format and breaking it without an upgrade path, requiring manual reimporting and extraction of all assets every time. I've been through it 3 times on hundreds of assets. So now I include glbs stripped of textures, and for npcs that will share animations, they are also stripped out of the glb and stored separately. Animations for say an animal I leave embedded in the glb.

To me, it doesn't matter if the default is res or tres, as long as I have the option, I know what I want. For a new person, either is fine as they both have their uses. Scenes are saved as text by default as are many other things.

AThousandShips commented 1 year ago

I've been through it 3 times on hundreds of assets.

Since 4.0 on the stable branches?

TokisanGames commented 1 year ago

No, stable was just released. I've been using Godot a long time. They started this process of breaking mesh formats w/o upgrade paths back in 3.x stable. And because they haven't yet committed to including an upgrade path, they can and will break it again on some future release.

AThousandShips commented 1 year ago

Unfortunately the very nature of binary formats is that they are susceptible to these kinds of compatibility breaking changes, and the main focus or guarantee is to prevent such (to the greatest possible degree, one cannot always account for bugs) in stable sequences of releases, providing upgrade paths is an important thing though

Are we talking breaking changes between 3.x versions? Or between 2.x, 3.x, and 4.x?

TokisanGames commented 1 year ago

I was talking about changes to the format of meshes stored in Godot's native text resource files. Nothing to do with binary formats. Anyway this has gotten off topic. The thread is about storing animations as res or tres by default, and I shared my experience that we have hundreds stored as tres just fine, with the added benefit of being git friendly.

AThousandShips commented 1 year ago

My bad we were talking about binary formats and the issues with them so I assumed you were talking about them