Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33
  1. #11
    Join Date
    Mar 2004
    Location
    Manchester, England
    Posts
    319
    I think that was a good and detailed explanation of the situation jjguzzardo. I have only limited knowledge when it comes to networking but I think you made the comparison very clear. Good job

    Your idea is dumb!

    @njl - YEP

  2. #12
    Join Date
    Jan 2010
    Location
    Buenos Aires, Argentina
    Posts
    148
    Quote Originally Posted by Kwest View Post
    UDP is best in terms of gaming where you need to transfer data fast. You can always order your packets and have dropped packets resent. TCP is better for things where speed is less crucial and accuracy is needed like e-mail, instant messaging etc... If we used TCP for online gaming It would be horrifically slow, especially in fast paced environments it's always better to just check if a packet was dropped, and try to resend it.
    Mmmm actually you can't resend packets with UDP unless you do some sort of buffer with some hashing check or something weird like that. But theres no need for packet retransmission. if you need to retransmit a packet in a Realtime Game you'll be getting annoying problems anyway.

  3. #13
    Join Date
    Mar 2009
    Location
    Bellevue, WA
    Posts
    803
    You actually can resend packets, you just have to check the order in which the packets were received and if one is sent out of order you can drop it and resend it(you can attache an ID to each message you send and check it on the client side). I've done this already. Or if a packet is out of order you can just drop and not resend it all together depending on what you are actually trying to do, it's all up to you as the developer to design it to work the way that works best for your particular needs. The point I was trying to make originally is that TCP is not suited for games when data needs to be transmitted fast, and if it's something that absolutely needs to get there in order then you should use TCP vs UDP where packets are sent out of order, it's up to you to say set up the server to reorder these if you want to. Or you can just attach an id to a message you send and have the client check the id number and if it is not the proper id number drop it, I have done this as well. I've always used UDP with games and the only time I used TCP is when I built a Instant Messanger chat. yes most of the time in games, a packet would not be resent, but you can do it.
    " Imagination is the preview of life's coming attractions " - Albert Einstein
    " If you can't explain it simply, you don't understand it well enough." - Albert Einstein

    My Website: http://www.gamedevlounge.com/

    If any post is informative please provide positive feedback by clicking the star below.

  4. #14
    Join Date
    Mar 2009
    Location
    Bellevue, WA
    Posts
    803
    I'm sorry I didn't give enough clarification of above. When I talk about ordering, dropping packets that are out of order and resending them, which some games will do. I did not give a good example of what I meant, so let me clarify. This is how I do it, I attache an ID(value) to a message. When the client receives this message he then checks the ID of the current message by grabbing the first 4 bits of the message usually (unless I need a larger range of ID's), against the incoming message. If the ID of the current message is less than the previous messages ID it is dropped. If the current messages ID is greater than the previous messages ID then we keep this message and handle it accordingly depending on the messages type (which I define again using bit flags in the message) this message then becomes the clients previous message against which all other incoming messages ID's are compared allowing me to give some type of order in which things are to be handled, since UDP doesn't send messages in order and since messages can get dropped. Also if the ID is greater than the previous message I can also have a check (if I wanted that would see how much greater it is than the previous message if I wanted to do it sequentially and have it dropped, and flag it to be resent, but more than likely I wouldn't do this otherwise I would just use TCP since order and delivery is more important when using TCP
    " Imagination is the preview of life's coming attractions " - Albert Einstein
    " If you can't explain it simply, you don't understand it well enough." - Albert Einstein

    My Website: http://www.gamedevlounge.com/

    If any post is informative please provide positive feedback by clicking the star below.

  5. #15
    Join Date
    Jan 2010
    Location
    Buenos Aires, Argentina
    Posts
    148
    I agree with you about UDP being the coice I prefer for MMOs. I dont know if packet ordering is the way i would go cause I think it could lead to packet injections. Nevertheless one problem I'm seeing right now in some MMOs (like Lineage) is the packt flow they have. Every action is a packet that leads to a very large amount of packets being sent and recieved and that cause probllems in some ISP that have a very low threshold for packet storms or DDoS avoiding.
    Dunno how Photon handles this.

  6. #16
    Join Date
    Mar 2009
    Location
    Bellevue, WA
    Posts
    803
    Dunno how Photon handles this
    I'm not sure either I guess we'll find out when we cross that road and Buzz leads the way. I have only done winsock and unix programming on a few projects with my own facade(wrapper). I have yet to use RakNet or Photon. I've had a few buddies use RakNet and they loved it, but I personally don't have experience with either API and just saw over on unity that they implied that Unity works well with RakNet. I was just curious why Buzz went with one over the other and it's clear why.
    " Imagination is the preview of life's coming attractions " - Albert Einstein
    " If you can't explain it simply, you don't understand it well enough." - Albert Einstein

    My Website: http://www.gamedevlounge.com/

    If any post is informative please provide positive feedback by clicking the star below.

  7. #17
    Join Date
    Nov 2009
    Location
    Dallas, Texas
    Posts
    170
    Very true, however, for non realtime data you might need some TCP like features. This is where you can build layers on top of UDP for these specific situations.

    P.S. thanks segfault!
    Last edited by jjguzzardo; 02-09-2011 at 10:56 PM.

  8. #18
    Join Date
    Feb 2003
    Location
    Trondheim, Sør-Trøndelag, Norway
    Posts
    178
    UDP is a good choice for games when it comes to sending packets with high speed, I'd even dare say it's essential for shooter/fast-paced games, but the extra features in TCP do make the job easier for developers, at least at the start of development. Often enough, you will find TCP to be sufficient for an MMO if it's "slow" enough in terms of data transfer. World of Warcraft for instance, uses TCP ( source: http://tinyurl.com/46etf9r ).

  9. #19
    Join Date
    Nov 2009
    Location
    Dallas, Texas
    Posts
    170
    Quote Originally Posted by timespin View Post
    UDP is a good choice for games when it comes to sending packets with high speed, I'd even dare say it's essential for shooter/fast-paced games, but the extra features in TCP do make the job easier for developers, at least at the start of development. Often enough, you will find TCP to be sufficient for an MMO if it's "slow" enough in terms of data transfer. World of Warcraft for instance, uses TCP ( source: http://tinyurl.com/46etf9r ).
    I was fortunate enough to have lunch with a blizzard employee when he was visiting a friend I work with in the office. We had a very brief conversation about this because I'm very interested in MMO networking tech. I was told they use all the protocols, HTTP, UDP, and TCP. However, my understanding is that for the real-time component of the game they mostly still use UDP. Between the game servers and the database they use HTTP and then TCP is used for things that require security and I don't have much more info than that. I personally, don't see how TCP could work for the real-time component of games for the following reasons:

    1. Performance
    Without getting too technical, the problem i see with TCP for real time games, is that when a packet is dropped it has to stop until the packet is resent. The new packet is then queued up, and not accessible until it is received on the other end. This basically adds up to 2 round trips to process a dropped packet, one to figure out what needs to be resent and another to send the new packet. Depending on your ping, this sending and resending can take anywhere from 0.25 to 0.5 seconds and if the resend fails, it could take longer. For real-time data this is totally unacceptable especially when the result of a dropped packet, in a real-time game, will just result in the game running a little choppy until the packet loss issue is corrected.

    2. Scalability
    TCP requires a persistent connection, which doesn't scale very well because a server has limited resources. The stateless, connectionless nature of HTTP is the reason web servers scale so well. The only time you're connected to the web server is when you submit an HTTP request. However, while you're looking at the web page you are not connected to the server. You're simply reading a web page that has been downloaded on your computer. Then when you click a button or a link, you connect to a server long enough to request a new page. If web servers used TCP you would be connected to the server the whole time, even while you were just reading content and scalability would suffer. UDP works in a similar fashion in that it doesn't require a persistent connection. It works by broadcasting packets to subscribers which is far more scalable than TCP.

    Granted, there are operations in an MMO that require the security and reliability of TCP but I think for the real-time component, which is most of the stress on the network for MMOs, UDP is the best choice.
    Last edited by jjguzzardo; 02-10-2011 at 11:34 AM.

  10. #20
    Join Date
    Nov 2001
    Location
    Dickson, TN
    Posts
    5,649
    Quote Originally Posted by jjguzzardo View Post
    ... I was told they use all the protocols, HTTP, UDP, and TCP. However, my understanding is that for the real-time component of the game they mostly still use UDP. Between the game servers and the database they use HTTP and then TCP is used for things that require security and I don't have much more info than that.
    UDP, RUDP (a photon layer on top of UDP), TCP and HTTP were all used with great success in the MMO Tech Demo and will be used again in our actual MMO. One of the most important decisions we'll need to make that will affect both network traffic and server cpu load will be which region-based algorithm we use, i.e. Square Tile, Triangulation of the World Space, Ray Visibility, Hexagonal, etc.

    There's been some great posts in this thread! Keep it up guys.

    Buzz

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

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