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

Fix wrong physical speed and animations jitter in low fps issues ( Make them "frame rate independent" ). ( 2nd try ) #3648

Closed
wants to merge 24 commits into from

Conversation

gonnavis
Copy link
Contributor

@gonnavis gonnavis commented Aug 17, 2022

Describe your changes

Follow this reverted PR: #3422

  • Retain the same fixings and improvements of above PR.
  • Fix "no idle animations" regression.
  • Fix "jump/doubleJump state to fallLoop state hair jitter" regression.
  • Compatible with avatar-spriter.

To compatible with avatar-spriter, we can't depend on player and player.charaterPhysics.velocity ( wich already frame rate indepedent after this PR ).
So need calc avatar.velocity without player.charaterPhysics.velocity.
But I think we can't calc "smooth"/"frame rate independent" velocity from per frame movement/positionDiff.
So I added a isBoundPlayer arg to distinguish these two situations:
For normal mode, avatar.velocity copied from characterPhysics.velocity.
For spriter mode, avatar.velocity calced from fixed 60 fps positionDiff.
( The velocity for spriter can be calced, because of the codes in avatar-spriter are assumed always 60 fps. )

app/avatars/avatars.js

Lines 1511 to 1513 in 82fa161

if (!isBoundPlayer) {
this.velocity.copy(this.calcedVelocity);
}

What are the steps for a QA tester to test this pull request?

  • Test in low fps, if the movement speed the same as 60 or higher fps.
  • Tset in low fps, if the animations still jitter.
  • Test if there are idle animations.
  • Test if jump/doubleJump state to fallLoop state hair still jitter.
  • Test if avatar-spriter mode ( graphics low setting ) work well.

Issue ticket number and link

#3422 (comment)

Screenshots and/or video

Idle animations and hair no jitter:

huddle.20220815.mp4

Compatible with spriter:

velocity.frame.rate.-.spriter.mp4

Checklist before requesting a review

  • I have performed a self-review of my code
  • I am not adding any irrelevant code or assets
  • I am only including the changes needed to implement the change
  • I have playtested and intentionally tried to find error cases but couldn't

@gonnavis gonnavis requested review from avaer and lalalune August 18, 2022 02:04
@gonnavis gonnavis marked this pull request as ready for review August 18, 2022 02:05
@gonnavis
Copy link
Contributor Author

@gonnavis gonnavis closed this Aug 30, 2022
@gonnavis gonnavis reopened this Sep 15, 2022
@gonnavis gonnavis closed this Sep 15, 2022
@gonnavis gonnavis reopened this Sep 15, 2022
@gonnavis
Copy link
Contributor Author

rondoor encountered this issue on webaverse/app, so reopened it.

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

Successfully merging this pull request may close these issues.

3 participants