realbasic-games
[Top] [All Lists]

Re: UDP net play?

To: "REALbasic Games" <REALbasic-Games at lists dot realsoftware dot com>
Subject: Re: UDP net play?
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Tue, 30 Sep 2003 22:32:04 -0500
References: <BB9FB277 dot A2DA%hugh at bigspider dot net>
At 10:21 PM -0500 9/30/03, Hugh Bayer wrote:

Since using multicast is out for internet communication, and a many-person
chat situation is going to involve a server/client setup, what are the
reasons for using UDP over TCP/IP, or vice-versa?

You use UDP when speed matters and you don't need guaranteed packet delivery. It's faster, *because* it doesn't guarantee that packets will arrive in any particular order and some packets may not arrive at all. That's fine for an action game, where the packets are game-state updates; if you get one that represents a state older than what you've already gotten, you just ignore it, and if you miss some here or there it's no big deal.

You use TCP/IP when speed isn't so critical, or when you can't afford to have any packets go missing or arrive out of order. A good example would be a MUD-style game, where your commands need to be received by the server no matter what, and similarly, the server's responses need to be received by you (and in the order in which they were sent).

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>