I’ve finally got a version of the new Saved Game Updater running to my satisfaction. I’d just like to review what I’ve done and how it works and lay out a few issues for discussion.
The new Updater is invoked by a player directly from the menu and applies to the currently open game.
It replaces each piece with a new piece, created from the same PieceSlot it was originally created from. The original PieceSlot is found using the GamePieceId (GpId) that is displayed in the Piece Definer and saved with each piece. If no match on GpId can be found, then it will use a PieceSlot whose GamePiece has exactly the same Type (i.e. same traits with same options)
There is one main limitation :- You cannot update any pieces in the game that are Hidden or Masked by other players. In this case, your opponent would also have to refresh the game. This shouldn’t be a problem for standard scenario setups as these do not normally begin with ‘owned’ pieces.
Some questions to ponder:
What is the best way to invoke the updater? Currently, I have added a new menu next to File and Help named Tools that has the single entry ‘Refresh Counters’. I’m not sure if we will ever have any more ‘tools’ - I don’t like menus with a single option!
What other facilities are needed? I’m thinking a ‘Batch’ mode fired off from the Editor that will load each pre-defined setup in a module in turn, refresh it, then replace the old version with the refreshed version.
What sort of error reporting do you need for counters that cannot be refreshed due to no matching PieceSlot? Just list them in the Chat Window? Or in a report in a Dialog box at the end of the update run?
I don’t know that it makes sense to put it in the module manager. I was thinking a ‘Batch’ mode update of a module would be initiated in the Module Editor, which also has an existing Tools menu with the current Game Updater options on it. This would seem the logical place.
However, the option to ‘Refresh all counters now in the current game I am playing’ option really does seem to belong in the Module Player. The other option I thought of was to add it to the Help menu. Or even in the Preferences dialog.
Hmm. Hold on. Is there any reason to present this as a menu item at all?
Why not show the user a dialog asking whether to update the counters when
the user loads a saved game containing old counter definitions?
No, this could be done by checking when each piece is added to the map (AddPiece command) whether it’s Type matches the Type of the PieceSlot that originally created it.
However, I think we will still need an option to do this manually. For example, 2 players online using a module with masked counters who agree to update their game, each need to run the update in turn.
Wouldn’t that require saving metadata of the Module version to the saved
game / log and then comparing upon load up if that saved meta data version
is older than the current in use module?
Seems like a can of worms there if your depending on module designers to
a specific version/revision system that works with the code unless you
enforce that also