XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Netowrking prediction sample, TCP or UDP?

Last post 05-08-2008 3:45 PM by Brandon Bloom. 4 replies.
  • 05-07-2008 7:44 AM

    Netowrking prediction sample, TCP or UDP?

    Hi, I currently disecting this example and i am trying to work out if the packets are being send with UDP or TCP and if there is a way for you to choose which you want to use for each piece of information? Can anyone tell me more about this and also explain a little more about the sample? I am very interested in XNA it is a great tool kit, and i want to better understand it.

    Nicola.

    Why game when you can code?
  • 05-07-2008 8:49 AM In reply to

    Re: Netowrking prediction sample, TCP or UDP?

    Live Networking is based on reliable-UDP. There's no way of choosing to use TCP instead, after all, it has little (or no?) benefit once you've added optional reliability and sequencing to UDP. What about the sample do you need explaining?
  • 05-07-2008 1:18 PM In reply to

    Re: Netowrking prediction sample, TCP or UDP?

    See here for more about the available delivery options.

    TCP is rarely a good choice for games, hence why we don't use it. It's a stream based protocol, which means later packets will always be held back until earlier ones have been delivered, but in a realtime game it is usually better to just discard earlier packets as they become obsolete as soon as more recent information is available. Mixing TCP for just the reliable things with UDP for everything else is horribly inefficient, as you would then have to pay double the packet header cost, so it ends up better to just always use UDP for everything.


    XNA Framework Developer - blog - homepage
  • 05-08-2008 6:17 AM In reply to

    Re: Netowrking prediction sample, TCP or UDP?

    Firstly, I read you're blog, its very good!

    Secondly, I am studying Computer Games Technology in england, and I am doing a OG networking module. The module is based on DirectX, which is sort of inconvienient for me as i have been using XNA all semester and have only made one game in DirectX (2D scoller with diobolical AI).

    All the information you have given me is really useful for my coursework ;P!

    I have known previously about the TCP and UDP protocol's but we are taught that using a mixture is the standard, but as with much of the content within our course, i am finding that this is out of date! So thank you very much for your help :)

    Why game when you can code?
  • 05-08-2008 3:45 PM In reply to

    Re: Netowrking prediction sample, TCP or UDP?

    Nicci Sixx:
    as with much of the content within our course, i am finding that this is out of date!


    That's the nature of this business: Everything little bit of tech is out of date the moment it's conceived :-)
    Brandon Bloom

    Software Design Engineer
    XNA Community Game Platform
Page 1 of 1 (5 items) Previous Next