• Advertisement
Sign in to follow this  

Game causes lag on VoIP

This topic is 2144 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
1024 bytes is too long[/quote]

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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement