Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimationPlayer animations ignoring certain tracks, ending at the wrong time #69543

Closed
LakshayaG73 opened this issue Dec 3, 2022 · 24 comments
Closed

Comments

@LakshayaG73
Copy link

LakshayaG73 commented Dec 3, 2022

Godot version

EDIT: 4.0 dev

System information

Windows 11

Issue description

I just upgraded to latest and several of my working animations stopped working completely.

The function calls made towards the end stopped working. Animations stopped transitioning. Some started transitioning later than the length of the animation, which doesn't make sense.

It gave me quite the fright. I have come back to beta 6 and everything is back to normal.

So there were some changes that occured in the middle that could be the culprit.

Will upload MRP if the culprit is not identifiable.

Could just be an issue with existing animations with certain parameters, that were affected. Not all animations were.

Steps to reproduce

See issue description.

Minimal reproduction project

Will upload if needed.

@TokageItLab
Copy link
Member

TokageItLab commented Dec 4, 2022

Perhaps fix #69336 or #68993(#69240) affected your project, but I can't determine what is causing you the problem.

MRP must be required, and if possible, if you send some video of the problem explanation it is helpful in determining the problem.

@LakshayaG73
Copy link
Author

It is very difficult to provide an MRP here, as I cannot submit my working production frames.

Let me try. Else will try with a video first.

@LakshayaG73
Copy link
Author

LakshayaG73 commented Dec 5, 2022

Something interesting to mention is that I have faced the issue in #68992 without using animation tree. It depends on the animation length, and the number of floating points.

I had opened an issue but I believe it was closed as I didn't upload an MRP: #66631

@LakshayaG73
Copy link
Author

I believe the same issue is happening here, where the methods are not being called when they should be at the end of the animation It has somehow gotten more pronounced.

My game runs at 60 FPS, so if this is a frame pacing issue as mentioned by @Calinou, then it needs to be fixed on your end, as the eligible animation lengths shouldn't be dependent on the desired frame rate?

@TokageItLab
Copy link
Member

TokageItLab commented Dec 5, 2022

There are many cases where a bug cannot be investigated by video only. We do not want your resources, so please create an MRP with placeholder-like objects.

At any rate, your description lacks too much information. What type of track is being played, with what options and using what method? Also, if you open the .tres file in a text editor, is the animation key time value exactly the same or less than the animation length?

@LakshayaG73
Copy link
Author

Apologies if it wasn't clear.

As mentioned, these are all call method tracks with keys at the end of the animation

The length of the animation in the .tres file seems to be correct. It is 0.208333 in the .tres file, and 0.2083 in the editor.

@TokageItLab
Copy link
Member

What value is the key position in tres? Is it a method track?

@LakshayaG73
Copy link
Author

tracks/5/type = "method"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("PlayerStateMachine/Jump")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.208333),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"end"
}

@Calinou
Copy link
Member

Calinou commented Dec 5, 2022

Related to #69382.

@TokageItLab
Copy link
Member

TokageItLab commented Dec 5, 2022

Cannot be reproduced. I believe #68992 fixed it for this issue. There is an MRP by @eh-jogos that has a script that fires a method at the end of a 0.208333 long animation using AnimationPlayer as well, but it works properly.

(I think #69382 is another bug caused by StateMachine)

@LakshayaG73
Copy link
Author

LakshayaG73 commented Dec 5, 2022

resource_name = "jump_end"
length = 0.208333
step = 0.0416667

Are you certain? Perhaps with this step value? Running at 60 FPS? AnimationPlayer process mode is set to 'physics'.

I can say without a doubt that with absolutely no change in my code base, I see different behavior for this between beta 6 and 7. Not sure how this is not a regression to be honest...

Unless #68992 did not make it to beta 7?

@TokageItLab
Copy link
Member

TokageItLab commented Dec 5, 2022

Are you certain? Perhaps with this step value? Running at 60 FPS?

Yes

[sub_resource type="Animation" id="Animation_74h6m"]
resource_name = "method_at_5"
length = 0.208333
step = 0.0416667
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.208333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 0.85098, 0, 1)]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.208333),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"print_i_worked"
}]
}

And still there is no MRP by your case, so we cannot investigate. Possibly there is something strange about your environment, but if you are the only one who has that project, there is nothing we can do.

@LakshayaG73
Copy link
Author

I cannot repro it on an empty project on beta 7 either.

There is some other nuance here that is present in my project. Perhaps there are too many tracks above and they are doing too much work.

Will test and post.

@LakshayaG73
Copy link
Author

So, I can definitely repro this in latest master. I'm just checking to make sure whether this is true in beta 7 as well..

@LakshayaG73
Copy link
Author

LakshayaG73 commented Dec 5, 2022

So. I cannot repro this in beta 7.

It is only in master, due to some commit made after the beta 7 fork.

I have updated the issue version in the description. I incorrectly assumed that by picking master one day after the beta 7 fork, it would be the same thing :/ I will send an MRP that repros in latest master soon.

@LakshayaG73
Copy link
Author

LakshayaG73 commented Dec 5, 2022

I'm not sure what's happening, I'm not able to repro this on a fresh project, but certain animations of mine are still breaking in master.

For one of the breaking animations, I can see this when I try to call advance(0):
image

For another, I notice that the length is extending over and above the 1 frame the animation is supposed to be:
image

Hope this helps...

@LakshayaG73
Copy link
Author

@TokageItLab i'm unable to reproduce this on new animations. it only affects certain existing animations.

Does the above point help at all?

@TokageItLab
Copy link
Member

You cannot create a new MRP, which means that anyone cannot create a new MRP either. Thus, we cannot investigate the actual bug and can only say "Already fixed", at least for this issue.

There are project converters for 3.x and 4.0, but they are not yet complete. We were warned again and again to be careful about using them in real projects, especially since compatibility between Alpha and Beta is not guaranteed.

We really appreciate the feedback, but as long as we/you can't create MRP and we can't investigate bugs, we can't take care of them. Sorry.

@TokageItLab TokageItLab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2022
Repository owner moved this from To Assess to Done in 4.x Priority Issues Dec 6, 2022
@LakshayaG73
Copy link
Author

Please give me some more time to see if I can find a repro.

This behavior is a bit aggressive.

There are clear issues with some animation player change.

Please reopen this.

@Zireael07
Copy link
Contributor

If you say there are issues, then please provide a project demonstrating them. Otherwise the team has to assume it was already fixed if you can't replicate it on new animations

@LakshayaG73
Copy link
Author

I will provide a project.

@TokageItLab
Copy link
Member

TokageItLab commented Dec 6, 2022

We can reopen this or start a new issue if you upload MRP. Based on what little information you mention above, I'm guessing that the problem is probably related to loading some resource, not related with the animation process itself, but unless we can reproduce it, we never know.

@LakshayaG73
Copy link
Author

LakshayaG73 commented Dec 6, 2022

So I can confirm a few things now.

All my character animations are broken.

The issue is 'transitioning'.

Call method tracks in my animations are used to play a second animation, or a third, depending on circumstances.

All of these are broken.

The common link is changing animations using functions called from call method tracks. Please do something with this

So say the animation calls a function:

func test(): AnimationPlayer.play("test2")

The second animation is being assigned, which you can see in assigned_animation, but not playing.

If I queue animations using queue(), that works fine, but that doesn't always work for all my use cases.

Please help me. Else I don't know how to proceed on a project I've been doing full time for over a year.

@Zireael07
Copy link
Contributor

Open a separate issue and upload a MRP displaying the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants