Page 1 of 1
Game State?

Posted:
19 Aug 2013, 05:53
by spr
In the Dev menu there is an option - Setup Game State - in which you are asked to select a game state file. This sounds like it could be very useful but how does one go about generating such a file in the first place? I am not aware of any Save Game State functionality.
Thinking out loud, how useful would it be if you could somehow serialize the game state and include it in the error report? And if you could save the game state, how difficult would it then be to include undo and even replay functionality.
Cheers,
Steve
Re: Game State?

Posted:
19 Aug 2013, 07:28
by moomarc
The devmode game state files refer to hand created txt files for scenario setups. It is not a full game state. The info on the files can be found in
this thread (the possible params are in the first post).
Edit: There's also a section in the wiki
here (I think Sol originally compiled it there)
Re: Game State?

Posted:
19 Aug 2013, 07:42
by Max mtg
It should not be a significant problem to have the game serialize the current board state to a chunk of text in that very "game-state" format. Might come handy to reproduce bugs and run some test scenarios.
Keep in mind though, that this format assumes stack is empty and never stores any 'remembered' information (like chosen colors or imprinted/exiled cards)
A commonly used approach to implement undo & redo functionality is the Command pattern. Thus, to estimate what it would take, try to design a set of commands firstly.
The commands themselves would be a fine improvement for Forge. But I fear to think of the what it would take to code them being done and un-done.
Re: Game State?

Posted:
19 Aug 2013, 08:03
by moomarc
AFAIK, those game state files also don't work for multiplayer formats as they only assume one opponent.