Jump to content

  • Log In with Google      Sign In   
  • Create Account


Game causes lag on VoIP


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 m41q   Members   -  Reputation: 151

Like
0Likes
Like

Posted 08 March 2012 - 01:05 PM

Hi,

the thing is this:
The networking of my game works relatively good (using java and udp (DatagramSocket)), but I have an issue when testing it with my friends over Skype or Teamspeak and I don´t have an idea why that is so.
We are connected using hamachi (it simulates a LAN-connection) and there is no lagging at all in the game, but every time the client tries to send data to the server, skype skips a some millisecs, causing great lagging so I´m not able to understand what my friend is saying at all.

For me it looks like sending a package over udp takes relatively long and blocks skype from using the connection in this time.
If you need some code, calling the method looks like this:
data = new byte[....];
....
DatagramPacket sendPacket = new DatagramPacket(data,data.length,HOST_IP,SERVER_PORT);
socket.send(sendPacket);
The maximum size of an udp-package is 1024 in my application; is this to big?
Or is there another, better way of sending packets using udp?


Hope you have suggestions on this,
thx in advance

Sponsor:

#2 hplus0603   Moderators   -  Reputation: 4886

Like
1Likes
Like

Posted 08 March 2012 - 03:48 PM

1024 bytes is too long if you're using a 56kbps modem. It's not a problem if you're using a megabit-upload cable modem, assuming you're only sending a few of those per second.
enum Bool { True, False, FileNotFound };

#3 m41q   Members   -  Reputation: 151

Like
0Likes
Like

Posted 09 March 2012 - 07:59 AM

1024 bytes is too long


Well, 1024 is the maximum, usually those packets are not so big (150 bytes or so).
But thx anyway, i will run tests as soon as possible and post the resuluts.

#4 m41q   Members   -  Reputation: 151

Like
0Likes
Like

Posted 09 March 2012 - 08:20 PM

ok, I changed the maximum size to 310 and it indeed works, but still not as good as I wanted it to be.
Maybe i will consider splitting the packets to 2 or 3 more if they meet the new maximum size.
Still thx, I really thougt 1024 bytes would be little enough by far...

#5 hplus0603   Moderators   -  Reputation: 4886

Like
0Likes
Like

Posted 10 March 2012 - 01:51 AM

What is your upstream speed? How many of the packets do you send? To how many other players?
The problem might not be the size of each packet, but the total bandwidth used.
enum Bool { True, False, FileNotFound };




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS