This discussion is archived
3 Replies Latest reply: Apr 27, 2010 3:49 AM by gimbal2 RSS

UDP vs. TCP in Real-time Multiplayer Game Design

794459 Newbie
Currently Being Moderated
I realize this is a broad question and that every game is different, but I wanted to see whether, folks here that have launched real-time multiplayer Java games in the past, you ended up using UDP, TCP, or a combination thereof. Generally I would think that UDP is the way to go for real-time games, but lately I've been realizing that more and more my UDP implementation is starting to need TCP features. I wanted to see what everyone's experience with trying to use UDP or TCP has been like.
  • 1. Re: UDP vs. TCP in Real-time Multiplayer Game Design
    gimbal2 Guru
    Currently Being Moderated
    I've read Many (with a capital M) of these discussions, and the end result is always a stalemate. TCP has too much overhead, UDP is not reliable enough. It really depends on the needs of the game and how much and how often you will be pushing data through the line to know which of the two will work the best, there is no one answer for all situations. Sometimes TCP's overhead is not a problem sometimes UDP's unreliability is not a problem, sometimes a reliable layer on top of UDP is the best choice.

    This discussion does not relate to Java specifically by the way, so if you want to read some discussions on this matter, do a more global search for TCP vs UDP. A search of this forum will also yield you some (recent) results.
  • 2. Re: UDP vs. TCP in Real-time Multiplayer Game Design
    794459 Newbie
    Currently Being Moderated
    I usually Google before I post - don't know why I didn't do that for this post. Sorry.
  • 3. Re: UDP vs. TCP in Real-time Multiplayer Game Design
    gimbal2 Guru
    Currently Being Moderated
    no need to apologize, no harm done.

    To make my post at least somewhat useful, I'd like to add this standard link I tend to post in threads like this. Its the forum FAQ of the gamedev.net networking section. It has a ton of information that can help you get to the answer you seek:

    [http://www.gamedev.net/community/forums/showfaq.asp?forum_id=15|http://www.gamedev.net/community/forums/showfaq.asp?forum_id=15]

    Good luck!