Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In my opinion the best strategy to approach a turn based game such as this, is to decide on some basic architectural approaches. Diagram out the componenents and some basic game flow diagrams.</p> <p>You should put the bulk of the game engine logic in the server component. The clients should be kept as thin as possible, focusing primarily on</p> <ol> <li>Communication with the game engine</li> <li>Accepting user inputs</li> <li>Interpreting game engine responses</li> <li>Drawing the screens</li> </ol> <p>Your server/game engine should be relatively stateless, yet maintain a list of current game sessions in play. Stateful SOAP web services or even HTTP Servlets would be a good choice because they maintain session for you by placing and reading session cookies in the request.</p> <p>Everything web works on request response so it is by nature stateless, but certain technologies like Java servlets will help you maintain sessions so that you don't have to. No need for physically creating seperate threads, each request causes the application server to spawn a new thread of execution, while the session by nature is volatile.</p> <p>On the server side I would persist all data for a particular active game in the session. In this way, your game engine will maintain the orderly communication between the two players.</p> <ol> <li>Player 1 sends end of turn request with all of the game state change information.</li> <li>Game engine interprets request, makes necessary changes to the game state.</li> <li>Player 2 sends frequent requests to check and see if it is Player 2s turn yet.</li> <li>Game engine acknowledges Player 2 request for its turn and sends the new game state in response.</li> <li>Player 2 receives the response, updates its copy of the game state making note of the changes since its last turn.</li> <li>Rinse and repeat.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload