ProjectBorealis / PBCharacterMovement

HL2-style, classic FPS movement for Unreal Engine implemented in C++
https://www.projectborealis.com/movement
MIT License
1.27k stars 163 forks source link

Configurable bBrakingFrameTolerated #37

Closed SolarysDev closed 1 year ago

SolarysDev commented 1 year ago

Reimplement bBrakingFrameTolerated's logic to be explicitly decoupled from framerate and configurable.

Under the proposed logic, when the player initially lands on the ground, DeltaTime is converted to milliseconds and added each frame to a timer that tracks how long they've been on the ground. When this timer reaches the configured braking window, braking can be applied and the timer is zeroed out until the player jumps and lands on the ground again.

The braking window is exposed in Blueprints and defaults to 16 milliseconds, or 1 frame at 60FPS.

mastercoms commented 1 year ago

Maybe make this 15ms instead

SolarysDev commented 1 year ago

Adjusted and added some qol stuff

mastercoms commented 1 year ago

Also what was the reasoning behind not adding fractional milliseconds to the accumulation?

SolarysDev commented 1 year ago

Honestly I forgot where I was going with that, fixed now

mastercoms commented 1 year ago

Thanks, it looks good but will be delayed in merging it until we test integration internally