New Stuff Coming to JGN

There are many of you that prefer to discuss JGN in here instead of in the JGN forums, so for your benefit I’ll make a link to this post:



http://forum.captiveimagination.com/index.php/topic,381.0.html

I say the posts there, and I see you are still heavily against p2p… if the people demand it, give it to them  :lol:



Bread and circuses  :smiley:

I did that in JGN 1 and will probably do it again if someone doesn't beat me to it, but right now I don't have time to "cater to the masses"…I'm too busy doing that for jSeamless.  :stuck_out_tongue:

As usually happens, I try to add one small thing to one of my APIs and I come up with a far better way to do the whole thing.



I guess the bright side is that the scope is limited to the synchronization system in JGN and doesn't mean JGN 3. :slight_smile:



I've started over working on the synchronization system making it FAR easier and even more powerful to use.  There was a lot of complication that didn't need to be there and manual steps that can be automated.  What this means for game development is something along the lines of:



Server:

... instantiatiate JGNServer ...
// Instatiate a SynchronizationManager
SynchronizationManager syncManager = new SynchronizationManager(jgnServer);
// Instatiate the JMEGraphicalSynchronizer to synchronize positional information - multiple synchronizers can now be used (includes custom)
JMEGraphicalSynchronizer synchronizer = new JMEGraphicalSynchronizer();
// Register your spatial on the server and it will call off to the clients telling them to create the spatial as well. You can extend SynchronizeCreateMessage to provide any
// details necessary for your game. Updates are done every 10ms.
syncManager.register(synchronizer, mySpatial, new SynchronizeCreateMessage(), 10);



That's all you'd have to do on the server to register your spatial and synchronize it across to all clients.  Similarly on the client:

... instantiatiate JGNClient ...
// Instatiate a SynchronizationManager
SynchronizationManager syncManager = new SynchronizationManager(jgnClient);
// Instatiate the JMEGraphicalSynchronizer to synchronize positional information - multiple synchronizers can now be used (includes custom)
JMEGraphicalSynchronizer synchronizer = new JMEGraphicalSynchronizer();
// Register your spatial on the client and it will call off to the server telling it to create the spatial as well (server in-turn tells other clients). You can extend
// SynchronizeCreateMessage to provide any details necessary for your game. Updates are done every 10ms.
syncManager.register(synchronizer, clientSpatial, new SynchronizeCreateMessage(), 10);



I should have all the code finished and check in tomorrow with an updated version of the example for JME to show how it works.  There are actually quite a few more features added to the synchronization system, but that's about the most simple example.

Shouldnt you be finding bugs for the jme release

theprism said:

Shouldnt you be finding bugs for the jme release


haha  :P
theprism said:

Shouldnt you be finding bugs for the jme release


What are you talking about, there are no bugs in jME.  :P

Undocumented features!  :smiley:

Okay, this will be checked in later this week…I got sidetracked on "other" stuff on my day off…I bought FFXII for the PS2 over the weekend and I've become addicted. :o

darkfrog said:

As usually happens, I try to add one small thing to one of my APIs and I come up with a far better way to do the whole thing.

I guess the bright side is that the scope is limited to the synchronization system in JGN and doesn't mean JGN 3. :)

I've started over working on the synchronization system making it FAR easier and even more powerful to use.

The whole authoritative / passive aspect has been removed really.  Rather than having to register on both sides you simply register (authoritative) on the one client and when it is created on the other clients it gets auto-registered passive for you.  It's automagic stuff like that helping to simplify this process a lot.

Ahh I see, yea, that would make it a bit more easier.



However, when adding the refreshtime of a synchronized spatial you automatically declared it Authoritive. If you didn't declare it, it would be registered Passive. Does this mean all spatials will be refreshed at a default interval? Does this also mean that it will be impossible to give different spatials different refreshtimes?



Not that I need such a function though… im curious what solution you used :slight_smile:

Well, I actually follow the same technique that the current JGN synchronization does.  The passive is exactly that, passive. :)  It only listens for changes, it never requests to be updated.  The authoritative registration sends messages out to the other clients at the interval specified (which can be modified by proximity of client to the updating object) and so the passive registrations are updated at that rate.  The only distinction here is that you no longer have to register them, they are registered for you.