[osg-users] Loading scene over network

Aaron Kruger krugman25 at hotmail.com
Wed Jun 17 08:15:29 PDT 2015


I was hoping to avoid coming into the forums to ask this question but I can't seem to find the resources I need, so here I am.  Let me lay some quick groundwork before I ask my question.  I am looking to create a game mod for an open source game engine that so happens to use OSG.  I am a software engineer and my past experience with game engines is in Unity3d.  This is a bit different than my experiences since Unity has all of that built into it's package, where as the game engine I plan on modding is built on individual libraries to handle specifics such as physics, graphics, audio, ect.  To add in networking I plan on using Raknet or Ice.

My question then is how would a game scene on Client B's computer update and stay in sync with the scene on Client A's computer.  Just some extra information to narrow the question... The approach would be coop mode where Client A loads an instance of the game and his game also becomes the server.  Client B connects to Client A's game instance.  What are others experiences to the best way to handle loading Client B's scene and keeping it in sync with client A.  Again i'm not talking about how to handle the network layer, I already have that covered.  More specifically how to work with OSGs scenes when things are updating remotely.
In my mind it would seem that events, scripting, calculating damage, etc is all running on Client A's game instance.  Client B's game instance is just graphically displaying the game and any events, attacks, trigger that occur on client B's machine are just being sent over to Client A for calculation.  So Client A really is the work horse.  For example if Client B presses W to move forward, Client B's movement script isn't actually ran, but rather the key press is sent over to Client A's game whos movement script runs and then updates the movement on Client A's machine.  That movement on Client A game is then sent over to client B as x,y coordinate update to keep visual in sync with Client A.

Does what I just described sound correct?  Also what may that look like down in OSG?  If I am way off track please let me know.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64108#64108








More information about the osg-users mailing list