Blizzard / s2client-proto

StarCraft II Client - protocol definitions used to communicate with StarCraft II.
MIT License
3.76k stars 431 forks source link

Receiving actions of all players when playing replay #42

Closed quyse closed 6 years ago

quyse commented 6 years ago

I may be missing something, but is there a way to get actions of all players when analyzing replay?

If I set observed_player_id in RequestStartReplay message to some valid player id (i.e. 1 or 2 for 2-player replay), it seems like in ResponseObservation messages afterwards I'm receiving actions only for this specified player. If I didn't set observed_player_id or set it to zero or some invalid value, I'm not receiving any actions at all.

How can I get actions of all players in a single replay session? Or should I analyze replay multiple times, one time for each player?

Thanks!

KevinCalderone commented 6 years ago

You need to run through the replay multiple times.

The API implementation reuses a lot of the code the regular game UI uses to determine what to display. Unfortunately this also meant that it inherited the assumptions of only having access to the state of one player. It is unlikely this restriction will change in the future.