Broodwar Replay Analyzer
Broodwar Replay Analyzer is a local command-line tool for StarCraft: Brood War replay research.
It queries the public cwal.gg replay vault. It then runs CWAL’s browser worker and WASM simulator locally.
The tool produces individual build orders, opening classifications, technology timings, unit totals, results, and aggregate trends.
Features
- All race matchups and matchup directions
- Terran, Protoss, and Zerg opening summaries
- Both player builds in mirror matchups
- Minimum, maximum, and bounded MMR filters
- Either-player and both-player MMR scopes
- Fuzzy matching against the current CWAL map list
- Text reports for people
- Structured JSON reports for programs and LLMs
- Cached replay analysis for faster repeated queries
- TvZ bio splits for Academy-first and Engineering-Bay-first builds
Requirements
Install these programs before you use the analyzer:
- Node.js 20 or newer
- npm
- Google Chrome, Chromium, Brave, or Microsoft Edge
- Internet access to
cwal.gg and api.aws.cwal.gg
The tool does not require a CWAL account or API key.
Install
git clone https://github.com/OlliverBarr/BroodwarReplayAnalyzer.git
cd BroodwarReplayAnalyzer
npm ci
The tool checks standard browser locations on macOS and Linux.
Set CHROME_PATH when your browser uses a different location:
CHROME_PATH="/path/to/chrome" npm run cwal -- "find last 5 terran builds vs zerg on odyssey"
Run a query
Pass a natural-language query after --:
npm run cwal -- "find last 10 terran builds vs zerg above 2400 mmr on odyssey"
The first race controls which build orders the report summarizes.
For example, this command summarizes Protoss builds from PvT games:
npm run cwal -- "find all protoss builds vs terran between 2200 and 2500 mmr on fighting spirit"
A mirror matchup summarizes both players:
npm run cwal -- "find last 5 zerg builds vs zerg below 2350 mmr on backrooms"
Query filters
Matchups
Use full race names or standard matchup codes.
terran builds vs zerg
protoss vs terran
ZvP
TvT
Cross-race directions select the requested race’s builds. Mirror matchups select both builds from each replay.
MMR
The CWAL vault supports MMR bounds from 800 through 2900.
An unqualified MMR filter applies to at least one player:
above 2400 mmr
under 2350 mmr
between 2200 and 2500 mmr
Require both ratings explicitly when needed:
both players above 2400 mmr
both players between 2200 and 2500 mmr
You can also target one race’s rating:
terran player above 2400 mmr
zerg player under 2300 mmr
The analyzer reads match-time ratings from player match records. It reports unavailable ratings as unknown.
A both-player filter rejects a replay when either rating is unavailable.
Maps
The analyzer reads the current map list from CWAL. Short names such as odyssey and backrooms use fuzzy matching.
The command returns an error when CWAL has no matching map.
Result count
Request a fixed number of recent qualifying replays:
last 10
latest 20
5 games
Use all to analyze every qualifying vault replay:
find all terran builds vs protoss above 2400 mmr on odyssey
Command options
--json Print structured JSON.
--refresh Ignore cached replay analyses.
--help Show command usage.
Export a report for another program or LLM:
npm run cwal -- --json \
"find last 20 terran builds vs zerg above 2400 mmr on odyssey" \
> cwal-results.json
Progress messages go to standard error. JSON output goes to standard output.
Set a custom cache directory with CWAL_CACHE_DIR:
CWAL_CACHE_DIR="/tmp/cwal-cache" npm run cwal -- "find last 5 protoss builds vs zerg on odyssey"
Report contents
Text reports include:
- Player names and match-time ratings
- Date, duration, and winner
- Race-specific opening classification
- Building timings with supply values
- Upgrade and technology timings
- Unit production totals
- Per-query aggregate frequencies
- Replay links for manual review
JSON reports also include raw CWAL buildOrder events.
For TvZ bio, reports separate these sequences:
- Academy to Engineering Bay
- Engineering Bay to Academy
- Academy with no observed Engineering Bay
The bio detector requires meaningful bio production or bio research. A late Academy in a mech build does not qualify.
How it works
- The CLI parses the natural-language filters.
- It resolves the map against CWAL’s live replay-vault map list.
- It fetches matching replay metadata and match-time ratings.
- It downloads each raw replay through CWAL’s public API.
- It discovers CWAL’s current hashed analysis worker.
- It runs that worker in headless Chrome.
- It extracts the requested player’s build-order events.
- It classifies and aggregates the results.
Cached analysis files are stored under .cache/cwal by default.
Use with an LLM
An LLM with terminal access can run the CLI directly. Ask it to use JSON for detailed analysis.
Example instruction:
Run npm run cwal -- --json "<my query>".
Summarize the returned games and aggregate patterns.
Preserve unknown ratings and skipped-game counts.
Treat timings as CWAL detection times, not exact command times.
An LLM without terminal access can analyze an exported cwal-results.json file.
Limitations
- CWAL can change its public endpoints, frontend assets, or worker behavior.
- Build timings are CWAL simulation detection times, not exact command-click times.
- Opening classifications are heuristics based on observed buildings and research.
- The CLI skips replays shorter than two minutes.
- Rating records can be unavailable for some players.
- Large queries can take several minutes on the first run.
This project is not affiliated with CWAL or Blizzard Entertainment.
Development
Run the automated tests:
npm test
评论