Commands

The heart of a turn-based game is about exchanging information between the players and the moderator :

  • player orders
  • game state updates
  • action results

Orders, updates and results are called commands.

Orders

Every turn players make actions according to the game rules to try and modify the game state in the purpose to reach a winning condition.

Player orders actually map player actions and are sent to the moderator.



fig. 1 Order

Updates

The game state is held by the moderator but a read-only copy may be maintained by the player.

Of course a player only receives allowed information as defined by the game rules (a view of the game state).



At the beginning of the game, the moderator creates the game state and sends each player an initialization view.

Later as the game state gets modified, the moderator propagates updates to players when required.



fig. 2 Update

An update can be seen as a quantitative information about what happened.



Updates split into two different modes :

  • complete : a new valid game state view is sent
  • incremental : only the changes in a game state view are sent

Choosing the proper update mode during the game lifetime depends on the needs.

Result

Whereas an update reflects game state modification, a result gives indication on how and why this modification occured.



fig. 3 Result

A result can be produced even without any game state modification : it can be seen as a qualitative information about what happened.

Example

Consider a turn-based game in which three players fight : they have a number of hit points and can attack another player once per turn if they want (the only possible action).

The game state is defined by players health, example :

player1 has 20 hit points.

player2 has 20 hit points.

player3 has 20 hit points.



The view of the game state for a player is his own health and a condition state for other players, example :

player1 has 20 hit points.

player2 is in perfect condition.

player3 is in perfect condition.

This is the initial game state view for player1.



Each turn players can send orders to the moderator, example :

player1 attacks player2.

This is an order from player1 to the moderator.



player1 misses player2.

This is a result from moderator to all players.



player1 hits player2 on the arm.

This is another possible result from moderator to all players.



player2 looses 3 hit points.

This is an incremental update from moderator to player2.



player1 is in perfect condition.

player2 has 17 hit points.

player3 is in perfect condition.

This is a complete update from moderator to player2.