JavaGameNetworking API

Alright everybody, I've put together a pretty generic and incredibly simple API for doing game networking in Java.



This initial contribution is going to be the building blocks for my OdeJavaNetworking API but should be basic enough to be implemented for any game.  This is an event-driven architecture and the message objects for creating and receiving are still a little more complicated than I would like them to be in the long run and would very much like some constructive criticism here.



If you check the test folder you'll find a very basic test implementation of this API.



I have made the project available through one of my Subversion repositories, the details on connecting follow:



svn://pyramex.com:3691



Connect anonymously and you should have the ability to read from the repository.  Check the project out from JavaGameNetworking/trunk and for those of you that are using Eclipse you can just check it out as a project and it should pick it up.  This is a JDK 1.5 required API developed under Eclipse 3.1



BTW, if I get a lot of messages asking for this to be put on CVS I'll set up a project with SourceForge or Java.net, but this is just a lot easier preliminarily for me.



I'll have the really useful API coming hopefully by this weekend for the OdeJavaNetworking API and I'll post a message here when it's ready.



Comments and suggestions very welcomed.



Thanks,



darkfrog

What's the pros/cons of using this as opposed to Narya?

I would say this is a more generic, more extensible framework than Narya.  To be honest I have never used it, but from looking at the API docs I think it's probably perfect for what ThreeRings games do, but I'm looking for a higher performance system for real-time synchronization from clients to server (and back).  This provides a messaging system streamlined to only include absolutely necessary information for your game so as to minimize bandwidth usage.



My API is quite small and extremely simple.  I would definitely appreciate feedback from someone that has used Narya.  If I am wrong then I'm happy to acknowledge it and switch to Narya myself.  :slight_smile:



The larger purpose of this API is to be the foundation of a larger API I am developing for physics synchronization over the network.  I am trying to simplify synchronization to the level of the client only requiring the following code in the client:



ONClient client = new ONClient(world, host, port);

client.start();



This would validate to the server and then would send events down to the server and receive synchronization requests from the server.  The server will be an instance of an OdeJava World I will have a utility for outputting the PhysicsWorld to an XML representation of the OdeJava World and that should keep from having to do any duplicate coding for the server.



darkfrog

One big thing I've noticed about the Narya networking API as well is that it uses TCP Sockets instead of UDP.  I'm sure that was the right decision for their games, but because of the real-time synchronization necessity for a first person shooter UDP is an absolute necessity.  I've been reading a lot on game networking and anymore it seems that nearly all games that require real-time synchronization use UDP for their messaging.  This was one of the reasons it took me a bit longer than I had originally planned to get this functional was because I'm extremely fluent doing TCP communication with Sockets, but UDP I had only used a few times so there was some learning involved. :slight_smile:



darkfrog

Per,



To that end I still need to get that getWorld() method approved so you can use my awesome OdeNetworking API. :o



Thanks,



darkfrog

Great!



This will be perfect if I ever leave the concept stage of some games I've got planned :slight_smile: