[messages] [Module Design] Independent, Non-linear UNDOs

dsdhornet david.a.fenton at gmail.com
Sat Apr 26 17:36:02 CEST 2014


Not 100% on this, but regarding the logfile.

I believe that Vassal doesn't just remember the starting position in the
game save or logfile.  It also relists the states of any affected piece
or variable after every action.  Hence by hitting the UNDO action, it
doesn't have to work things in reverse (which would be buggy), it just
moves affected pieces back to the previous state.  When logging, it
simply adds the new states.  By hitting UNDO, you are not 'UNDOing' the
log action, but adding a new state or action corresponding to the post
UNDO of an action.  This is vital because otherwise someone could sit
there and undo and redo dice rolls until they got a favorable result,
and their opponent in a play-by-email game would be none the wiser.

One thing you might be able to do:  

a.  Add a trigger which moves every piece back to the "starting
location" while storing final location, clearing move trails, etc.
b.  Add a second trigger which moves every piece to final location (and
possibly clears starting location) while enabling move trails.

1.  When the impulse starts, move all your pieces.  
2.  When done, trigger the move back to "starting location" (all pieces
should be as they were at beginning)
3.  Start logging.
4.  Trigger move to end location.  All pieces will jump to end location.
5.  Roll dice, etc.
6.  End log.
7.  Repeat.  

The only issue is that you would need 2 log files per move (one for each
impulse) so that you can skip logging the move part.  I would strongly
recommend using move trails, as trying to figure out and verify 200
simultaneous piece moves based on just beginning and end position sounds
incredibly difficult.  Alternatively, you could just start the log after
moving your pieces (and skip the back and forth thing), so that when the
log is opened, the pieces will already be in post-move position.

Remember also, if you actually played a board game in person, your
opponent would be watching you make each of 200 moves (and moving them
back if you changed your mind, if that was even allowed...in many games
once you let go of the piece and start moving another, you can't take
something back).  If in-person you would use a screen, that's the same
as only sending the final layout.

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=44692#p44692


More information about the messages mailing list