Skip to content

WIP: Add client-side prediction for knife hits#1905

Draft
Rainyan wants to merge 5 commits intoNeotokyoRebuild:masterfrom
Rainyan:feat/net-predict-knife
Draft

WIP: Add client-side prediction for knife hits#1905
Rainyan wants to merge 5 commits intoNeotokyoRebuild:masterfrom
Rainyan:feat/net-predict-knife

Conversation

@Rainyan
Copy link
Copy Markdown
Collaborator

@Rainyan Rainyan commented Mar 29, 2026

Description

WIP, not ready for review

  • Predict knife damage impact effects for better responsiveness for high latency players
  • Fix issues with backstab damage not working despite being within the backstab angle
  • Move backstab angle to a cvar, and convert from radians to degrees for more intuitive adjustment
  • Add a cvar for toggling whether the pitch component of the view angle is considered in backstab calculations

Examples

300 ms roundtrip latency (net fakelag 150;) without prediction (current state):

knife-impacts-unpredicted.mp4

Same but with prediction (this PR):

knife-impacts-predicted.mp4

Note how the blood impact effect is not delayed in the latter, and renders from the correct position. The sound of the video embeds seems to be bugged, but it shouldn't be desynced in either case in reality.

Toolchain

  • Windows MSVC VS2022

Linked Issues

Rainyan added 3 commits March 29, 2026 17:49
Add a new bot debug command for mirroring the mimic XY axes
Predict the knife hits client-side for a more responsive game feel at
high latencty.

Also changes the knife target angle from abs angles to eye angles,
because the eye angles are networked to clients. Since the playermodel
upper torso also twists according to the eye angle, it probably makes
more sense to use that for the backstab logic.
@Rainyan Rainyan force-pushed the feat/net-predict-knife branch from 1423b95 to 3130eac Compare March 29, 2026 18:12
Rainyan added 2 commits March 30, 2026 02:14
Add cvars for backstab angle (degrees instead of radians), and add a
cvar for toggling whether to ignore backstab pitch component for
adjusting the "stair stabbing" mechanic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Knife should be predicted

1 participant