spectacol icon indicating copy to clipboard operation
spectacol copied to clipboard

Network playing

Open bog-dan-ro opened this issue 7 years ago • 3 comments

Network playing is useful to play games like Xeno (http://www.worldofspectrum.org/infoseekid.cgi?id=0005787) with your friends. Currently I see two ways to do it: I. the game will run only on host, the host sends the screen updates to the client and the client will send only the keys/joystick events. Using some kind of fast compression it might be enough to play the games smoothly.

  • pro:
    • easier to implement
    • we can connect to any host/client even behind the gateways using UDP hole punching
  • con:
    • if the client's packages are lost, then the client's input events are lost too, this might lead to problems.
    • it requires a bigger bandwidth than the next solution.

II. the host sends a snapshot to the client which is used by the client to start from the same position, then all the input events are synchronized between host <--> client.

  • pro:
    • all the events will be in sync
    • it will be much less data to send between client <--> host
  • con:
    • harder to implement
    • in order to be sure all the events are received by the parties we'll need to use TCP, therefore the server must have a public IP or the client & the server must be in the same network.

Personally I'd like to go with the first option ...

bog-dan-ro avatar Sep 04 '16 18:09 bog-dan-ro