Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
  #1  
Old
kamaz's Avatar
kamaz kamaz is offline
Unicorn hunter
Default Orbiter Master/Slave renderer
by kamaz 08-26-2012, 03:45 PM

Quote:
There's a new game
We like to play you see
A game with added reality

We call it -- master and servant


XR-1 Master/Slave, ready for takeoff. Right Orbiter instance is master, left and center are slaves.



Florida below.



Master and slave MFDs are independent.



Flying over the East Coast. Virtual cockpit on slave, glass cockpit on master.

Edit 2014-01-08. New version (rev28) is available, announcement and list of changes here
Edit 2013-12-29. New version (rev25) is available, announcement and list of changes here
Edit 2012-09-26. The XR2 bug is now fixed.
Edit 2012-09-13. README and release below.

Orbiter Master - Slave
======================

This add-on copies the simulation state real-time from a single master instance to multiple
slave instances. Communication is performed using UDP protocol.

Slave instances run independetly of the master instance, except that the simulation state
(that is, MJD, vessel state and location) is copied from master to slave(s) every frame.

Limitations:

Generally speaking, only the data exposed through VESSEL, VESSEL2 and XRVesselCtrl interfaces
are shared between instances. In particular, it means that:

- (un)docking is not supported (okay, I plan to fix *that* one)
- UMMUs are not supported (will appear differently on master and slave)
- UCGOs are not supported (will appear differently on master and slave)
- some DG-IV-specific features are not supported

This add-on is released under the GPL-2.0 license.

Orbiter Master - Slave launch chekclist
---------------------------------------

0. If you want to run multiple Orbiter instances on the same computer, install and enable
this add-on: http://orbiter-forum.com/showthread....8&postcount=13

1. Unpack the add-on, and edit Config\OrbMaster.cfg and Config\OrbSlave.cfg to suit your needs.

2. Start master instance: start Orbiter, enable OrbMaster.dll module, launch the simulation.
The master will periodically (every 10s) save current simulation state to the scenario named
000MasterSlave. The slave needs this file at startup. If you want to put master and slave(s)
on different computers, put your Orbiter install on a network share or use some other means
to transfer the scenario file to the slave (HTTP, FTP, ...).

NOTE: if waitForClients=1 in OrbMaster.cfg, the master will hang during startup until the
first client connects.

3. Launch orbiter, disable OrbMaster.dll, enable OrbSlave.dll. Load scenario 000MasterSlave
and launch the simulation.

NOTE: NEVER have both OrbMaster.dll and OrbSlave.dll enabled in one instance at the same time!

4. If you notice that the simulation state on the slave diverges from that on master, kill
the slave and restart it as per step 3. This causes a full scenario reload.
Attached Thumbnails
Clipboard07.jpg  
Attached Files
File Type: zip MasterSlave-rev25.zip (64.7 KB, 25 views)
File Type: zip MasterSlave-rev28.zip (64.3 KB, 48 views)

Last edited by kamaz; 01-18-2014 at 10:33 PM.
Reply With Quote
Views 18073 Comments 35
Total Comments 35

Comments

Old 08-26-2012, 04:10 PM   #2
Pipcard
mikusingularity
 
Pipcard's Avatar

Default

Master/slave? Isn't this illegal?

This is probably good for those people who have multiple screens.
Pipcard is offline   Reply With Quote
Old 09-13-2012, 01:10 PM   #3
yagni01
Addon Developer

Default

Cool. How much latency do you see with the slave? Can the slave instance be run on a different machine?
yagni01 is offline   Reply With Quote
Old 09-13-2012, 02:03 PM   #4
kamaz
Unicorn hunter
 
kamaz's Avatar
Default

Quote:
Originally Posted by yagni01 View Post
 Cool. How much latency do you see with the slave?
Milliseconds.

Quote:
Originally Posted by yagni01 View Post
 Can the slave instance be run on a different machine?
Yes.
kamaz is offline   Reply With Quote
Old 09-13-2012, 05:26 PM   #5
streb2001
Orbinaut
 
streb2001's Avatar

Default

I can see uses for this. Are you intending to release it?

Last edited by streb2001; 09-13-2012 at 05:26 PM. Reason: typo
streb2001 is offline   Reply With Quote
Old 09-13-2012, 08:55 PM   #6
Ripley
Tutorial translator
 
Ripley's Avatar
Default

