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

More PhysX Character Handling #997

Closed
wants to merge 20 commits into from
Closed

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Oct 5, 2021

More work to battle trouble points with the PhysX Character Handling. Specifically addressed:

  • It should no longer be possible to get stuck falling wedged between nearly parallel 90 degree colliders or against collisions of angles > 90 degrees (Relto Hut Lamps)
  • There should no longer be a visible toss-back effect when jumping into a wall.
  • Remaining toe-stubs should be less grabby than before (resolved problems on the Relto stairs, Kahlo Pub, Kadish X2 Vault stairs).
  • Increased the fall threshold back to 60 degrees to better match the previous behavior.
  • The avatar should no longer fall down the threshold of stairs.
  • The stair slow down effect should be imperceptible now (we do not go faster up the stairs, though, unlike MOULa/PX26)
  • Grazing walls should no longer kill the avatar's momentum, especially when ascending stairs.

If you run-jump into the point where the lamps inside the Relto hut meet
the wall, you get stuck falling against collisions that are >=90. This
corrects some errors in the sliding logic to allow the player to slide
down these colliders.
This prevents our forced position setting from (hopefully) triggering
penetration into other colliders. Also, force the downward leg of the
jump as well, which will generally prevent getting stuck on some (but
not all) colliders.
This suppresses contacts with characters who seem to be stuck falling in
place, which greatly improves the chance that the simulation will allow
them to fall to the ground. Also, remove the friction from any collision
that looks like a wall, which should reduce the liklihood of barely
side-swiping a wall completely tanking your forward velocity.
Match the old PhysX 2.6.4 value for better semantics.
Observed a number of toe stubs where the previous values were too tight.
Specifically, the Relto hut stairs and inside the Kahlo Pub.
A variation of this was used when making all the previous changes, I was
just too sorry to commit it.
So, apparently, the getting stuck problems were all because our force of
static friction was effectly equal and opposite the applied force of the
character's movement in some situations. We really don't want that when
running alongside walls, jumping onto objects, and sliding down cliffs.
But we do want friction to help us not run out of the world. Tough
balance!
@Hoikas Hoikas marked this pull request as draft October 17, 2021 19:44
Do we want to move? No friction. Do we want to stay put? Friction. This
works really well in limited testing.
Previously, there were noticable hitches when the step-up feature
engaged, especially on the Kadish X2 Vault stairs. This is because the
step-up functionality was engaging in a way that would only take effect
on the next render frame. This changes it to take effect on the current
render frame, resulting in a smoother result.
That weird z-component math really just had the effect of not allowing
gravity to stick us to the ground. So, it's removed and gravity has been
supercharged when we're on the ground to (hopefully) keep us there.
This should correct issues where the player bounces up and down slightly
in Chiso Prenvis and some tunnelling problems in Veelay.
The commit message was a lie. Overriding the current position like that
does nothing.
@Deledrius
Copy link
Member

Deledrius commented Oct 23, 2021

I tried running down the Great Stairs along the center carving, not the steps themselves. I found myself sliding down a chute at incredible speed...

(The same thing can happen on the stairs if you manage to catch air for even a moment)

The constant downward force on the avatar could cause a "bouncing" type
movement when running across a flat plane. This is undesirable, but we
do want to try to stick to stairs. So, I've retained the increased
gravity-on-ground, with another increase to compensate.
Yeah, I know I previously reduced it. But the reason that was done has
been fixed, and there are user reports of being able to get stuck behind
the crates in the Kadish Vault.
@Hoikas
Copy link
Member Author

Hoikas commented Oct 25, 2021

@Deledrius minor revision made for descending staircases with abysmal framerate.

If we're NOT on the ground, we want to enable infinite friction. Imagine
that you are on a crappy system and running across the threshold of a
staircase going down. The huge frame delta will result in your going
"airborne" - without the friction force, you will skid down the stairs
like it's made of ice!
Yeah, another tweak to the capsule size to prevent getting wedged into
tight spots. This should really match the size of the old PhysX 2.6 CCT.
@Hoikas
Copy link
Member Author

Hoikas commented Jun 16, 2022

Closing in favor of #1127.

@Hoikas Hoikas closed this Jun 16, 2022
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.

None yet

3 participants