Administrator
Hey,
You might know that entity velocity is not networked in the game, this means that the netvar for velocity is just calculating it over the last 2 positions of the player.
Maybe you already spotted the issue, what if the velocity is off, while were using it for resolving, prediction or extrapolation? Tough shit.
Lucky for us we can do a very easy fix to increase the accuracy for lots of things when the player suddenly stops moving using layer 6.
This detects by the animation layer if the player is moving at all, if not then we set the velocity on the X and Y axis to 0 so we do not mispredict them.
You could go a step further and get the velocityXY from the animationcode by literally reversing the code.
More info:
You might know that entity velocity is not networked in the game, this means that the netvar for velocity is just calculating it over the last 2 positions of the player.
Maybe you already spotted the issue, what if the velocity is off, while were using it for resolving, prediction or extrapolation? Tough shit.
Lucky for us we can do a very easy fix to increase the accuracy for lots of things when the player suddenly stops moving using layer 6.
C++:
float feetcycle_playback_rate = data.player[entity->index()].networked_layers[6].playbackRate;
if (feetcycle_playback_rate == 0.f) {
entity->velocity().x = 0.f;
entity->velocity().y = 0.f;
}
This detects by the animation layer if the player is moving at all, if not then we set the velocity on the X and Y axis to 0 so we do not mispredict them.
You could go a step further and get the velocityXY from the animationcode by literally reversing the code.
More info:
You must be registered for see links