Captive Imagination
August 01, 2010, 12:07:47 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Check out the teaser site for the first official game by Captive Imagination: http://www.galaxiesbeyond.com
 
   Home   Help Search Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Help understanding and working with synchranization  (Read 588 times)
0 Members and 1 Guest are viewing this topic.
Eggsworth
Newbie
*
Offline Offline

Posts: 15


View Profile
« on: October 15, 2009, 09:39:08 PM »

Hello. I reverse engineered the Flagrush synch stuff, so I basically have my own sphere which i can move around on the box and when the sphere reaches the extent of the box, he gets teleported back to the middle. I have successfully connected clients together and gotten them to see eachother.

But now is where I run into my problem, I decided, rather than in the format of Flagrush which is client/server connected to other clients, i wanted simply a server which connected to clients.

The problem here was that when I run my server, i dont want an instance of the game to come up, but all my efforts to do so have been met with "Unable to find object: 1 on Server" for the first client, and "Unable to find object: 2 on Server" for the second client.

Following the code from Flagrush, how would I rip the "game" part out of the server while still utilizing the synchronization? Or is this even possible?
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #1 on: October 17, 2009, 07:55:01 AM »

Well, the synchronization system is designed around the idea that there will be a scenegraph running on the server with all the game logic, so to that end you'll always have to have an instance of the game running there.  However, like in the case of jME you can use a DummyDisplaySystem (at least that's what it used to be called) so that the game can run on the server in headless mode.  The problem you get if you try to remove the game logic from the server entirely is that if there is a disparity who does it rely on to be right?  This also complicates determining if someone is cheating.
Logged
Eggsworth
Newbie
*
Offline Offline

Posts: 15


View Profile
« Reply #2 on: October 17, 2009, 12:12:24 PM »

hmm you are right. i never thought about that.

The main problem I have been extrapolating with a client running on the server would be the unnecessary memory used, but, in the long run I guess you are right.
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #3 on: October 17, 2009, 12:42:47 PM »

It's something I've struggled with as well, and for a AAA title you'd probably want to do things a bit differently, but this is more the poor-boys' approach to programming safe networked games. Smiley
Logged
Eggsworth
Newbie
*
Offline Offline

Posts: 15


View Profile
« Reply #4 on: October 17, 2009, 12:51:56 PM »

well i am actually thinking about making this client on the server useful. so i think i will make a control panel for the server and on one of the tabs have the actual display system and make the servers 'player' invisible so i can fly around and watch while other people play.

So, its not all bad Smiley
Logged
Eggsworth
Newbie
*
Offline Offline

Posts: 15


View Profile
« Reply #5 on: October 17, 2009, 04:40:41 PM »

JMEPhysicsGraphicalController:

I got it to pretty much work, but there is one problem: If I register a player on the server's client, and then if I connect a client I get the error:
Code:
java.lang.ClassCastException: com.captiveimagination.jgn.synchronization.message.Synchronize3DMessage cannot be cast to com.captiveimagination.jgn.synchronization.message.SynchronizePhysicsMessage

But, this only happens when the server has a registered player. If the server does not have a registered player, I can connect clients all I want with no errors and they see eachother just fine.

So, I dont know if you would want to use this, but I am offering this simple demonstration of physics synchronization for if you want to put them into the addon as a sort of demonstration for new people, if not that is also OK.

What I would really like to know is why do you think I am getting that odd error if I register a player on the server?

Here are the files btw:
http://www.mediafire.com/file/wnty4wanyjh/JGN_JME_Physics.zip
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #6 on: October 18, 2009, 12:52:56 PM »

Well, I would recommend taking a look into the source and see if you can determine what's happening.  It sounds like the controller is sending 3DMessages in some circumstance instead of the PhysicsMessages it should be sending.  If you are interested in contributing a fix let me know and I'll give you commit access to the repository.  I'm kinda looking for someone to take over JGN anyway since I've mostly moved over to Scala now and will probably be developing a new networking system in there in the near future.
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.182 seconds with 20 queries.