[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: network game ?

Dave Fancella wrote:
If I were doing network game, I'd want it to look something like this:

* Client-server
* Both players give orders to their pieces and send these orders to the server
* Server resolves the orders (some potentially complex initiative system would be used to resolve conflicts)
* Server checks victory conditions, productions, repairs, etc.
* Server sends a complete update (probably a savegame) to each client

But this doesn't mean that a peer-to-peer mode shouldn't exist. Sending the play-by-email infos as packet over any possible transport layer (email, TCP/IP, Bluetooth, IRDA) from one client to the other wouldn't be a big deal but brings up a lot of fun.

The packet could look like:
offset content description
0 start packet id // to mark the beginning of a crimson packet
4 packet type // game state or acknowledge
8 unique packet id // unique for each game state, used for acknowledge
12 crc value // crc16 over the whole packet for error checking
16 size of game state // size of following data
20 zipped .sav file // the game state itself

Client 1 sends the save state until either the user aborts or the other site repsonses with an acknowledge packet. Then client 1 listens for the new state from client 2 until it arrives, then it is acknowledged and used, or the user aborts.

any coments?


  Henk Jonas
  Palm OS ® certified developer

  metaview@xxxxxx                                   www.metaviewsoft.de