Can we have some more words describing this?
It looks cool!
Ripley is offline   Reply With Quote
Old 09-13-2012, 09:51 PM   #7
kamaz
Unicorn hunter
 
kamaz's Avatar
Default

Well, due to an unexpected change of plans for tonight... See the top post for release & description. (And please thank my girlfriend. The idea was hers.)

If you have any more questions about the add-on, feel free to ask.
kamaz is offline   Reply With Quote
Thanked by:
Old 09-13-2012, 09:58 PM   #8
Ripley
Tutorial translator
 
Ripley's Avatar
Default

Always obey to GFs!
Ripley is offline   Reply With Quote
Thanked by:
Old 09-13-2012, 10:33 PM   #9
streb2001
Orbinaut
 
streb2001's Avatar

Default

Quote:
Originally Posted by kamaz View Post
 Well, due to an unexpected change of plans for tonight... See the top post for release & description. (And please thank my girlfriend. The idea was hers.)

If you have any more questions about the add-on, feel free to ask.
Kamaz, thanks for releasing this. However, if your girlfriend gives you the time, could you recompile it in Release mode? At the moment it is trying to load a debug dll...

Thanks!
streb2001 is offline   Reply With Quote
Old 09-13-2012, 11:07 PM   #10
kamaz
Unicorn hunter
 
kamaz's Avatar
Default

Done, new version (rev 13) attached to the top post.
kamaz is offline   Reply With Quote
Old 09-14-2012, 12:27 AM   #11
Donamy
Beta Tester


Default

Can this be used as windows on different front, sides and rear of an interior virtual VC.
Donamy is offline   Reply With Quote
Old 09-14-2012, 12:36 AM   #12
DaveS
Addon Developer
 
DaveS's Avatar


Default

Can this be used with Orbiter NG and external graphics clients?
DaveS is offline   Reply With Quote
Old 09-14-2012, 01:01 AM   #13
kamaz
Unicorn hunter
 
kamaz's Avatar
Default

Quote:
Originally Posted by Donamy View Post
 Can this be used as windows on different front, sides and rear of an interior virtual VC.
Yes, as seen in the screenshots. The only problem is that you cannot use VC on slave instance to control the spacecraft. Spacecraft must be controlled from master.

Quote:
Originally Posted by DaveS View Post
 Can this be used with Orbiter NG and external graphics clients?
Yes. You can even mix different clients.

Here's how it works. Each Orbiter instance does the rendering independently. I simply copy position, orientation and status of all vessels from master to slaves. So at a given moment, all instances have the same simulation state. What and how each instance renders, is its own business.

You can even have different ships in focus on different instances and watch your docking approach simultanously from both spacecrafts.

Last edited by kamaz; 09-14-2012 at 01:05 AM.
kamaz is offline   Reply With Quote
Old 09-14-2012, 05:18 AM   #14
Ripley
Tutorial translator
 
Ripley's Avatar
Default

Way cool!!
Ripley is offline   Reply With Quote
Old 09-14-2012, 08:58 AM   #15
Face
Beta Tester
 
Face's Avatar

Default

Hy kamaz,

Very cool project! It is a nice alternative to OMP for those who want to have multiple views and/or "streaming" of Orbiter sessions.

Your decision to put it under GPL is also much appreciated. Your code is nicely structured and well thought out.

If you allow, I'd like to suggest small enhancements:
  1. Make your network operations asynchronous to Orbiter's main loop. As it is now, it seems you are sending the UDPs via sendto in a blocking manner. While this won't be an issue with small and few packets, it could lead to indeterministic timing if many clients and/or vessels are present, so low frame rates may be the result.
  2. Use a controller mechanism to bring slave MJD in sync with master MJD instead of just setting the acceleration/discrete time. If you like, you can take a look at how I do it in OMP.
  3. Instead of using an open frame design with start and end messages (using the first as time frame and the last as buffer synchronization), you could embed the time info in every packet. It won't increase your packet size too much and makes the frame consistency code more simple. As it is now, you could encounter situations where a client may always find an end message with following vessel messages in the buffer (due to e.g. buffering on the route), leading to strange artifacts. It would mean that you'll always have some packets missing (most prominently the start frame), with update packages still updating SOME vessels, but without any time synchronization whatsoever.
regards,
Face

Last edited by Face; 08-21-2016 at 11:37 AM. Reason: link
Face is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 05:47 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.