-
Notifications
You must be signed in to change notification settings - Fork 0
byte.stream
Throughout this documentation we will be working with the sc2replay files in a hexadecimal byte stream. This means that the individual bits of the replay files are grouped into bytes and encoded as hexadecimal strings. Thus, the first 24 bits of the .sc2replay file are represented in a hexadecimal byte stream as 4d 50 51
which is equivalent to the following bit stream: 01001101 01010000 01010001
. Because of this hexadecimal convention, to fully understand the format specification here you must have a solid understanding of binary, hexadecimal, and decimal based numbers.
In most of the files, parsing at the byte level is sufficient and accurate. In some files however, it becomes necessary to look at the bit stream represented by those hexadecimal bytes. This occurs primarily in the replay.game.events file where extreme compression has lead Blizzard to adopt very compact and unique serialization formats for each of their events.
Because event parsing requires operations at the bit level, understanding those bits of the documentation and/or code requires a prior knowledge of the various bitwise operations and understand how bit masks work.
Many of these links don't approach the topics in the most helpful ways for the task at hand. Hopefully I will run across better reference documents in the future. If you have a better place to look for introductions to these topics please let me know.