godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Frame Rate Based Animation Player #2794

Open 0stamina opened 3 years ago

0stamina commented 3 years ago

Describe the project you are working on

2D beat'em up

Describe the problem or limitation you are having in your project

Adding frame rate based animations is way too tedious and counter intuitive. When doing something like a fighting game, quick adjustment to how many frames an a still is held for is really important.

The way it works now is you have to change the snap settings in the animation player to fps, then manually input the fps you are animating in and the number of frames in the animation, for all the animations you do. And if you decide to change the fps you animate in, like going from animation on 1s(24fps) to animating on 2s(12), or vice versa you have to do that again, for every single animation you've done up to that point.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I think the easiest way would be to have the snap be the 1/(force_fps) by default for new animations, or to add a way to swap between a frame rate(integer) animation player and time(float) animation player

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I'm not super involved in godot development so I have no idea how it would be implemented.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I think the easiest way to work around this is to do the math yourself, figure out how many seconds an animation of a given frame length will be but that's not a perfect solution because adjustments to the games frame rate mean that you have to change every single animation, if you want things to happen on a specific frame.

Is there a reason why this should be core and not an add-on in the asset library?

A lot of fast paced action games are generally balanced using frames rather than time, which would require finding the add-on in the first place.

KoBeWi commented 3 years ago

And if you decide to change the fps you animate in, like going from animation on 1s(24fps) to animating on 2s(12), or vice versa you have to do that again, for every single animation you've done up to that point.

You can adjust FPS with playback_speed property. Going from 24 to 12 FPS is just changing it to 0.5, no?

0stamina commented 3 years ago

You can adjust FPS with playback_speed property. Going from 24 to 12 FPS is just changing it to 0.5, no?

yes and no, the animation would be played at 12 FPS but it would also be twice as long, the issue isn't the speed of the animation, it's that trying to choose what frame something changes through the animation player is tedious and doesn't handle minor changes very well