[Toss-devel] Starting vs. Current Structure in .toss Files
Status: Beta
Brought to you by:
lukaszkaiser
|
From: Lukasz K. <luk...@gm...> - 2012-03-11 21:25:39
|
Hi. Recently, we had some problems with the meaning of the structure after MODEL in a .toss file. The problem comes from the fact that some time ago it used to be the *current* structure - the last state of the play. But since we use play history, this changed to the *starting* structure of the game. To make this clear, I changed the .toss file syntax in my last commit - it now expects "START" instead of "MODEL". After the above, it should generally be clear - but there is a looming performance problem. Because now, to reconstruct the current structure from a .toss state representation, we need to repeat all the moves. In general, this is fast and not a problem if the file is used just for saving the games. But we also use the format for client-server communication at present - and with 1s for suggest and after 40 moves it might start to be a problem. My current idea is to make another printing function, which prints the state together with a MODEL followed by the current structure - and in such cases, to use the current one instead of re-making all moves. But maybe I should change "MODEL" to some other name, like "CURRENT"? Or maybe some other idea will be better? Write what you think! Lukasz |