Live data from Hacker News

Show HN: A nom parser for the Starcraft 2 Protocol Replay format

github.com

51–58 of 58 posts

Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format

#51
post #6
post #4

I've also been impressed with the amount of data in SC2 replay files given the size, although I'm more interested in Broodwar (SC1) as a game. If I'm not mistaken Broodwar replay files contain a lot less information. They mainly contain player actions, i.e. you don't even know when a marine died -- the game has to literally be replayed to get that information.

The Broodwar replays were really cursed -- I remember that hilarious (perfectly reproducable) bugs of quickly replaying a game which resulted in a completely different replay then the actual game, apparently because the replay missed to integrate all replay information correctly and ended up in a different game state.

The same can happen in a live game. Apparently LAN games don't check for consistency in game state so you can just diverge over time. One of the observers in ASL desynced in the RO8 just the other day so it travelled over into remastered.

Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format

#53
post #48

Earlier quoted context omitted.

SC2 patches to an older version if you load an old version. Then patches back to current version when you want to play again. It requires the game to restart -- and while SC2 has a feature where you can watch a live replay with your friends (by all joining the same game which is hosted as type "replay") -- that "watch replay with others" feature only works with replays which were created in the latest version because…

Can you link to any of those Harstem videos where he takes over the "losing" side?

I cannot. Perhaps I'm misremembering some details -- but I cannot even find any YouTube videos where a strong YouTuber resumes replays to play out with other people. So no matter which details I have right/wrong, I'm unable to find the video.

Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format

#54
post #48

Earlier quoted context omitted.

Can you link to any of those Harstem videos where he takes over the "losing" side?

I cannot. Perhaps I'm misremembering some details -- but I cannot even find any YouTube videos where a strong YouTuber resumes replays to play out with other people. So no matter which details I have right/wrong, I'm unable to find the video.

I swear I've seen the same video(s). I couldn't find after a brief search either but there's something like this he did.

Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format

#55
post #51
post #6

Earlier quoted context omitted.

The Broodwar replays were really cursed -- I remember that hilarious (perfectly reproducable) bugs of quickly replaying a game which resulted in a completely different replay then the actual game, apparently because the replay missed to integrate all replay information correctly and ended up in a different game state.

The same can happen in a live game. Apparently LAN games don't check for consistency in game state so you can just diverge over time. One of the observers in ASL desynced in the RO8 just the other day so it travelled over into remastered.

This isn't a deficiency of LAN games, it's a deficiency of the observer mode Blizzard added to the game when they remastered it. The code they wrote to deal with stealthed units as an observer mistakenly changes the actual game state when you change player vision (i.e. set the game to only show one player's vision), which leads to the game state desyncing for the observer that does this. I run a project (ShieldBattery) where we've developed numerous patches to the game including a fix for this bug, but pro games don't use our stuff so they're stuck with the bug unless Blizzard decides to maintain the game again.

Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format

#57
post #55
post #51

Earlier quoted context omitted.

The same can happen in a live game. Apparently LAN games don't check for consistency in game state so you can just diverge over time. One of the observers in ASL desynced in the RO8 just the other day so it travelled over into remastered.

This isn't a deficiency of LAN games, it's a deficiency of the observer mode Blizzard added to the game when they remastered it. The code they wrote to deal with stealthed units as an observer mistakenly changes the actual game state when you change player vision (i.e. set the game to only show one player's vision), which leads to the game state desyncing for the observer that does this. I run a project (ShieldBatter…

Oh, that's good to know. Shield battery is a great project. Thanks for your work.

Re: Show HN: A nom parser for the Starcraft 2 Protocol Replay format

#58
post #12
post #7

Earlier quoted context omitted.

Is there a general name to the way the data is compressed/serialized in SC2 Replays? Yesterday somebody was talking about other ways to serialize/pack data with borsh but not sure it's at all similar... Is the SC1 broodwar replay format similar with byte-alignment and bit "packing"? BTW I call the parsers "bitpacked" or "byte-aligned", but I'm not sure what the right name for them is...

SC2 replays are MPQ files, which is a proprietary format created and used by Blizzard. It's an archive that may contain multiple files stored with different compression and optionally encrypted. I wrote a lib to parse MPQ files that embodies SC2Replays: https://github.com/icza/mpq . I also wrote an SC2 replay parser that is more or less a port of the official s2protocol: https://github.com/icza/s2prot

Thank you for your work on s2prot I spent a lot of time with it and file watchers to gather stats about my matches while I sat in queues
Post reply on HN