Simulation of packet transmitting delay for game benchmarking/stressing

Hi,

I am developing a real time internet multi-player game (that I hope release it soon).

Unfortunately, I have only one computer and I can’t really test the game on several machines (Lan or internet).
I developed a small piece of code to induce fake lag on connection:

Currently the delay (lag) of every packet is computed randomly according to a Gaussian distribution (with different possible parameters). This is a simple and practical choice, but I am sure that I can be more accurate.

Do you know if any other distribution that would better fit the actually internet distribution?

Also, I believe that there is a strong correlation between the delays of packet propagation. If somebody had an idea about that, it would be even better.

Thanks in advance

It would be hard to simulate TCP delay, since if one packet was “dropped”, it would have to stop all other packets, therefore delaying things even more. Maybe you could randomly drop a packet in your simulation, then add the delay of the resending of that one packet to the delay of further packets.

For UDP, I say you don’t do anything more complicated than a constant delay…say 80-100 ms.

There are tools for that, like TMnetsim which gets plugged between your client and server.

For UDP, I’d recommend dropping the occasional packet and possibly delivering them out of order. To get it really realistic, you need a network simulator, which can be hard as balls to configure. I wouldn’t worry about it too much really… it’s better to write more simple tests incrementally than require a massive software installation and configuration just to get tests working.

Thanks for your answers.

ra4king
For the TCP, that is why I was speaking of the correlation between the delays of packets.
For the UDP, it’s kind of the idea of the piece of code I made.

65K
I’ll test that. Thanks

sproingie
I know form experience on some of past games, I learned that you will always get problems with the network if you don’t stress (bugs or conception problems).
The problems are very easy to get with UDP, and event TCP can give surprises.
I my case, I am using Client-side prediction & Lag compensation (+ some other stuffs), and it’s easy to build something that works on LAN by not on average Internet connections.

Anyway, thank for your answers.

I use a program called Network Emulator Toolkit x64 to do these types of things. It is pretty good and has lots of options for delay, packet loss, out of order packets, you name it.

Here’s a random idea: Setup your server on a different computer in your house and connect to it through a proxy on a different continent. That should give hundreds of milliseconds of delicious delay + packet drops and random disconnects! =D