Re: Log Out Issues

From: Alun Jones [MSFT] (alunj_at_online.microsoft.com)
Date: 09/03/04


Date: Fri, 3 Sep 2004 09:53:13 -0700


"Callum Winter" <callum@REMOVE_THISwinter9999.fsnet.co.uk> wrote in message
news:#IKmfFakEHA.3520@TK2MSFTNGP11.phx.gbl...
> I would be quite happy to use TCP to save headaches, but from every source
> ive read during my learning, UDP is the way to go for internet games.
> Apparently the extra overhead in TCP can cause a lot more lag in your
game,
> especially in the MMORPG variety where a mass of data passing is required
to
> keep everything running.

The reason for this extra lag is that packets are retried in order to assure
reliability of transport.

UDP is faster, in this context, mostly because it doesn't care so much about
lost packets, but also because it doesn't aggregate data to improve network
performance.

Let's create a fictional example - you're tracking a player moving through a
game location by sending his coordinates to the server every tenth of a
second.

If the network has a little hiccup, and you're using UDP, all that happens
is that you'll miss one or two location updates, and the player will appear
to stop, and then suddenly jump. Since it's on the tenth of a second scale,
it won't matter that much. On TCP, by comparison, it'll retry and retry and
retry and then finally send, so while the effect is the same, the TCP
connection would have sent, say, twice as many packets.

Often, the solution is to use UDP for data that can be lost, but needs to be
delivered quickly - and not retried if it does get lost; and to use TCP for
data that absolutely must arrive, and must arrive in sequence.

> If you can confirm that these comments are out of date then ill move over
to
> TCP, but I ask why do most top online games use UDP for their protocol if
> TCP were better.

I think you need to go find some books on network programming (particularly
if you can find one suited for games). Network programming is _not_ easy.
It's particularly not easy to get _right_. "Most top online games" use a
network specialist to do their network programming. Since you don't have
that, it's possible that you won't achieve similar performance by simply
trying to mimic the large-scale choices that you can see, while missing the
small-scale choices that you can't.

> I already have reliable/ordered/multithreaded communication, I just need
> help with this one logging out/message passing problem. I must at least
try
> the fastest method before I give in and move to the simpler but slower
> method of communication, as speed will effect the total number of players
I
> can have per hosting server.

That's one way to look at it - the other is to determine where your
bottlenecks are before trying to contort your code in order to solve
bottlenecks that might not exist.

> Do you know of any good resources that at least give some varied solutions
> to this problem.

For general network development, try "Network Programming for Microsoft
Windows, Second Edition" from Microsoft Press, written by Anthony Jones (no
relation) and Jim Ohlund. A quick search at your favourite online book
store should result in a few good matches for network game development - you
should be able to find one that suits you.

You could also go with an already-created solution, such as DirectPlay.

Alun.
~~~~



Relevant Pages

  • Re: Stand Alone DHCP Servers and Windows 2000
    ... On our network the clients are allowed to talk to the domain controller ... Kerberos-Sec (UDP) ... Microsoft CIFS (TCP) ... which segments and which computers use specific protocols. ...
    (microsoft.public.windows.server.networking)
  • Re: Kerberos UDP vs TCP
    ... The main reason for using UDP by default is that it's lightweight compared ... UDP starts having problem if the network is not reliable, i.e. busy network, ... slow links, or has packet loss. ... The advantage of using TCP is that it uses ...
    (microsoft.public.security)
  • Re: Kerberos UDP vs TCP
    ... Various network devices and improperly configured network cards are what I most often see screwing up the UDP packet delivery. ... TCP does add a good amount of overhead and I would recommend doing a network impact study before considering switching whole hog to TCP. ...
    (microsoft.public.security)
  • Re: logging in but then loss of domain connection
    ... > It sounds like the workstation is unable to find the Domain controller. ... > happens if you connect the laptop to the network using a network cable? ... We have seem issues whereby the UDP ... > Kerberos to use TCP by making a registry change. ...
    (microsoft.public.windows.server.sbs)
  • Warcraft 3 Frozen Throne Cannot Make Games
    ... the PORTS not being opend, but I opend all the Zone Alarm ... the same thing no one can join my games. ... I tried mutliple ports the default 6112 tcp and Udp 4000 ...
    (microsoft.public.games)