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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
pretty_name: StarCraftMotion sample
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
size_categories:
|
| 7 |
+
- 1K<n<10K
|
| 8 |
+
task_categories:
|
| 9 |
+
- time-series-forecasting
|
| 10 |
+
- other
|
| 11 |
+
tags:
|
| 12 |
+
- starcraft
|
| 13 |
+
- multi-agent
|
| 14 |
+
- agent-simulation
|
| 15 |
+
- partial-observability
|
| 16 |
+
- benchmark
|
| 17 |
+
configs:
|
| 18 |
+
- config_name: default
|
| 19 |
+
data_files:
|
| 20 |
+
- split: train
|
| 21 |
+
path: train/*.parquet
|
| 22 |
+
- split: validation
|
| 23 |
+
path: validation/*.parquet
|
| 24 |
+
- split: test
|
| 25 |
+
path: test/*.parquet
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
# StarCraftMotion sample
|
| 29 |
+
|
| 30 |
+
StarCraftMotion is a large-scale benchmark for agent simulation
|
| 31 |
+
under adversarial and partial observability scenarios (built from StarCraft replays). Each example is a fixed-length scenario window (`145` frames at `16 FPS`, ~9 seconds) containing all unit
|
| 32 |
+
states, dynamic map layers, and per-player economy time series.
|
| 33 |
+
|
| 34 |
+
The released split is **adversarial**: scenarios are subsampled to
|
| 35 |
+
overweight interaction-heavy windows (mutual-visibility and inter-player
|
| 36 |
+
transitions), making it a stress test for multi-agent prediction under
|
| 37 |
+
partial observability.
|
| 38 |
+
|
| 39 |
+
- **Total scenarios:** 1,000
|
| 40 |
+
- **Train / Val / Test:** 800 / 100 / 100
|
| 41 |
+
- **Parent full-dataset source replays:** 64,327 replay-level HDF5 files (Blizzard `3.16.1-Pack_1-fix`)
|
| 42 |
+
- **Maps (ID):** Abyssal_Reef_LE, Acolyte_LE, Ascension_to_Aiur_LE, Interloper_LE, Mech_Depot_LE
|
| 43 |
+
- **Maps (OOD, test only):** Catallena_LE_(Void), Odyssey_LE
|
| 44 |
+
- **Splits are replay-level** — windows from the same replay never cross splits.
|
| 45 |
+
|
| 46 |
+
- **Parquet bytes:** 75,041,187 (0.070 GiB); 3 shards.
|
| 47 |
+
|
| 48 |
+
## What changed in v2
|
| 49 |
+
|
| 50 |
+
v2 appends 10 columns from the HDF5 root attributes: `player_1_start_location`,
|
| 51 |
+
`player_2_start_location`, `playable_area`, `chunk_start_frame`, `chunk_end_frame`,
|
| 52 |
+
`map_frame_start`, `map_frame_skip`, `current_frame_idx`, `player_info`, and `replay_info`.
|
| 53 |
+
The 37 original columns are bit-identical to the reviewed release (floating NaNs
|
| 54 |
+
compare equal); row counts, scenario keys and splits are unchanged. Thus v2 adds
|
| 55 |
+
metadata needed to reconstruct the experiment inputs without changing the data
|
| 56 |
+
on which the reviews were based. Bit-identical here refers to decoded column
|
| 57 |
+
values, not Parquet file bytes or compression layout. All-row key/schema/length
|
| 58 |
+
checks and bounded value comparisons are described below.
|
| 59 |
+
|
| 60 |
+
## Why parquet, and how to read
|
| 61 |
+
|
| 62 |
+
Each row is one scenario. All per-frame / per-unit array columns are
|
| 63 |
+
stored as **typed Arrow `list<...>` arrays with 32-bit offsets** (e.g. `LIST<float16>`,
|
| 64 |
+
`LIST<bool>`). `n_timesteps = 145` and `n_units` varies per scenario (stored per row).
|
| 65 |
+
The dynamic map layers (`map_creep`, `map_fow_p1`, `map_fow_p2`) are
|
| 66 |
+
sampled every 16 frames, giving `map_T = 10` snapshots per scenario.
|
| 67 |
+
Spatial dimensions `map_H` and `map_W` are stored as explicit scalar
|
| 68 |
+
columns per row (map-dependent; e.g. Abyssal_Reef_LE is 176 × 200).
|
| 69 |
+
|
| 70 |
+
```python
|
| 71 |
+
import numpy as np
|
| 72 |
+
import pyarrow.parquet as pq
|
| 73 |
+
from huggingface_hub import hf_hub_download
|
| 74 |
+
|
| 75 |
+
path = hf_hub_download(
|
| 76 |
+
"inouye-lab/StarCraftMotion_sample", "train/shard_00000.parquet", repo_type="dataset"
|
| 77 |
+
)
|
| 78 |
+
row = next(pq.ParquetFile(path).iter_batches(batch_size=1)).to_pylist()[0]
|
| 79 |
+
|
| 80 |
+
T, N = row["n_timesteps"], row["n_units"]
|
| 81 |
+
map_T, map_H, map_W = row["map_T"], row["map_H"], row["map_W"]
|
| 82 |
+
|
| 83 |
+
coord = np.asarray(row["coordinate"], dtype=np.float16).reshape(T, N, 3)
|
| 84 |
+
alive = np.asarray(row["is_alive"], dtype=bool ).reshape(T, N)
|
| 85 |
+
owner = np.asarray(row["unit_owner"], dtype=np.uint8 ).reshape(N)
|
| 86 |
+
utype = np.asarray(row["unit_type"], dtype=np.uint32).reshape(T, N)
|
| 87 |
+
creep = np.asarray(row["map_creep"], dtype=bool ).reshape(map_T, map_H, map_W)
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
### Streaming shutdown caveat
|
| 91 |
+
|
| 92 |
+
With pyarrow >= 25 and multi-row-group shards, taking only
|
| 93 |
+
`next(iter(load_dataset(..., streaming=True)))` followed by interpreter exit can
|
| 94 |
+
segfault. The data is unaffected. This is the partial-scan shutdown issue tracked
|
| 95 |
+
in [apache/arrow#45214](https://github.com/apache/arrow/issues/45214).
|
| 96 |
+
Consume a whole shard when streaming, or use the working
|
| 97 |
+
`pyarrow.parquet.ParquetFile(path).iter_batches(...)` peek shown above.
|
| 98 |
+
The release was validated with pyarrow 26.0.0 and datasets 5.1.0 by exhausting
|
| 99 |
+
all sample shards and one fixed full shard per split in fresh interpreters.
|
| 100 |
+
|
| 101 |
+
### Schema
|
| 102 |
+
|
| 103 |
+
#### Scalar fields
|
| 104 |
+
|
| 105 |
+
| Field | Type | Description |
|
| 106 |
+
|---------------|--------|--------------------------------------------------------------|
|
| 107 |
+
| `split` | string | `train`, `val`, or `test` |
|
| 108 |
+
| `map_name` | string | Map name (spaces replaced with `_`) |
|
| 109 |
+
| `replay_hash` | string | Hash of the parent SC2Replay file |
|
| 110 |
+
| `segment_idx` | int32 | Index of this 145-frame window inside the parent replay |
|
| 111 |
+
| `n_timesteps` | int32 | Number of frames per row (constant `145` in this release) |
|
| 112 |
+
| `n_units` | int32 | Number of unique unit rows in this scenario (variable) |
|
| 113 |
+
| `map_T` | int32 | Number of map snapshots per row (constant `10` in this release) |
|
| 114 |
+
| `map_H` | int32 | Map grid height in cells (map-dependent) |
|
| 115 |
+
| `map_W` | int32 | Map grid width in cells (map-dependent) |
|
| 116 |
+
|
| 117 |
+
#### Map data — shape `(map_T, map_H, map_W)` where `map_T = 10`
|
| 118 |
+
|
| 119 |
+
`map_H` and `map_W` are map-specific (each StarCraft II ladder map has
|
| 120 |
+
its own native grid). All three layers below share the same shape per
|
| 121 |
+
scenario.
|
| 122 |
+
|
| 123 |
+
| Field | dtype |
|
| 124 |
+
|---------------|-------|
|
| 125 |
+
| `map_creep` | bool |
|
| 126 |
+
| `map_fow_p1` | bool |
|
| 127 |
+
| `map_fow_p2` | bool |
|
| 128 |
+
|
| 129 |
+
#### Player economy — shape `(145, 2)`, column 0 = Player 1, column 1 = Player 2
|
| 130 |
+
|
| 131 |
+
| Field | dtype |
|
| 132 |
+
|-------------|--------|
|
| 133 |
+
| `food_cap` | uint8 |
|
| 134 |
+
| `food_used` | uint8 |
|
| 135 |
+
| `minerals` | uint16 |
|
| 136 |
+
| `vespene` | uint16 |
|
| 137 |
+
|
| 138 |
+
#### Per-unit constants — shape `(n_units,)`
|
| 139 |
+
|
| 140 |
+
| Field | dtype | Description |
|
| 141 |
+
|--------------|--------|----------------------------------------------|
|
| 142 |
+
| `unit_owner` | uint8 | 1 = P1, 2 = P2, 16 = neutral |
|
| 143 |
+
| `unit_tag` | uint64 | Raw SC2 engine tag (unique per unit instance)|
|
| 144 |
+
|
| 145 |
+
#### Per-frame, per-unit — shape `(145, n_units)` unless noted
|
| 146 |
+
|
| 147 |
+
| Field | dtype | Shape | Description |
|
| 148 |
+
|-------------------|---------|----------------------|-------------------------------------------------|
|
| 149 |
+
| `coordinate` | float16 | (145, n_units, 3) | Native (x, y, z) map coordinates |
|
| 150 |
+
| `target_pos` | float16 | (145, n_units, 2) | Order target ground position |
|
| 151 |
+
| `health` | float16 | | |
|
| 152 |
+
| `health_max` | float16 | | |
|
| 153 |
+
| `shield` | float16 | | Protoss shield |
|
| 154 |
+
| `energy` | float16 | | |
|
| 155 |
+
| `heading` | float16 | | Facing direction in radians (0 to 2π) |
|
| 156 |
+
| `radius` | float16 | | Unit collision radius |
|
| 157 |
+
| `build_progress` | float16 | | 0.0–1.0 |
|
| 158 |
+
| `unit_type` | uint32 | | Raw SC2 unit type ID |
|
| 159 |
+
| `ability_id` | uint32 | | First order's ability ID |
|
| 160 |
+
| `target_id` | uint32 | | Target's row index (`0xFFFFFFFF` = no target) |
|
| 161 |
+
| `mineral_contents`| uint16 | | Remaining minerals (mineral fields) |
|
| 162 |
+
| `vespene_contents`| uint16 | | Remaining vespene (geysers) |
|
| 163 |
+
| `is_alive` | bool | | |
|
| 164 |
+
| `is_burrowed` | bool | | Zerg burrowed |
|
| 165 |
+
| `is_carried` | bool | | Inside a transport |
|
| 166 |
+
| `is_flying` | bool | | Air unit / lifted building |
|
| 167 |
+
| `visible_status` | uint8 | | Combined P1/P2 visibility (see below) |
|
| 168 |
+
|
| 169 |
+
`visible_status = p1_state * 3 + p2_state`, with each state in
|
| 170 |
+
`{0 = unseen, 1 = snapshot, 2 = visible}`. Examples: `8` = visible to both,
|
| 171 |
+
`6` = visible to P1 only, `2` = visible to P2 only.
|
| 172 |
+
|
| 173 |
+
#### Added HDF5 metadata
|
| 174 |
+
|
| 175 |
+
All array columns use `list<...>`; shapes below describe their reconstructed arrays.
|
| 176 |
+
|
| 177 |
+
| Field | Arrow type | Description |
|
| 178 |
+
|---|---|---|
|
| 179 |
+
| `player_1_start_location` | list<float32> | Full xyz start, length 3, in-game slot 1 |
|
| 180 |
+
| `player_2_start_location` | list<float32> | Full xyz start, length 3, in-game slot 2 |
|
| 181 |
+
| `playable_area` | list<int64> | Playable bounds, length 4 |
|
| 182 |
+
| `chunk_start_frame` | int32 | Scenario start frame |
|
| 183 |
+
| `chunk_end_frame` | int32 | Scenario end frame |
|
| 184 |
+
| `map_frame_start` | int32 | Starting map-layer frame |
|
| 185 |
+
| `map_frame_skip` | int32 | Map sampling interval, 16 |
|
| 186 |
+
| `current_frame_idx` | int32 | Current-frame index, 16 |
|
| 187 |
+
| `player_info` | string | Original JSON list, unchanged |
|
| 188 |
+
| `replay_info` | string | Original JSON object, unchanged |
|
| 189 |
+
|
| 190 |
+
`player_info` contains per-player objects with keys `player_id` (in-game slot 1/2),
|
| 191 |
+
`race_requested`, `race_actual`, `player_result`, `player_mmr`, `player_apm`.
|
| 192 |
+
`replay_info` has keys `game_duration_loops`, `game_duration_seconds`,
|
| 193 |
+
`game_version`, `data_build`, `base_build`.
|
| 194 |
+
|
| 195 |
+
### HDF5 ↔ Parquet mapping
|
| 196 |
+
|
| 197 |
+
The Parquet → HDF5 conversion script, `release/parquet_to_hdf5.py`, and its shared
|
| 198 |
+
`release/schema.py` will be released with the processing code. They need numpy,
|
| 199 |
+
pyarrow and h5py and restore the experiment layout and typed attributes.
|
| 200 |
+
|
| 201 |
+
| HDF5 dataset | Parquet column(s) | Restored shape |
|
| 202 |
+
|---|---|---|
|
| 203 |
+
| `map_data/dynamic/creep` | `map_creep` | `(map_T, map_H, map_W)` |
|
| 204 |
+
| `map_data/dynamic/fow_player_1` | `map_fow_p1` | `(map_T, map_H, map_W)` |
|
| 205 |
+
| `map_data/dynamic/fow_player_2` | `map_fow_p2` | `(map_T, map_H, map_W)` |
|
| 206 |
+
| `player_data/food_cap` | `food_cap` | `(n_timesteps, 2)` |
|
| 207 |
+
| `player_data/food_used` | `food_used` | `(n_timesteps, 2)` |
|
| 208 |
+
| `player_data/minerals` | `minerals` | `(n_timesteps, 2)` |
|
| 209 |
+
| `player_data/vespene` | `vespene` | `(n_timesteps, 2)` |
|
| 210 |
+
| `unit_data/global/unit_owner` | `unit_owner` | `(n_units)` |
|
| 211 |
+
| `unit_data/global/unit_tag` | `unit_tag` | `(n_units)` |
|
| 212 |
+
| `unit_data/repeated/coordinate` | `coordinate` | `(n_timesteps, n_units, 3)` |
|
| 213 |
+
| `unit_data/repeated/health` | `health` | `(n_timesteps, n_units)` |
|
| 214 |
+
| `unit_data/repeated/health_max` | `health_max` | `(n_timesteps, n_units)` |
|
| 215 |
+
| `unit_data/repeated/shield` | `shield` | `(n_timesteps, n_units)` |
|
| 216 |
+
| `unit_data/repeated/energy` | `energy` | `(n_timesteps, n_units)` |
|
| 217 |
+
| `unit_data/repeated/heading` | `heading` | `(n_timesteps, n_units)` |
|
| 218 |
+
| `unit_data/repeated/build_progress` | `build_progress` | `(n_timesteps, n_units)` |
|
| 219 |
+
| `unit_data/repeated/radius` | `radius` | `(n_timesteps, n_units)` |
|
| 220 |
+
| `unit_data/repeated/ability_id` | `ability_id` | `(n_timesteps, n_units)` |
|
| 221 |
+
| `unit_data/repeated/unit_type` | `unit_type` | `(n_timesteps, n_units)` |
|
| 222 |
+
| `unit_data/repeated/target_id` | `target_id` | `(n_timesteps, n_units)` |
|
| 223 |
+
| `unit_data/repeated/target_pos` | `target_pos` | `(n_timesteps, n_units, 2)` |
|
| 224 |
+
| `unit_data/repeated/is_alive` | `is_alive` | `(n_timesteps, n_units)` |
|
| 225 |
+
| `unit_data/repeated/is_burrowed` | `is_burrowed` | `(n_timesteps, n_units)` |
|
| 226 |
+
| `unit_data/repeated/is_carried` | `is_carried` | `(n_timesteps, n_units)` |
|
| 227 |
+
| `unit_data/repeated/is_flying` | `is_flying` | `(n_timesteps, n_units)` |
|
| 228 |
+
| `unit_data/repeated/mineral_contents` | `mineral_contents` | `(n_timesteps, n_units)` |
|
| 229 |
+
| `unit_data/repeated/vespene_contents` | `vespene_contents` | `(n_timesteps, n_units)` |
|
| 230 |
+
| `unit_data/repeated/visible_status` | `visible_status` | `(n_timesteps, n_units)` |
|
| 231 |
+
|
| 232 |
+
Ten root attributes map directly to the added columns listed above. Five frame
|
| 233 |
+
attributes are stored as int32 and restored as HDF5 int64; start locations remain
|
| 234 |
+
float32, playable bounds remain int64, and JSON strings remain unchanged.
|
| 235 |
+
These seven remaining root attributes are rebuilt from existing columns:
|
| 236 |
+
|
| 237 |
+
| HDF5 root attribute | Rebuilt from Parquet |
|
| 238 |
+
|---|---|
|
| 239 |
+
| `map_name` | `map_name` |
|
| 240 |
+
| `map_size` | int64 `[map_H, map_W]` |
|
| 241 |
+
| `total_frames` | int64 `n_timesteps` |
|
| 242 |
+
| `chunk_idx` | int64 `segment_idx` |
|
| 243 |
+
| `parent_replay` | `replay_hash` |
|
| 244 |
+
| `replay_name` | `replay_hash` |
|
| 245 |
+
| `max_unique_units` | int64 `n_units` |
|
| 246 |
+
|
| 247 |
+
Reconstructed files use `train/`, `val/`, `test/`, map subdirectories, and
|
| 248 |
+
`<replay_hash>_<segment_idx:04d>.h5`, with sorted manifests. Parquet directories
|
| 249 |
+
are `train/`, `validation/`, `test/`; the validation rows store `split="val"`.
|
| 250 |
+
All 1,000 sample scenarios and a fixed set of 2,613 full-release scenarios were
|
| 251 |
+
compared against the reviewed Parquet and source HDF5, including original values
|
| 252 |
+
and all new attributes. All 469,187 full-release keys and all list lengths were
|
| 253 |
+
checked; full reconstructed manifests matched the originals byte for byte.
|
| 254 |
+
|
| 255 |
+
### Action labels
|
| 256 |
+
|
| 257 |
+
The `ability_id` column stores the **raw SC2 ability ID as `uint32`**
|
| 258 |
+
(e.g. `MOVE = 16`, `ATTACK_ATTACK = 23`, `HARVEST_GATHER_DRONE = 1183`,
|
| 259 |
+
`ability_id == 0` means the unit has no active order). It is **not**
|
| 260 |
+
class-indexed.
|
| 261 |
+
|
| 262 |
+
For action prediction tasks, the processing code contains an 11-class coarse mapping
|
| 263 |
+
at `utils/coarse_action_mapping.py`. The processing code will be released separately.
|
| 264 |
+
|
| 265 |
+
| Label | Name | Description |
|
| 266 |
+
|------:|-----------|------------------------------------------------------------|
|
| 267 |
+
| 0 | NO_OP | `ability_id == 0`; unit idle |
|
| 268 |
+
| 1 | MOVE | move, patrol, hold position, stop, smart (right-click) |
|
| 269 |
+
| 2 | ATTACK | attack, attack-move, attack building |
|
| 270 |
+
| 3 | HARVEST | gather resources, return cargo |
|
| 271 |
+
| 4 | TRAIN | produce units from buildings / larvae / warp-in |
|
| 272 |
+
| 5 | BUILD | construct structures, add-ons, creep tumors |
|
| 273 |
+
| 6 | RESEARCH | upgrades and tech research |
|
| 274 |
+
| 7 | MORPH | unit/structure transformation (siege, archon, lair, etc.) |
|
| 275 |
+
| 8 | EFFECT | combat abilities, spells, auto-cast effects |
|
| 276 |
+
| 9 | TRANSPORT | load, unload, lift off, land |
|
| 277 |
+
| 10 | BURROW | burrow down / burrow up (Zerg) |
|
| 278 |
+
| 255 | UNKNOWN | unmapped or cosmetic |
|
| 279 |
+
|
| 280 |
+
Sources for the mapping:
|
| 281 |
+
- Blizzard `s2client-api` `ABILITY_ID` enum:
|
| 282 |
+
https://blizzard.github.io/s2client-api/sc2__typeenums_8h.html
|
| 283 |
+
- Blizzard `s2client-proto` `stableid.json`:
|
| 284 |
+
https://github.com/Blizzard/s2client-proto/blob/master/stableid.json
|
| 285 |
+
|
| 286 |
+
Coverage on the released split is 100% of all action occurrences
|
| 287 |
+
(every `ability_id` either matches a Blizzard enum prefix, is one of 10
|
| 288 |
+
explicit `stableid.json` overrides, or is `0` / falls into `UNKNOWN`).
|
| 289 |
+
|
| 290 |
+
#### Applying the mapping
|
| 291 |
+
|
| 292 |
+
Run this after the row-reading example, from the processing-code root once that code is released.
|
| 293 |
+
|
| 294 |
+
```python
|
| 295 |
+
import numpy as np
|
| 296 |
+
from utils.coarse_action_mapping import ABILITY_ID_TO_COARSE_ACTION
|
| 297 |
+
|
| 298 |
+
T, N = row["n_timesteps"], row["n_units"]
|
| 299 |
+
ability_id = np.asarray(row["ability_id"], dtype=np.uint32).reshape(T, N)
|
| 300 |
+
|
| 301 |
+
# Vectorized lookup via a dense uint8 table.
|
| 302 |
+
max_id = max(ABILITY_ID_TO_COARSE_ACTION) + 1
|
| 303 |
+
lut = np.full(max_id, 255, dtype=np.uint8)
|
| 304 |
+
for aid, label in ABILITY_ID_TO_COARSE_ACTION.items():
|
| 305 |
+
lut[aid] = label
|
| 306 |
+
|
| 307 |
+
coarse = np.where(ability_id < max_id, lut[np.clip(ability_id, 0, max_id - 1)], 255)
|
| 308 |
+
```
|
| 309 |
+
|
| 310 |
+
## Pipeline summary
|
| 311 |
+
|
| 312 |
+
1. **Replay extraction** (`extract_replay_level.py`): three SC2 engine passes
|
| 313 |
+
(omniscient + per-player FOW) into one HDF5 per replay, preserving native
|
| 314 |
+
coordinates, raw SC2 unit/ability IDs, and per-player visibility.
|
| 315 |
+
2. **Scenario windowing** (`split_scenarios.py`): chunk into `145`-frame
|
| 316 |
+
windows at `16 FPS` (1 s history + current + 8 s future).
|
| 317 |
+
Drops replays with `duration < 120 s` or either player at `APM < 1`.
|
| 318 |
+
3. **Replay-level split** (`create_dataset_split.py`): 80/10/10 train/val/test
|
| 319 |
+
over ID maps; OOD maps go to test only. Keeps `10%` of each replay's
|
| 320 |
+
windows.
|
| 321 |
+
4. **Adversarial weighting**: window sampling weight is
|
| 322 |
+
`log(1 + mutual_unit_sum) + log(1 + transition_cnt)`; zero-score windows
|
| 323 |
+
are excluded.
|
| 324 |
+
|
| 325 |
+
## Dataset statistics
|
| 326 |
+
|
| 327 |
+
The sample contains 800 train, 100 validation and 100 test scenarios. The schema
|
| 328 |
+
is identical to the [full release](https://huggingface.co/datasets/inouye-lab/StarCraftMotion).
|
| 329 |
+
The full card reports full-corpus summary statistics; they are not sample statistics.
|
| 330 |
+
|
| 331 |
+
### How the sample was made
|
| 332 |
+
|
| 333 |
+
Mingyu Kim's original `sample_convert_to_parquet.py` used seed 42 and stratified
|
| 334 |
+
selection by split and map: first at least one scenario per available map, then
|
| 335 |
+
remaining slots allocated approximately in proportion to each map's population,
|
| 336 |
+
with top-up/trim to the requested count. Train and validation cover the five ID
|
| 337 |
+
maps; test covers all seven maps, including both OOD maps. Together they contain
|
| 338 |
+
800/100/100 scenarios. The v2 `release/sample_convert_to_parquet.py` imports the
|
| 339 |
+
shared converter and preserves exactly the reviewed sample's scenario keys
|
| 340 |
+
using `--keys-from`; it does not resample. Both scripts originate from the
|
| 341 |
+
reviewed-release converters by Mingyu Kim.
|
| 342 |
+
|
| 343 |
+
## Intended use
|
| 344 |
+
|
| 345 |
+
- Multi-agent simulation under adversarial partial observability.
|
| 346 |
+
- Benchmarks for fog-of-war handling, ID vs OOD-map
|
| 347 |
+
generalization, and interaction-heavy scenes.
|
| 348 |
+
|
| 349 |
+
## Limitations and ethical considerations
|
| 350 |
+
|
| 351 |
+
- **Replay provenance:** raw replays come from Blizzard's
|
| 352 |
+
`3.16.1-Pack_1-fix` distribution. Per-replay curation, demographics of
|
| 353 |
+
players, and any prior filtering performed by Blizzard are not documented.
|
| 354 |
+
- **MMR caveat:** `player_info` is a JSON string whose per-player
|
| 355 |
+
`player_mmr` values can include sentinel-like negatives for some replays. League-tier bucketing should be recomputed
|
| 356 |
+
rather than relied upon naively.
|
| 357 |
+
- **Single game version:** all replays are SC2 build 3.16.1; balance and
|
| 358 |
+
meta-game differ from current ladder versions.
|
| 359 |
+
- **Privacy:** replays come from Blizzard's anonymized public replay packs.
|
| 360 |
+
No player names or account IDs are included; `player_info` holds per-game
|
| 361 |
+
race, result, MMR and APM for in-game slots 1 and 2.
|
| 362 |
+
- **Game-balance / strategic bias:** the corpus is whatever Blizzard
|
| 363 |
+
released in the pack and is not a uniform sample of competitive play.
|
| 364 |
+
|
| 365 |
+
## License
|
| 366 |
+
|
| 367 |
+
The released parquet artifacts are licensed under
|
| 368 |
+
[**Creative Commons Attribution-NonCommercial 4.0 International (CC-BY-NC-4.0)**](https://spdx.org/licenses/CC-BY-NC-4.0.html)
|
| 369 |
+
(SPDX: `CC-BY-NC-4.0`).
|
| 370 |
+
|
| 371 |
+
The released parquet files are **derivative ML features** (float16 unit
|
| 372 |
+
trajectories, fog-of-war and creep masks, per-player economy time series,
|
| 373 |
+
and raw SC2 unit/ability identifiers) extracted from StarCraft II
|
| 374 |
+
replays. The dataset does **not** redistribute raw `.SC2Replay` files,
|
| 375 |
+
SC2 game maps, or any portion of the StarCraft II Software. Use of the
|
| 376 |
+
underlying StarCraft II replays and the SC2 engine is separately
|
| 377 |
+
governed by Blizzard's
|
| 378 |
+
[AI and Machine Learning License](https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html);
|
| 379 |
+
that license explicitly permits use of derived ML data for personal or
|
| 380 |
+
internal research and development.
|
| 381 |
+
|
| 382 |
+
|
| 383 |
+
## Authors
|
| 384 |
+
|
| 385 |
+
Yi-Chung Chen, Mingyu Kim, Ruqi Bai, James Zachary Hare, Jing Gao, David I. Inouye.
|
| 386 |
+
|
| 387 |
+
## Citation
|
| 388 |
+
|
| 389 |
+
```bibtex
|
| 390 |
+
@inproceedings{chen2026starcraftmotion,
|
| 391 |
+
title = {StarCraft Motion: A Dataset for Agent Simulation in Adversarial and Partially Observable Scenarios},
|
| 392 |
+
author = {Yi-Chung Chen and Mingyu Kim and Ruqi Bai and James Zachary Hare and Jing Gao and David I. Inouye},
|
| 393 |
+
booktitle = {NeurIPS 2026 Evaluations and Datasets Track},
|
| 394 |
+
year = {2026}
|
| 395 |
+
}
|
| 396 |
+
```
|
| 397 |
+
|
| 398 |
+
Underlying replays:
|
| 399 |
+
|
| 400 |
+
```bibtex
|
| 401 |
+
@misc{blizzard_sc2_replaypacks,
|
| 402 |
+
title = {StarCraft II Replay Packs (3.16.1-Pack\_1-fix)},
|
| 403 |
+
author = {{Blizzard Entertainment}},
|
| 404 |
+
howpublished = {\url{https://blzdistsc2-a.akamaihd.net/ReplayPacks/3.16.1-Pack_1-fix.zip}}
|
| 405 |
+
}
|
| 406 |
+
```
|
| 407 |
+
|
| 408 |
+
## Acknowledgments
|
| 409 |
+
|
| 410 |
+
Built on top of DeepMind's `pysc2` and Blizzard's StarCraft II AI/ML
|
| 411 |
+
infrastructure.
|
test/shard_00000.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf6e058f40c3411251f8c5f177c36fcbb7e06346e78cbc3957373403025586d0
|
| 3 |
+
size 8000638
|
train/shard_00000.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e0b23802f3266b02497424a876d77686e4b792fd2c6428595ef000c09bc06637
|
| 3 |
+
size 59665198
|
validation/shard_00000.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e750277b04b613202e3866f4ccf9d200851f6f1ae03eec24ea2efbf473fb35aa
|
| 3 |
+
size 7375351
|