Demo team statistics broken?

Demo team statistics broken?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Demo team statistics broken?

Post by Jazcash »

I'm trying to pull the team statistic data from demos (same data used to generate the graphs in game over screen), but the data doesn't seem to be there. This is the relevant header info for the attached demo:

Code: Select all

"numPlayers": 18,
"playerStatSize": 360,
"playerStatElemSize": 20,
"numTeams": 9,
"teamStatSize": 36,
"teamStatElemSize": 80,
"teamStatPeriod": 15,
"winningAllyTeamsSize": 1
The total size of player statistics is 360 bytes, and each player chunk is 20 bytes. 360 / 20 = 18 players (as it confirms).

Applying the same thing to the team statistics makes no sense because the total size of the team statistics is only 36 bytes (so it makes no sense each team statistic chunk would be 80).

I confirmed that chunk really is only 36 bytes, because the total number of bytes left in the file after the demo stream in this example is 397 (360 + 36 + 1). The teamStatSize is this low for all the demos I've tried.

I found an old example from dansan regarding this info, which puts the total size of team stats much higher, which seems accurate. Is this something that broke?

Engine: https://github.com/beyond-all-reason/sp ... 7-gc0fc18e
Game: https://github.com/beyond-all-reason/Beyond-All-Reason
Map: https://springfiles.com/spring/spring-maps/moonq20xr2
Attachments
20201221_005743_MoonQ20XR2 2_104.0.1-1707-gc0fc18e BAR.zip
(1.03 MiB) Downloaded 14 times
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Demo team statistics broken?

Post by Jazcash »

I've just realised this is an autohost vs player thing. Player recorded demos contain team stats and autohost ones don't. I'm guessing because the client needs to be actually simulating the game to generate that info?
Post Reply

Return to “Engine”