Results 1 to 20 of 20

Thread: UDP or TCP?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    UDP or TCP?

    Would UDP or TCP be better for a multiplayer online game?

    I dont know which to choose.

    Thanks

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    hi
    Coz I'm MCSE2000 , I can answer you :

    if you have these two choices :
    - UDP rovides an unreliable packet delivery on top of the IP protocol.
    2-TCP : The Internet is based on TCP/IP.More reliable than UDP.

  3. #3
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803
    Where is the opponent ? in the same network or anywhere on the internet ?

    If on the same network... you can try UDP, but UDP does not ensure the packet delivery... and you are linited to the size of the packet...

    I would use TCP because the packet gets to the other computer for sure, and it does not matter where the computer is and how many networks the signal goes through...

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    well , my first post was general info just to get started .

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Now that these two have given you the parameters of these two communication protocols which you probably found in MSDN help....

    Almost all online multiplayer games use UDP to transfer in-game data. And in fact, DirectPlay uses it exclusively. TCP/IP connections may be used for initial connection to a server, to transmit player name and login/password...

    If you play games alot, you'll notice sometimes people say,' I killed you, and you say, man you didnt even fire at me', well thats UDP... small overhead, less server resources, every grand once in a while, a packet gets lost, but its hell alot more reliable than MSDN would lead you to believe.
    Last edited by nemaroller; Nov 3rd, 2002 at 03:33 PM.

  6. #6
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    I'd use TCP.

    You maintain a connection rather than do it on-the-fly.

  7. #7
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Basically,

    If your game is going to be serving more than 2-3 players, you should defintely use UDP...

    1) it requires less bandwidth

    2) it doesn't choke and sit retransmitting when a packet gets lost (because it doesn't care)....resulting in less latency...

    Look at this, it should help you decide:
    http://www.exhedra.com/DirectX4VB/Tu...P_Lesson01.asp
    Last edited by nemaroller; Nov 3rd, 2002 at 05:14 PM.

  8. #8
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391
    nemaroller is right. If you expect to have several people playing this game at the same time, you should use UDP..unless the game is something like Internet Poker or something..then use TCP/IP.
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  9. #9
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    The major differences are the guarenteed packet delivery, and the connection itself.

    With TCP/IP, packets are GUARENTEED to arrive. Therin lies the problem for games. That guarentee causes a TCP/IP connection to be slow.

    With UDP, there is no connection. Period. UDP simply fires off packets, and hopes that A) The packets arrive, and B) The destination is actually waiting for packets. This means that the destination need not reply to those packets to say that they did or did not arrive correctly.

    In the end, It all comes down to the game itself. Fast paced action games will want to use UDP, and slower, turn based games wll generally use TCP/IP.

    And this thread doesnt belong in this forum.

    Z.

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    To get this post answered , sure you have to get some info about DirectPlay since this concerns Online Gaming and stuff.

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    I suppose the best solution to my problem is to use UDP, with tagging system in the packets.

    For the packets that must be recieved, it will send info back to say that the computer got it.

    For other packets though.. it will not check.

    That should work better then all TCP/IP

    Right?

  12. #12
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by Evan
    I suppose the best solution to my problem is to use UDP, with tagging system in the packets.

    For the packets that must be recieved, it will send info back to say that the computer got it.

    For other packets though.. it will not check.

    That should work better then all TCP/IP

    Right?
    A better solution might be to keep a TCP/IP connection open for required packets, AND use UDP for the un-required packets. Writing your own guarentee system will be far slower then using the system built into TCP/IP.

    Z.

  13. #13

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    Originally posted by Zaei
    A better solution might be to keep a TCP/IP connection open for required packets, AND use UDP for the un-required packets. Writing your own guarentee system will be far slower then using the system built into TCP/IP.

    Z.
    Good idea!

    Im VERY glad I asked. This is giving me alot of info.

    So what ill do, is ill have 2 ports open... One for the Required,
    one for the not...

    Anything else i need to know?

  14. #14
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    I have a thought.

    Would the TCP/IP latency really matter for a VB based game?

    The latency of the connection wouldn't be a problem unless the game could achieve some killer framerates, and we all know for such things you'd need a C++ graphic engine, probably with some ASM too.

    A game like Quake3, with 300 FPS, yeah latency is an issue, but on a game not even getting say 30 fps, what's the point? I'd pick stability over a small latency decrease.

  15. #15

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    Originally posted by DiGiTaIErRoR
    I have a thought.

    Would the TCP/IP latency really matter for a VB based game?

    The latency of the connection wouldn't be a problem unless the game could achieve some killer framerates, and we all know for such things you'd need a C++ graphic engine, probably with some ASM too.

    A game like Quake3, with 300 FPS, yeah latency is an issue, but on a game not even getting say 30 fps, what's the point? I'd pick stability over a small latency decrease.
    My core engine IS C++ and ASM. And it runs about 60fps rendering 24 models with 3000 faces each.

    =)

    VB is just doing processing... no real calculations

  16. #16
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Originally posted by Evan
    My core engine IS C++ and ASM. And it runs about 60fps rendering 24 models with 3000 faces each.

    =)

    VB is just doing processing... no real calculations
    Decent. Just this is General VB... so I assumed....

    What's the game about, if you don't mind me asking.

  17. #17

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    Not at all...

    This is something I wrote up a couple weeks ago.

    Based around pet grown, and character growth. IM going to include a huge database of all the 1000's of transformations of the different pets.

    The idea is when you start growng a pet, depending on how much you feed him, and how much exp hes getting from the fights... he might transform into one of 3 or 6 new creatures. Some will be very rare and powerful as they get tword the top of the chart.

    Fighting system will be simple. Some characters will have alchemy. Which will be the Direct Damage, Healing, Dots... ext. Others will be completely warrior types. The pets will all fight along side the character that they are attached to.

    Im sure there will be people on my game that JUST grow and sell the pets. Being Im going to allow character to character trading of weapons, armor, items, and pets.

    Now with the main idea explained. Im not going to focus to heavily on graphics. Im going to have one main look for each character, and when they switch weapons, the new weapon will appear. But as for Armor, there will be no appearence changes.

    Posted Screen Shots:

    http://www.vbforums.com/showthread.p...light=universe
    http://www.vbforums.com/showthread.p...light=universe
    http://www.vbforums.com/showthread.p...light=universe

  18. #18
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Cool.

    Can't wait to play it.


  19. #19
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    did you DL that engine from PSC?

  20. #20

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    Originally posted by kleinma
    did you DL that engine from PSC?
    Naw. Its at www.TrueVision3d.Com

    Very very good product. Forums are active. and Beta 3 is almost done, when that comes out ill start beta testing my game. )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width