saul / demofile-net

Blazing fast cross-platform demo parser library for Counter-Strike 2, written in C#.
MIT License
76 stars 7 forks source link

Player's pawn position is jittering #27

Closed in0finite closed 6 months ago

in0finite commented 6 months ago

Research

Description

Position of player's pawn is jittering (quickly snapping from one place to another). In only 1 tick, player is teleported to distant location, and then returned back. And this is not a round restart or death. This happens throughout entire match.

What is weird is that 2 of his position coordinates become a multiple of 1024.

The example shows position of pawn in 3 consecutive ticks. The result prints:

Position (tick 39984): Vector { X = -1102.1124, Y = -73.48895, Z = -167.96875 }
Position (tick 39985): Vector { X = -2048, Y = -1024, Z = -167.96875 }
Position (tick 39986): Vector { X = -1102.3584, Y = -71.92908, Z = -167.96875 }

2nd tick is the problematic one in this case, X and Y coordinates are multiple of 1024.

Example code uses navi-javelins-vs-9-pandas-fearless-m1-mirage.dem file.

Code to reproduce

var demo = new DemoParser();

demo.CreateTimer(new DemoTick(39984), () =>
{
    var player = demo.Players.Single(_ => _.PlayerName == "Angelka");
    Console.WriteLine($"Position (tick 39984): {player?.Pawn?.Origin}");
});
demo.CreateTimer(new DemoTick(39985), () =>
{
    var player = demo.Players.Single(_ => _.PlayerName == "Angelka");
    Console.WriteLine($"Position (tick 39985): {player?.Pawn?.Origin}");
});
demo.CreateTimer(new DemoTick(39986), () =>
{
    var player = demo.Players.Single(_ => _.PlayerName == "Angelka");
    Console.WriteLine($"Position (tick 39986): {player?.Pawn?.Origin}");
});

await demo.Start(File.OpenRead(path));

Affected demos

Every demo, but example works only with navi-javelins-vs-9-pandas-fearless-m1-mirage.dem

saul commented 6 months ago

Thanks for the report - I'll try find some time over Christmas to take a look at this.

saul commented 6 months ago

This will be fixed in v0.6.1, thanks again for reporting