[MUD-Dev] UDP Revisted

Brian Hook brianhook at pyrogon.com
Tue Oct 16 11:02:50 CEST 2001


Brian Hook wrote:
> Amanda Walker wrote:
 
>> Why bother with the TCP layer at all?  Since there is going to be
>> some data that must be sent reliably (and in order) during active
>> game sessions,

> But is there, really?  In a real time game, what you want is to
> keep the client and server in as accurate sync as possible, not to
> reproduce as accurately as possible a particular byte stream.

Sure, there are tons of things where ordering is important.  The ones I
can think of off the top of my head:

  - chat: you don't want text messages to show up out of order,
  which could make some conversations unintelligible

  - sequenced actions: arm wand, cast spell.  If those events are
  out of order, you'll get a "Can't cast spell, you're not holding a
  wand."  followed by "You hold your wand."

In some cases, the results could be catastrophic when you have a
very sequence dependent series of actions.  For example, in EQ you
would have "drink healing potion", "use mana stone".  If you're
about to die and those commands get reversed, you've just killed
yourself.

Now, the vast majority of traffic -- position and orientation
updates -- aren't going to need to be handled in order, you'll
typically just eject out of order updates and interpolate as
necessary.  But there is going to be a constant stream of commands
that will need to be guaranteed and in order.  My feeling is that
piggy backing this on top of UDP instead of using a TCP side channel
will give better and more predictable performance.

> Mainly, because the type of reliability you want for real-time
> data is not always the kind of reliability you want for sequenced
> data.

Very good point, which kind of got lost in the mix.  Differentiating
between "reliable" and "reliable and in order" is important.

> Using a homegrown reliability scheme for stuff suited to TCP can
> be just as annoying as trying to use TCP for real-time traffic.

Quite true -- don't reinvent the wheel.  Unless, of course, the
wheel you have is too small and not round enough or doesn't fit on
your car.
 
> TCP and UDP are useful for different tasks, just like screwdrivers
> and hammers.

Aye, well put.

Brian

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list