From: Stefan F. <ste...@we...> - 2010-08-15 12:36:43
|
Sorry for not being involved in the discussion before, but I implemented a simple solution offline yesterday. * How it works: I mainly followed Jim's suggestion: The dynamic report window has a comment button, which allows to add a comment to the current action, which is then displayed (in a smaller green font currently) beside the action in the report window. It is stored in Rails game file, thus is still visible after reload. It alllows easy commenting of past events: Simply press the link of the action to be commented, Rails goes back to that situation, add the comment and then go back to the current event. * Implementation: I had the same problem to solve already for the new dynamic report window: Messages are not directly linked to actions, thus there was the need to built that connection. For this I decided not to change anything in the core part of Rails (the action and move mechanisms), but simply use the current movestack index as an identifier for the messages. The same idea works for user comments: A simple Map <Integer, String> links actions and user comments. All user comments are then stored at the end of Rails game file by serializing the map. * Comparison to actions The mechanism currently bypasses the action mechanism of Rails. However it is easy to change it to use a kind of GameAction (similar to Save, Undo etc.), which are not fully qualified actions, as they are not stored in the action stack and thus are not saved and are not undoable. On the one hand I like the idea using fully qualified actions for comments and thus leverage on existing mechanisms for save and undo. On the other comments are not real actions and I fear that if one starts to look into the details they might require different treatment: For example currently going back to a past game action adding a comment action at this point would not allow to go back to the end of action stack without modifying the undo/redo mechanism. This might be not that bad as it sounds, because adding past actions and still be able to redo the action stack is on my wishlist anyhow. But implementing this correctly is not easy due to the requried failure handling in the general case. Stefan On Sunday 15 August 2010 13:21:08 Erik Vos wrote: > OK, but please note, that if we allow players to add messages out of turn, > the acting player name must be added to that action. Without that, the game > engine cannot know that it's not the current player who entered that > message. So we would have to add a player name selection choice list to the > message entry control, unless (in a PBEM game) the local.player.name > property is used. > > Erik. > > -----Original Message----- > From: John David Galt [mailto:jd...@di...] > Sent: Saturday 14 August 2010 21:13 > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] please allow simple player > text-messages/annotations, within main save-file & report window > > Erik Vos wrote: > > This is a very interesting idea, and I understand that such a feature > > would > > > be much more useful that the existing editing option. > > > > The main issue is about the sequence of actions. You say: "Instead, we > > want > > > to be able to simply associate a message-text with each move" and "from a > > user-interface pov, the 'current player' is speaking". If taken > > literally, this would mean, that the message should become part of the > > move*, and > > that > > > the message must be entered _before_ the move is completed and executed > > (by > > > pressing "Pass", "Buy", "Done", "Lay Tile", etc.). This way, we can > > easily ensure that a message becomes part of the move and is logged, > > saved and undone with it. (The messages would always be displayed either > > before or after the existing move text.) > > I like this idea but would make the message a separate "action". (This > might > mean you're allowed to send messages out of turn, or only that each turn in > PBEM games has to end with the "Done" button so that you have a chance to > enter messages before ending your turn.) > > If messages are allowed out-of-turn, then a player who uses "Undo" within > his > turn may have to undo somebody else's message to reach his own action. > > --------------------------------------------------------------------------- >- -- > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > --------------------------------------------------------------------------- >--- This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |