Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A few things to consider:</p> <ul> <li><strong>Java NIO is really good</strong>, and can handle the kind of throughput/latency you are looking for. Don't use any of the older networking / serialization frameworks and APIs</li> <li><strong>Latency</strong> is really important. You basically want a minimal layer over NIO that allows you to send very fast, small, inidividual messages with minimal overhead.</li> <li>Depending on the game, you may want <strong>TCP or UDP or both</strong>. Use TCP for important messages, UDP for messages that aren't strictly necessary for the game to proceed or will be subsumed by a future update (e.g. position updates in a FPS)</li> <li>Some people implement their own <strong>TCP-like messaging protocol over UDP</strong> for real time games. This is probably more hassle than it's worth, but be aware of it as an option if you <em>really</em> need to optimise for a specific type of communication</li> <li>For real time games, you are nearly always doing <strong>custom serialisation</strong> (e.g. only sending deltas rather than full updates of object positions) - so make sure your framework allows this</li> </ul> <p>Given this, I'd recommend one of the following</p> <ul> <li><a href="http://code.google.com/p/kryonet/" rel="noreferrer">Kryonet</a> - lightwieght, customisable, designed for this kind of purpose</li> <li><a href="http://www.jboss.org/netty" rel="noreferrer">Netty</a> - slightly more enterprise-oriented, but very capable, robust and scalable</li> <li>Roll-your-own based on NIO - tricky but possible if you want really fine grained control. I've done this before, but in retrospect I probably should have picked Kryonet or Netty</li> </ul> <p>Good luck!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload