Soccer game over the network (openkickoff)

Started by
0 comments, last by hfoucher 22 years, 7 months ago
Dear all, We are currently developing an open source soccer game based on the famous KickOff2 design (www.openkickoff.org). My question is about synchronization. 2 players are playing against each other over the network as shown below: PLAYER1 <==========> SERVER <==========> PLAYER2 (L.A.) (Dallas) (Paris) Our technic is event-based. Everytime something happens, the event is sent over the network to the server and then forwarded to the other player. For example: P2 sends "Zidane starts running from 10,10 towards North". As we know the time separating P2 and P1 (=deltaT, the duration of the packet transmission), we can update P1''s screen and guess that Zidane is know running north and is now at location x=10, y=10-speed*deltaT. OK this works fine BUT sometimes there are bad synchronizations. Perhaps our technic is bad. I don''t know. Do you know famous ways of handling soccer-like games. Should the server in Dallas be a sort of referree ? Should we send all the event to the server and wait for a response (our soccer player would wait until starting running) ? Thanks for your help. herve@openkickoff.org PS: the game is GPLed, you can have a look at current source.
--Herve FoucherHELIO.org
Advertisement
Pretty much all client to server games have the server act as the ''referee''. The general way to do it is for the client to move on the assumption that the server will accept the move, but for the client to correct its movement when the server sends a negative acknowledgement for it. There are many variations on this principle but I think it''s the main starting point.

This topic is closed to new replies.

Advertisement