Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 281 forks source link

Store / Resume Game State #148

Open davechurchill opened 7 years ago

davechurchill commented 7 years ago

Any thoughts about whether we will ever be able to somehow store the current game state and resume from that point at a later time, from entirely within the API? Even if it is just within the context of bot vs. built-in API, or mini-games?

KevinCalderone commented 7 years ago

In the protobuf protocol, we have a "RequestQuickSave/RequestQuickLoad" field which we plan to implement. The functionality will be similar to how you can rewind back in a replay, except it will work in a live game.

Initially it will only work in single player games, so bot vs built-in AI and mini-games.

davechurchill commented 7 years ago

That would be great! Any idea how fast such a feature would take to execute? If it's a true rewind, then it would be a time proportional to the difference in frame count, right?

KevinCalderone commented 7 years ago

It works be saving/restoring the game memory for that gameloop. How far you jump doesn't impact the time. The time is mostly proportional to how many units there are.

Not sure I want to give exact speed numbers yet as we haven't finished optimizing it.

davechurchill commented 7 years ago

Awesome! Looking forward to it :)