Repository navigation
Conversation
Could you upload the de_ancient demo please? |
|
Sure, here is the de_ancient demo: https://1drv.ms/u/c/71c97375cf3e6071/IQCzEw5EWPvVQoXmFDbIi4RKAQpSdn1AvYaS6d87KwjfRNw?e=4w9bUk File: If the link does not work or you would prefer another host, please let me know and I can re-upload it somewhere else. |
|
I think the root issue is that the parser doesn't update the player's userID (slot minus 1). |
|
Confirmed, this works on my end too. I tested it with the Ancient demo and Thanks for looking into it in demoinfocs, that seems like the right place to fix it. |
|
The fix is also available on the master branch markus-wa/demoinfocs-golang#659, and the demo analyzer v1.10.2 includes it. |

Problem
CS2 player slots exported by the analyzer can be incorrect when relying on
common.Player.UserID & 0xff.I hit this with a Valve CS2 Ancient demo where two players were exported with the same
userId/ slot:HaO...:userId = 0, slot1real:userId = 0, slot110was missing entirelyThis caused downstream tools such as CS Demo Manager video generation to focus the wrong POV with
spec_player, even though SteamID-based data such as kills/deathnotices was correct.Cause
For CS2 demos, demoinfocs emits
events.PlayerInfofrom the userinfo stringtable. That event includesIndex, which is the stable player slot needed for slot-based spectator commands.The analyzer was instead deriving the exported user ID from
common.Player.UserID & 0xff. In this demo, that produced a low-byte collision, so two players resolved to the same exported slot.Fix
This change records CS2
events.PlayerInfo.Indexby SteamID and uses that value when creating analyzer players.If the PlayerInfo mapping is unavailable, the analyzer falls back to the previous masked
UserIDbehavior to avoid regressing demos that currently rely on it.Verification
I tested this against three Valve CS2 demos from the same day:
1..10; target playerrealis correctly slot101..101..10Also ran:
go test ./cmd/... ./internal/... ./pkg/...Note
This issue was debugged with help from Codex, and this patch was created as the solution I found while investigating a downstream CS Demo Manager POV bug. No worries if this is not the direction maintainers want to take or if the PR is not merged; I mainly wanted to share the concrete repro/root cause and a small proposed fix.