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

Re: peer-peer syncronization



On Mon, 10 Nov 2003, Katie Lucas wrote:

> > How can syncronize a game (ie: make two simultaneous events appear 
> > simultaneous to all users) in a peer-peer system, using UDP?
> > (TCP would be slow, and i'd like to avoid the complexity of a client-server 
> > system).
> 
> TCP is **NOT SLOW**

No, but if you send data over tcp, that you rather would not have 
retransmitted, if the packet is lost, TCP handling retransmission is a 
waste, and the update of your distributed state will seem slow. You now 
this, I am just restating it.

> I wish people would stop bloody well assuming things like this. It
> LOOKS slower over broken links because it sorts the packets into
> order and re-requests the missing ones.
> 
> It's only slower if you don't want a guarantee that data will arrive
> and will be in the right order.

Which is often the case for games.

> Look, I'm not saying all these things are solved problems, it's more
> like they're UNSOLVED problems. Not using TCPIP has become a new
> religious statement of the games world. It's held as the same sort of
> unverified truth as using assembler is.
> 
> I keep coming across these things, people who think virtual
> dispatching is too expensive, that TCPIP is slow, that this or
> that. And none of them have actually measured these things or can
> point at the data where someone else has.. where DO all these ideas
> originate from?

John Carmack once wrote something like: "If you even consider using TCP/IP 
for an internet game, clearly you do not know what you are doing". (or 
something).

It is not that hard to build a reliable channel on top of UDP, for those 
events that you do need to make sure gets through (Steves doors, and so 
on).

One thing that has not been mentioned yet, is firewalls. Sometimes it is 
easier to get a hole through for UDP only. At least that is my impression.

To the original poster: There is at least a couple of books on the topic, 
se e.g.: 
http://www.amazon.com/exec/obidos/tg/detail/-/1556228686/104-0784828-0468717?v=glance

You may also consider building your game on top of an engine that does 
networking for you, as say:
http://www.ukuug.org/events/linux2002/papers/html/games/

Mads



-- Mads Bondo Dydensborg.  madsdyd@challenge.dk Geeks aren't interested in
politics because government doesn't double its efficiency and speed once
every 18 months.
                                                    -- Slashdot comment