For my multiplayer strategy game I’m writing, I eventually intend to be able to support around a hundred players on a Pentium-II class machine. I anticipate my game will require about 1kB/second, at most 2kB.
Since this is my first game, I thought it would be easier to use Serialization to send data to my clients while writing (and then refactoring, and then writing, and then refactoring) the rest of the game – just so I would have one less thing to worry about as I get started, you see. The game is really close to getting done, and testing it out with just my client connecting to the server works just fine. I’ve also worked out a Web Start deployment and people have been able to play from remote locations with no problem. However, when two or even three players are playing simultaneously, the server starts acting nondeterminently and, well, slow as hell.
By this point, I have been able to determine that, since the Serializiation bloats my transfers a bit, the bandwith needed is around 4.5kB/second, but that’s no big deal. And on the client end, where I was most worried about objects being spawned out of control by the deserialization, I haven’t really had any performance problems to speak of yet. However, I downloaded the trial version of OptomizeIt, and to my dismay, writeObject is the bad guy! With two clients connected to my server, sending Objects which are generally very simple, writeObject is spawning thousands upon thousands of Objects all over the place! AHHHH!!!
I thought that this would be a good way for me and for other people to take advantage of one of Java’s niceties and ease into multiplayer game development, since that is an area I think really has a lot of potential right now. Unfortunately, all of my hopes are dashed in that direction. In the end I was going to have to convert to sending byte buffers anyway, so it’s no big loss to me, but on the other hand it’s going to be another week or two before I can see my game running
/me weeps