Efficient network communication

A few years ago I made a simple multiplayer space shooter game with Panda3D’s network packet classes.

The network communication was very slow. I had to fit the information into the packets like placing 50 pounds on a backpack and only send the strictly necessary information through them.

Still the communication was slow for two players and for four players it crashed.

The server was in one of the player’s machine, probably that could have affected.

I was thinking of using JME game engine because Java might have better tools for network communication, but I like Panda more, so I would like to find a way to have good network communication.

For those who have made multiplayer games in Panda3D, what have been your experience with network speed? Has it been good?

What are the best set of tools/strategies to have fast network communication in Panda 3D?

All my netcode so far is for city simulation games so my issues have been different. That being said it sounds like you were sending constant position updates for ships and weapons fire (if I am wrong could you be more specific?). What one should do instead is send changes in speed and rotation.

Weapon speeds are also know, so all the clients and server needs to know is where the shot happened and what direction.

Also, have you looked into the distributed network code?

did you forget to disable en.wikipedia.org/wiki/Nagle%27s_algorithm when using TCP? Nagle is great for data but kills games if using TCP.

panda3d.org/reference/python … 3c43cbd56d

You mentioned java for communication, here is a short info on an interesting combination:
discourse.panda3d.org/viewtopic … t=darkstar

It’s a working project done at ETC that uses Project Darkstar as a server for panda3d clients.

I’ve played a little bit with their demo and it’s not slow but it’s not really suited for a fast-paced space shooter, so if you decide for a different approach or solution please do tell.

I’ve also had trouble with Panda’s networking. I used the plain old PyDatagram + ConnectionReader/Writer system, so I can’t speak for the distributed networking code.

My code attempts to send 20 packets of data per second, with each packet containing anywhere from 40 to 250 bytes (plus IP and UDP headers). Bandwidth rarely exceeds 3 Kb/s.

Yet, the client only reports about 10 to 15 packets per second, on a LAN network. I’m not sure where the bottleneck is, but I do think there’s something there. Note that separating the network code into a daemon thread seemed to help. Also I used zlib compression to cut the data size down. My game doesn’t use delta compression, but it does stop sending data for an entity when the entity stops moving.