Captive Imagination
July 31, 2010, 11:48:03 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: jSeamless 1.0 Beta 7 is Available http://www.jseamless.org
 
   Home   Help Search Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: GTGE Network with JGN  (Read 4517 times)
0 Members and 1 Guest are viewing this topic.
gr33nl1nk
Newbie
*
Offline Offline

Posts: 13


View Profile
« on: October 04, 2006, 02:35:38 PM »

So how can we develop network games with GTGE and JGN? Any updates?
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #1 on: October 04, 2006, 03:02:51 PM »

Simply download JGN and GTGE-Networking from here:

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

Then take a look at the example using the Swing implementation here:

http://www.captiveimagination.com/svn/public/jgn/trunk/src/com/captiveimagination/jgn/test/sync/SimpleSynchronization.java

The actual changes required to work with GTGE should be minimal, you'd simply want to utilize the GTGEGraphicalController instead of the SwingGraphicalController.

ElZilcho also did some work with this here:

http://www.captiveimagination.com/forum/index.php/topic,95.msg818.html#msg818

Hope this helps. I don't actually do any development with GTGE so let me know if you have any problems, I tried to put it together as best I could with almost no knowledge of the system.
Logged
gr33nl1nk
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #2 on: October 04, 2006, 09:03:12 PM »

wow, ok, i think this is what im looking for, moving an object from one side and the mirror on the other side,
i'll try it with GTGE to see whether this library flexible enough to be used to develop network games with java,
and will discuss it either in GTGE forum or this forum later.

thank you very much,

l1nk
Logged
gr33nl1nk
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #3 on: October 04, 2006, 09:22:26 PM »

hm, where do i have to start with this? can you explain a bit of how the SimpleSynchronization works?

1. why do you create two kind of servers i.e. serverReliable and serverFast?
2. what are rateMillis and rateNanos in register method of ServerSynchronizer?
3. when does the client send the message to the server(after pressing a key) and vice versa?
4. if we are to implement multiplayer more than 2 players, does it broadcast the messages to all the client or can we specify to which client we are going to send the message?

regards,

l1nk

ps: i will be grateful if you can give me some good references about the concept of RTS multiplayer with Java as I am just starting with this topic, thank you.
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #4 on: October 04, 2006, 11:03:22 PM »

1. The two types of servers are because there are two types of messages: the type that must reach its destination no matter how long it takes and the message that needs to arrive as fast as possible but if there is lag or some other problem isn't critical to necessarily be received at all.

Synchronization messages fall into the second category.  They are consistently sending updates on the position so that if a message is dropped there's always another one following right behind, so it's not a big deal.

2. Those refer to the delay between messages.  You can specify an amount of time in milliseconds + nanoseconds to delay between the send of each message.  This determines the importance of this object to be synchronized.  For example, something like the player in a game would need to be updated far more frequently than something much less important to the game play.

3. When you register your objects you then no longer have to think about when they are updated.  You've started a thread that will update the other machines for you and you can simply worry about your game instead of thinking about updating the connections every time a change is made.  You can see that in the SimpleSynchronization example.  After I register the two objects I am able to simply move around the objects locally not thinking about networking and the synchronization system takes care of sending updates.

4. Yes, if you use the ServerSynchronizer updates that get received by it will broadcast to all other connections.

I'm about to head to bed but hopefully this will be a good starting point for you.  I would take apart the SimpleSynchronization to fully understand how that works and perhaps go through some of the other tests in JGN core to understand the system better and what it can provide to you.
Logged
gr33nl1nk
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #5 on: October 08, 2006, 09:38:31 PM »

Phew, just came back from busy days, anyway, ok, ic that this is like TCP and UDP right?
you use TCP for reliable server and UDP for the other, am i correct?

then are you saying that, say, RTS Multiplayer use updates on position of each unit rather than sending commands of each player? which one is a better approach?

then about registering objects.. what if, im going to create a dedicated server and players more than two? Im just curious what actually happens when we register an object, does that mean if an object has been registered on both side(server and clients) then everytime that object is updated, the server will send a message to all the clients, and hence all the clients update all the properties(which have been changed) of the object with the same id?
then what if Im registering two different objects on each side but with the same id?

Btw, do you write tutorials for this library? and one more question, under what license is this project based on?

thank you,

l1nk
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #6 on: October 09, 2006, 11:11:00 AM »

Phew, just came back from busy days, anyway, ok, ic that this is like TCP and UDP right?
you use TCP for reliable server and UDP for the other, am i correct?

Yes, that is correct.

then are you saying that, say, RTS Multiplayer use updates on position of each unit rather than sending commands of each player? which one is a better approach?

Commands are typically a bad way to go (although there are some situations where it makes sense) since for whatever reason if one command is missed then your are perpetually out of sync.  With positional synchronization by using UDP that is not guaranteed delivery you are able to reduce lag considerably as the biggest aspects of lag are typically seen when you've got a latency spike and then messages get stacked up for delivery and then flood through all at one time. This causes the majority of lag you see in a game.  With UDP by sending positional synchronization instead of that flood occurring the messages just simply disapear and once the spike ends the next message is received and is the most up-to-date and jumps to the correct position.

then about registering objects.. what if, im going to create a dedicated server and players more than two? Im just curious what actually happens when we register an object, does that mean if an object has been registered on both side(server and clients) then everytime that object is updated, the server will send a message to all the clients, and hence all the clients update all the properties(which have been changed) of the object with the same id?
then what if Im registering two different objects on each side but with the same id?

Take a look at the example for this. You can register as many objects as you'd like.  You simply register it authoritative on the machine that should send information about this object and register the others simply as receivers.  There is much more available through the synchronization system that can be handled and I would enourage you to look into this further.

Btw, do you write tutorials for this library?

I haven't had a chance to really do much in the way of tutorials yet, but that is something I intend to do in the long-run.  If you are interested in doing so, I have a wiki set up here: http://www.captiveimagination.com/wiki/index.php/JavaGameNetworking that you can create a tutorial on if you'd like and I'd be happy to proof-read it for you.

and one more question, under what license is this project based on?

The project uses the BSD license.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.2 seconds with 21 queries.