Skip to content

Animation Game Piece Intake [AARD-1973] #1216

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

Merged
merged 12 commits into from
Jul 23, 2025

Conversation

ryanzhangofficial
Copy link
Member

@ryanzhangofficial ryanzhangofficial commented Jul 15, 2025

Task

Create a simple intake animation for gamepieces. Should be a simple sliding animation that moves the gamepiece from its original position to the position it will be held in till its ejected. 

Jira Ticket

Symptom

On intake, the gamepiece immediately snaps to the ejectable.

Solution

Lerp from the starting gamepiece position to the held position. Allow user to also configure the animation duration (to kind of simulate different intake motor speeds).

Verification

  • Gamepieces move from starting position to ejector at configured animation duration

Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

@ryanzhangofficial ryanzhangofficial self-assigned this Jul 15, 2025
@ryanzhangofficial ryanzhangofficial added ui/ux Relating to user interface, or in general, user experience gameplay Relating to the playability of Synthesis labels Jul 15, 2025
@ryanzhangofficial
Copy link
Member Author

Jolt is really confusing me. There seems to be only one face of the game piece where the intake animation works smoothly. Every other face of the cube results in the outward motion where the game piece rotates until the "correct" face is facing towards the ejector and moves back towards it.
https://github.com/user-attachments/assets/10532253-b3a8-44d6-91ba-991aeee6037c

@ryanzhangofficial ryanzhangofficial force-pushed the ryan/1973/animate-game-piece-intake branch from dfd844f to bc8a88e Compare July 17, 2025 23:43
@ryanzhangofficial
Copy link
Member Author

ryanzhangofficial commented Jul 21, 2025

Made logic fixes which involved some janky matrix operations (thanks Hunter!). The animation isn't perfect (see attached video), but the game piece now goes directly to the ejector rather than some weird movement. After discussion, we think the rotation part is something that just can't be fixed in the code.
https://github.com/user-attachments/assets/a56fd38d-c2c3-4327-808b-e96d8740b70b

@ryanzhangofficial ryanzhangofficial marked this pull request as ready for review July 21, 2025 19:56
@ryanzhangofficial ryanzhangofficial requested review from a team as code owners July 21, 2025 19:56
Copy link
Contributor

@azaleacolburn azaleacolburn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines -58 to -59
const y = x[1] instanceof ScoringZoneSceneObject
return y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was such a funny predicate body.

Copy link
Contributor

@ariesninjadev ariesninjadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little concerned that the lerp results in a squished/compressed game piece.

Is it possible the animation can use gradual acceleration and an instant stop to make it look a little more realistic?

Copy link
Member

@rutmanz rutmanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the rotation is a little funky but if not easily fixible, lgtm

@ryanzhangofficial
Copy link
Member Author

Little concerned that the lerp results in a squished/compressed game piece.

Is it possible the animation can use gradual acceleration and an instant stop to make it look a little more realistic?

The pieces appear to be squished/compressed because of the ejector position, so only half of the piece is underneath the field. The ideal solution for this ticket was for a "smooth sliding" animation, but I see what you mean by the gradual acceleration.

@ariesninjadev
Copy link
Contributor

The pieces appear to be squished/compressed because of the ejector position, so only half of the piece is underneath the field.

Ah got it. This is fine then

The ideal solution for this ticket was for a "smooth sliding" animation, but I see what you mean by the gradual acceleration.

Well what you've got is obviously smooth in transit, but not at start/stop. I advised the gradual acceleration to fix the start part, but I think it's too unrealistic for it to gradually decelerate, which is why I advised the snap stop (part has hit the end of the intake/feed-forward).

@ryanzhangofficial ryanzhangofficial force-pushed the ryan/1973/animate-game-piece-intake branch from 64065b6 to 088abf6 Compare July 22, 2025 15:47
@ryanzhangofficial
Copy link
Member Author

Well what you've got is obviously smooth in transit, but not at start/stop. I advised the gradual acceleration to fix the start part, but I think it's too unrealistic for it to gradually decelerate, which is why I advised the snap stop (part has hit the end of the intake/feed-forward).

Ah, got it. Thanks for the suggestion. I changed the position lerping to increase as a cubic, and snap at the end.

Copy link
Contributor

@ariesninjadev ariesninjadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@AlexD717 AlexD717 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever I pick up a game piece the robot starts to move backwards (I never pressed move back (s) in this video)

Screen.Recording.2025-07-22.at.10.02.29.AM.mov

If this is something that only happens on my device and isn't easy to fix, I think that it would be fine if you were to add an option in settings to enable/disable game piece animation, that way only people who it works for use it.

@ryanzhangofficial
Copy link
Member Author

Whenever I pick up a game piece the robot starts to move backwards (I never pressed move back (s) in this video)

Screen.Recording.2025-07-22.at.10.02.29.AM.mov
If this is something that only happens on my device and isn't easy to fix, I think that it would be fine if you were to add an option in settings to enable/disable game piece animation, that way only people who it works for use it.

Interesting, I was able to reproduce this error on my computer as well. The fix was using a quadratic for the alpha in lerpVectors rather than a cubic. The gradual acceleration is more subtle, but I think it serves its purpose.

Copy link
Member

@AlexD717 AlexD717 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@PepperLola PepperLola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@PepperLola PepperLola merged commit 769dcfa into dev Jul 23, 2025
16 checks passed
@PepperLola PepperLola deleted the ryan/1973/animate-game-piece-intake branch July 23, 2025 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gameplay Relating to the playability of Synthesis ui/ux Relating to user interface, or in general, user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants