load/save game state

(cherry picked from commit b73e6d6ab970baccdb82fda7aa7b74d52bc1056c)