I need to write a server for an action game, which needs fast communication with the client. There will only be one server, and I'll split the world in zones. The client will be written in Java using jMonkeyEngine and in my opinion I should write the server in Java as well. I don't want to implement any low-level features such as communication, reliable udp, etc.

Is Java the most appropriate language to write an action game server which will run on Linux? Is there a Java library which provides a high-level interface for network communication?

  • \$\begingroup\$ Gool'd : code.google.com/p/fireleg \$\endgroup\$ Jun 29 '11 at 15:43
  • 1
    \$\begingroup\$ There can only be one! \$\endgroup\$
    – House
    Jun 30 '11 at 3:02
  • \$\begingroup\$ @Byte What do you mean? \$\endgroup\$
    – Anko
    Jul 6 '11 at 21:47
  • \$\begingroup\$ Ah, well the question has been edited now, is said "There must be only one server", just made me think of Highlander. Totally off topic, sorry. \$\endgroup\$
    – House
    Jul 7 '11 at 1:32

For an action game, you'll want a library that supports synchronization (keeps the players positions' in sync across all the clients and the server). Of course, you'll also want basic messaging features. With this in mind, here are a couple of Java libraries that might work for you.

  1. SpiderMonkey. It's part of jME3, and I'm guessing it's one of the more popular networking libraries for jME. It supports sending and receiving messages, serialization, compression, synchronization via UDP, among other things. Also, it seems to be the standard networking library for jME games these days.
  2. JGN. It's basically like the other libraries, but it's more mature. It supports synchronization, and a bunch of other features like remote objects, shared objects, and streaming. Although it is no longer being actively developed and it's difficult to get support, it's quite a mature library.
  3. Kryonet. It supports RMI and basic messaging. The only problem with this is that it doesn't support synchronization, so it might be a little bit of a hassle. However, it seems to be quite active, so it might be more robust than the other options.

Just a note: It's probably better to have a server for each zone/map. With only one server JVM supporting the whole game, if anything goes wrong, the whole game will go down. If you have multiple JVMs running each zone/map server, one error won't bring down your entire game.


I would highly recommend using a commercial socket server (with a free version for development) for real-time games, they're built for scalability and have been optimised to handle a large number of concurrent users. We've developed socket servers for several of our games, but they never scale as well as commercial socket servers.

Commercial Servers:

ElectroServer 5 (Java)

Photon (C++)

SmartFox Server: www.smartfoxserver.com/2X/ (Java)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.