Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Artificial Latency and package dropping  (Read 3054 times)
0 Members and 1 Guest are viewing this topic.
Offline Tinhorn
« Posted 2013-11-05 13:27:29 »

Wow, i am asking a lot of question recently

But this one just want your opinion

I am using UDP and since it is not reliable i have to test for lag and dropped messages

it is in the vein of
1  
2  
if (rand.nextDouble() > .8)
   ProcessPacket()


is 80 percent dropped packages too high

The reason i'm asking is because it works well under 50 percent but under 80 percent, sometimes the pings don't get to server and client and they time out

Can i expect 80 percent dropped packets when i deploy my game because that would mean i will have to increase the timeout parameters

Offline jonjava
« Reply #1 - Posted 2013-11-06 00:46:55 »

Those are huge drops. I suggest you stick with TCP. Creating a reliable way to handle dropped packets in UDP is cumbersome. It's been done before and so isn't something you need to re-invent however.

Read these articles if you're sticking with UDP: http://gafferongames.com/networking-for-game-programmers/

Offline Tinhorn
« Reply #2 - Posted 2013-11-06 02:06:52 »

Sorry if i wasnt being clear, so ill try to be concise this time
Is 80 percents dropped packages using Udp normal?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #3 - Posted 2013-11-06 02:21:02 »

No, that's way too high. Think about it, why would anyone use UDP if it dropped that many packets?

Offline theagentd
« Reply #4 - Posted 2013-11-06 07:34:33 »

Those are huge drops. I suggest you stick with TCP. Creating a reliable way to handle dropped packets in UDP is cumbersome. It's been done before and so isn't something you need to re-invent however.

Read these articles if you're sticking with UDP: http://gafferongames.com/networking-for-game-programmers/
UDP is useful when packages quickly get outdated and a dropped packet here and there isn't a problem. This is usually the case for movement in action games. If you're sending 30-something packets per second, there's no point in resending a single lost packet, since a more up-to-date packet hopefully arrives soon anyway. If you actually need a guarantee that all packages get delivered and arrive in order, you should definitely use TCP. There's no point in attempting to implement your own most likely inferior version of TCP unless you know exactly what you're doing when there's a perfectly fine TCP implementation available. Just remember to turn off Nagle's algorithm if you're doing real-time games.

Myomyomyo.
Offline seismic
« Reply #5 - Posted 2013-11-06 09:56:59 »

Also, depending on your send rate I guess but the usual packet loss for UDP is around 0% Smiley
I don't think there is a game that can compensate for 80% packetloss and still look good.
Offline delt0r

JGO Knight


Medals: 27
Exp: 18 years


Computers can do that?


« Reply #6 - Posted 2013-11-06 11:21:53 »

These days its typically almost no packet loss or reordering.. Or you get close to no packets at all and your wasting your time. There are some exceptions with some wireless stuff. But typically this is all hidden in lower layers of the stack as well.

Did you know that upd still can fragment packets and wait for them if the MTU size is smaller than packet size? 

Perhaps its too late. But really always start with TCP and only change if there is a really really good reason to. With UDP you need to know about flow control, congestion collapse, and the 2 generals problem at a minimum. Considering it took experts in the field years to get this all right in TCP, it pays to use that expertise and experience. 

I have no special talents. I am only passionately curious.--Albert Einstein
Offline theagentd
« Reply #7 - Posted 2013-11-06 14:56:02 »

Also, depending on your send rate I guess but the usual packet loss for UDP is around 0% Smiley
I don't think there is a game that can compensate for 80% packetloss and still look good.
Well... I have a friend who happens to have the most flakey ADSL connection I've ever seen. We can basically turn invincible as long as he's the one driving in Planetside 2. Aiming the turret attached to a mega-stuttering buggy is a bit hard though. xd

Myomyomyo.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (42 views)
2014-10-16 15:22:06

Norakomi (32 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (85 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!