P2P Networking

This is primarily aimed at darkfrogs JGN API.


Maybe sometime in the near future :smiley:

I never intend to waste my time trying to create support for P2P MMO…it's an oxymoron. :-p

Security is non-existent in P2P (at best really complicated) and should never in my opinion be leveraged for MMO.

However, I am actually currently developing a Client/Server model using JGN for my own MMORPG that will be part of JGN when it is more stable.

Thought as much.

Darkfrog, I'd like to use your JGN in the near future in conjunction with jME but currently without Physics.  I gather than your game uses all 3 API's.  But how much effort is it to handle collision using JGN and synchronising the outcomes of these collisions with the clients?

In jME-Networking there is no inherit support for collisions.  However, if you were to implement collision support on both the client and server everything should work fine without the need of having any knowledge of collisions in the networking.  There is straight 3D sync code as well as some dead-reckoning support if you're interested in going that direction.

I think I'll have too, there'll be a lot of collissions going on which will have to be handled server side.

since the networking does synchronization though you can simply provide collisions both client-side and server-side and add checks to make sure they don't get too far out of sync on the server side (to avoid cheating or messed up clients).  This way you can better hide lag since the client side can continue to function in the world as they know it (rather than many systems which you start floating through solid objects) and when it's corrected the server can re-sync you if you're too far off.

Excellent idea, frog.

Regarding Galaxies Beyond, how many times a second do you sync with the client for movement (for example)? I haven

The ships synchronize to the server about ten times per second currently but I may be adjusting that over time.  However, the server synchronizing to clients adjusts based on proximity and priority so bandwidth isn't wasted for things far away and leaves the room for closer objects.  If a ship is sitting right in front of another ship it gets updated about ten times per second.  I have gone up to fifty times per second with several connections and haven't seen any hardships though, but I'm concerned about server bandwidth as connections grow.  It will be something I just have to adjust over time as I gather statistics on network utilization.

I was hoping to build a similar function into my Game, but if you're intending to include this functionality into JGN in the near future then that'd be great.

Thanks for the heads up.

Everything I've mentioned is already implemented in JGN. :slight_smile:


One addition however, can you specify hotspots for a particular user to received more frequent data from specified objects within the vicinity of that point?

For example, I wish to render view ports of users that another user has chosen to track.  So a camera displays their in game representation on the HUD, even though they may be half the map away.  As such I will need frequent updates of those objects (and those close to them).

The way the synchronization system is written you can extend it yourself to provide that functionality specific to your game.

Great stuff!

I haven't actually used JGN yet (  :expressionless: ) but from what Ive heard its a good piece if kit (I've been following a lot of Networking posts).

If you want p2p there's always http://www.javaworld.com/javaworld/jw-10-2001/jw-1019-jxta.html (JXTA).

@darlfrog I understand that you don't like p2p solutions because of the security reasons but this doesn't change the fact that p2p is sometimes the ONLY solutions

for some projects unless you have the money to pay for 2000-3000 servers.

Typical rule of thumb is to be leary of any networking API that wasn't explicitly designed for use in game development.  I've got a lot of experience in both game networking and non-game networking and they are two completely different beasts.  Just a word of caution if you're planning on using that API.

Well since the API uses sockets and your api uses sockets I can't see any reason why not mix them. JGN could just use whatever socket connection given to it, if it's a P2P

socket it wouldn't even know about it. Sounds easy but I'm sure there would be plenty of problems.

If you set up your own P2P network I'm sure performance would be good. Many of the API's that we're using are not designed for games (sockets, NIO for example) but they work well in games anyway.

Hi @ all.

Try a look at jgroups-api

Its very easy to use and very flexible in configuration.