Skip to main content
gamedev.net
🔒 Locked

Game causes lag on VoIP

Started by GameDev.net Mar 8, 2012 at 7:05 PM 3 replies 3k views
Original Post
GameDev.net
GameDev.net
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
hplus0603
hplus0603
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 };
hplus0603
hplus0603
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 };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.