Help a networking noob

Okay, I want to make a 2 player 2d side scroller, kind of like metal slug, with 2 people playing over a network. I just want to know the simplest way to do this, with good tuts and documentation so I can get something good down without all of the hassle of a complex networking engine. I don’t care about speed either.

thanks

Well, it looks as though they are having some site issues at the moment, but I’ve heard a lot of good things about GTGE:

http://www.goldenstudios.or.id

I can also recommend JGN (Java Game Networking), a networking library meant specifically to simplify the process of game development with networking and it even has a module for use with GTGE. However, if you decide to use JGN but end up with a different 2D library that JGN doesn’t provide let me know and as long as it’s even modestly popular I’d be happy to make a connector module for it. However, it does also support Swing if you decide to use it.

You can get more information about JGN here: http://javagn.org/

It looks cool, but it doesn’t look like JGN has a lot of documentation. How is java.net for games? I saw a tutorial here: http://gpwiki.org/index.php/Java:Tutorials:Simple_TCP_Networking and it seems really simple to me. Is it suitable for games, like fast enough and stuff? And what other options are there?

It is best not to use standard networking for games as it is blocking. JGN uses non-blocking IO. Here are some examples of how to use the NIO features in Java:

http://java.sun.com/javase/6/docs/technotes/guides/io/example/index.html

The problem with NIO is it’s overly complicated, although it is extremely powerful.

JGN does lack good documentation, but makes up for it with examples in the code. You can see dozens of examples of usage here:

http://svn.javagn.org/core/trunk/src/com/captiveimagination/jgn/test/

If you want, I wrote a small 2D scroller fighting game using RMI for network (under GPL) :
http://membres.lycos.fr/javalution/download/fighting.zip