MultiMachine Truckin FiledOn: [phylum]doc>MultiMachineTruckin.tty 1) Initializing the game: At some point we may want to have a description language to describe the state of a gameBoard at any point during the game. However, initially we will use the fact that the entire gameboard is generated deterministically (for a given Loops-Truckin version) from a single random number seed. Therefore, to get the game board initialized the same way on multiple machines, the only information that needs to be sent around is the initial seed. The needed remote call is: (NewGame randomSeed boardType gameType) To make a player one needs to specify the truckType, (className of truck) and the driver (label for the truck). (AddPlayerRequest localMachineID driverName playerClass truckType ) ****(In the following, some old vocabualry is used. This file has not yet been updated to use the new terms, User Interface, Simulation, Decision Module, and Communication Interface. Machine Configuration The game is actually run (the truth about the world is kept) in one machine. Let us call the gameMaster who runs this game the WorldMaster. The WorldMaster is the one who fields requests from the players to Buy, Sell, and Move, and who causes the GasTruck and Bandits to move, and who specifies the maximum move for any vehicle on each turn. Any other gameMaster who is following the game remotely let us call a SlaveMaster. The Slavemaster forwards requests from any player(s) on the machine, and receives messages that cause it to update the world. Two distinguished solutions to the updating problem occurred to us: Message centered updating and ActiveValue centered updating. Both would pass messages between the WorldMaster and the SlaveMasters through a Postmaster, which ensures communication without delaying the WorldMaster. In message centered updating, messages describe high level changes to the world. In activeValue centered updating, changes to appropriate instance variables of objects are passed across as messages, and receivers determine what to do on the basis of these changes of values. Details of Message Centered Updating In this style the WorldMaster sends to the SlaveMasters messages indicating what has happened in the game, from the point of view of the semantics of the game. The following are the messages (not including the two from above): (MoveMade playerName fromStop toStop reason penaltyAmount missTurns) reason is one of NIL(as requested), Bandit, WeighStation, NoFuel, UnionHall, OffBoardBeg, OffBoardEnd, ConsecMoves, IllegalLoc, MoreThanAllowed, AlreadyThere, NoRoom, LowFuel, NoRoomStayPut, BanditMove, IncorrectLoc, GameOver and is stored in Truck IV location:,reason fromStop is included for redundancy as is roadPosition below (BuyMade playerName roadPosition requestedQuantity quantity reason penaltyAmount fragility lifetime ) reason is: NIL (as requested), InsufficientCash, IncorrectLoc, NotProducer, Zero, MoreThanAvailable, InsufficientVolume, InsufficientWeight, GameOver (SellMade playerName roadPosition requestedQuantity quantity cargoPosition reason penaltyAmount) -- cargoPosition is specified as position in cargo list reason: NIL (as requested), IncorrectLoc, NotConsumer, CannotBuyZero, InvalidCommodity, NotOwned, MoreThanOwned, PerishedGoods, TooMuchQty, PriceHigh, GameOver (GasFill prevPosition newPosition newQuantity newPrice) (BreakCargo playerName cargoPosition) (SpoilCargo playerName cargoPosition) (MaxMove playerName maxMoveSize) (AddBandit name) (AddPlayer localMachineID playerName playerClass truckClass deniedFlg) (RemovePlayer playerName reason) (NewGame seed boardType gameType) (ReUseGame seed) (StartGame beginTime endTime) (ParkedAtAlice player time) (GameOver) The following messages are sent from a SlaveMaster to the WorldMaster: (MoveRequest playerName fromStop toStop systemReason) systemReason: NIL (user request), AliceTurn, AliceTime (BuyRequest playerName roadPosition requestedQuantity) (SellRequest playerName roadPosition cargoPosition requestedQuantity) (AddPlayerRequest localMachineID playerName playerClass truckType) (BeginGameRequest ) (NewGameRequest boardType) (ReUseGameRequest) (RemovePlayerRequest playerName reason) reason: NIL or LocalRequest (user request), Active Value Centered Updating In this scheme, active values would be placed on all appropriate variables to send the change. To communicate between machines, it might be useful to give canonical names to many objects. For example, the roadstops could be RS1, ... RS78. The players have their drivers name, and the trucks are named Truck. When a commodity is created a message is passed which specifies (CommodityClass postmaster is an implementation of the postmaster functionality you requested. (Unfortunately, I've had to spend most of this past evening finding and changing parts of EVALSERVER to accommodate the new changes in fugue, so it's not very well tested) It assumes that the worldMaster will be doing (REMOTEVAL '(ForwardTo Harry (MoveMade ...)) 0) That is, ForwardTo and ForwardToAll are NLAMBDAs, and the worldMaster needn't wait for any results. On the otherhand, Register and Unregister generate errors for various conditions, so it would be wise for their usage to be like (REMOTEVAL '(Register GamePlayers Harry 240) ) Both Register and Unregister are NLAMBDAs too. There is as yet no "hair" in it, but it can easily be added; e.g., grouping a bunch of messages together into one big PROGN, if there are multiple messages queued for some machine; or statistics and record keeping (beyond the basic DistributionList maintenance).