-
Notifications
You must be signed in to change notification settings - Fork 83
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
Turret behavior predictive aim bug #7965
Comments
Sorry, I don't know how to fix this. I didn't come up with the predictive aim maths myself, and I don't really know why it would produce weird results like that. It already reverts to basic aim if there is no solution and this project shows that happening, but it seems in extreme cases just before it gets to "no solution" it ends up with "wrong solution". If you can figure out the correct maths or checks to avoid this case perhaps it could be implemented, but otherwise I would say either use basic aim or design the project to avoid this happening. |
Hmmm that's too bad, I appreciate you looking into it anyways. |
I asked R0j0hound for help and he found a solution. Anyways, here is the example project |
R0j0hound made another version in which he added a 2nd solution he thinks is closer to the original formula of the Turret behavior. He says his 2nd version is very similar to the 3rd solution described in this article "Strategy # 3 - Assuming Zero Acceleration" https://www.gamedeveloper.com/programming/predictive-aim-mathematics-for-ai-targeting#close-modal |
Problem description
The predictive aim in the Turret behavior seems to have a bug.
msedge_2024-04-24_12-32-17.mp4
In the video (or running the project) it looks like there are 3 phases
My guess for the 3rd phase is that there is no actual solution at the speed of the bullets and player, so the equation just results in weird angles. I wish it would fail more gracefully, maybe reverting back to just pointing straight at the player without predictive aiming, but the 2nd phase is actually what really feels like a bug to me. Feels like it's off by 180°
( As a side note, I wish the aim angle would be available without the need to actually turn the object itself. Similar to how the Sine behavior has a "Value only" output option [ But I know that's not a bug ] )
Attach a .c3p
turret_auto_aim_bug_01.zip
Steps to reproduce
Observed result
The Turret Behavior is not able to predict the shot reliably, even if the player is moving at a constant speed and the turret rotation speed is high enough to be instantaneous.
Expected result
The Turret Behavior should predict shots more reliable and maybe fail more gracefully in case a shot is impossible.
More details
Affected browsers/platforms:
First affected release:
System details
View details
PASTE HERE
The text was updated successfully, but these errors were encountered: