Game State?
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Game State?
by spr » 19 Aug 2013, 05:53
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
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?
by moomarc » 19 Aug 2013, 07:28
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)
Edit: There's also a section in the wiki here (I think Sol originally compiled it there)
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Game State?
by Max mtg » 19 Aug 2013, 07:42
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.
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.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Game State?
by moomarc » 19 Aug 2013, 08:03
AFAIK, those game state files also don't work for multiplayer formats as they only assume one opponent.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 62 guests