s2protocol 0.1.1

A reader for Starcraft II - Replay format
Documentation

Crates.io Workflow Status

s2protocol-rs

A nom parser for the Starcraft 2 Protocol Replay format.

Generating code:

The rust code for the protocol87702 was generated by running:

mkdir src/versions/protocol87702/
RUST_LOG_SPAN_EVENTS=full RUST_LOG=debug cargo run -- --source ../s2protocol/json/protocol87702.json generate --output src/versions/protocol87702/mod.rs
# Add the new module to src/versions/mod.rs
# Run rust format on the new src/versions/protocol87702/mod.rs file
# cargo check, cargo build, etc

In order for this to work, the repo from Blizzard must be cloned at ../s2protocol.

Sources

Blizzard/s2protocol repo

Motivation

The goal is to learn how to parse binary files format with nom and to learn how the Starcraft 2 Replay file is so incredibly small for the amount of information it packs.

From the available data, generative art can be created, for example by using nannou (PoC missing) bevyengine/bevy can be used to see:

  • An Enhanced Replay Minimap
  • Additional statistics. See the repo sebosp/swarmy for an example on how this can look like.

TODO

Read the version and from the version call the correct module so that we can support multiple modules.

Status

  • Replay Tracker for protocol87702
  • Replay Tracker for protocol89634
  • Calculating the unit movement is not done yet,
  • Decoding the tag/recycle is missing to match Game Events.
  • Game Events are not parsed yet.