Player Physics Deformation

From P2SR Wiki

Revision as of 06:04, 23 December 2022 by Jerry (talk | contribs)

Player Physics Deformation


Vphys hitbox.png Player with Qphys hitbox (orange) and rotated Vphys shadow hitbox (yellow)

Overview

Player Physics Deformation (PPD, also known as Physics Deformation of Object) is a physics engine glitch which allows to rotate or start spinning one of your Vphys shadow collision boxes, consequently partially separating player's Vphys collision from Qphys collision, allowing different unusual physics interactions like clipping through walls and boosting yourself and props in different directions.

Technical explanation

When two physics objects are penetrating each other, a physics solver will simply give a negative angular velocity around X axis to one object and positive angular velocity around X axis to another. The exact specifics of which one player becomes when penetration happens is unknown. General understanding is that when player goes into the object, the rotation is negative, and when an object goes into the player, the rotation is positive.

Execution

When player and physics objects are penetrating each other, the player's vphys shadow hitbox will get angular velocity. It is, however, immediately reset to 0, but it's still enough to affect roll rotation of the shadow hitbox.

There are multiple ways of starting and continuing penetration, some of which can give you angular velocity in either positive or negative direction:

  • Dropping a physics prop within a shadow hitbox - Gives positive angular velocity. In singleplayer, it can be done without prior rotation by walking against the wall, which pushes a shadow hitbox a little bit away from it. In co-op, another player can easily drop it within the hitbox thanks to viewmodel-based held object system. This is a base for a Cube Boost.
  • Causing your vphys shadow to teleport into a physics object (works with non-moving ones like prop_dynamic, func_brush, etc.) - Gives negative angular velocity. Occasionally you can cause vphys shadow to get stuck on a piece of a geometry, after which it will teleport to the player if it's 24 units away from them. If the shadow hitbox is already rotated, we can cause it to intersect a physics object once the teleportation happens by just standing right next to it.
  • Using portals - player can occasionally clip into a physics prop that's within a portal and vice-versa. This can give you both positive and negative angular velocity without prior rotation.
  • Clipping into a physics object or causing a physics object to spawn in player.

It also seems like different things can cause the collision box to reset its rotation. These things include:

  • changing your Vphys collision box (by crouching or uncrouching),
  • walking into/from a step,
  • walking through the portal,
  • reloading a save or transitioning to another level (as this resets physics simulation entirely).

Rotated PPD vs Spinning PPD

As previously described, the game resets the angular velocity as soon as we affect it. This can be avoided, causing the angular velocity to be not only stored but also built up. To achieved this effect, you have to disable the gravity of the collision box you want to spin, which can be done by getting Crouch Flying Glitch with the shadow box of your choice (and then optionally getting rid of it). That happens because funnel code disables and enables gravity for objects that enter and leave it, but can reenable it only when funnel counter is equal to 0, which allows us to keep the gravity flag of Vphys shadow box disabled even after getting rid of CFG[1].

Once gravity flag is reset, angular velocity gained from physics penetration will never reset and can be accumulated over time, allowing to reach absurd hitbox rotation speed. At this state, touching any physics object can lead to the player shooting around the room or even clipping through the walls.

This effect, unfortunately, cannot be stored through save-loading or different maps, since any of these actions cause the physics simulation to reset, causing the gravity flag for vphys collision box to be reset as well.

Usage

Example of PPD used in LP run by Krzyhau

Currently, PPD is used primarily in Least Portals for clipping through walls. Standing on a physics prop causes player's vphys shadow to take priority, in which case, if it's sufficiently deep into the wall, it tries to to get unstuck. If the wall is thin enough, it will move to the opposide side of it, and once it's unstuck, the game will try to teleport the player to it if enough space at its origin is available.

This technique is used in Bridge Intro 2 portals and Neurotoxin Sabotage 0 portals.

References

  1. For more informations, it is heavily suggested to read Crouch Flying Glitch page.