Advanced Question Is it possible to have the MFD of another vessel?

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Hi all,

I've been working and developing for a while up to now, first with sc3 and ms2, then with c++ and my first addon is pratically ready, you'll see it in OHM soon enough.

Besides rockets and spaceships i have been thinking of another addon for a while, which is a mission control center, built inside orbiter.

My idea is very simple, a nice mesh of a big room, lot of mfds with all the datas in every seat etc.

Actually I recently found out that the guys of Forum Orbiter Italia have already done something like this, really amazing, with a wonderful mesh for the room, PCs, big screens etc. but in order to achieve the goal they basically apply one simple trick: the room is a virtual cockpit of their ship, so when they press f8 they enter in the mission control room, and all the mfds are correctedly relevant to their ship.

My idea is to build a real MCC on the ground, with the possibility of choosing which ship to track, to rely on signals from TDRSs etc.

So the question is: is it possible to open from a vessel the MFD relevant to another ship? so when i enter the MCC I can choose which ship i wish to follow and i tune all the mfds on it? of course with some of them (like Map, orbit etc.) i can set the desired ship as a target, but with no possibility of interaction with it.

I hope I was clear enough

Thanks in advance for every help

Fred
 

Cras

Spring of Life!
Donator
Joined
Apr 13, 2011
Messages
2,215
Reaction score
0
Points
36
Location
Los Angeles
Website
www.youtube.com
There is that ability to 'pin' and External MFD....

Works with most MFDs, but not with all. And it would be incredibly annoying to setup if you are thinking of numerous MFDs......

And it is external MFDs, so I dont think that fits the bill for what you are talking about.

Pursuit MFD has this function built in, you can switch it to remote vehicle control inside the MFD, a wonderful capability.


Kind of a non-answer there.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
So the question is: is it possible to open from a vessel the MFD relevant to another ship? so when i enter the MCC I can choose which ship i wish to follow and i tune all the mfds on it?

If I understand this right, you want to create a vessel (the MCC) with several MFDs (the screen "instruments") that can display MFD modes (what most people refer to with the term MFD) referencing other vessels instead of the MCC itself.

AFAIK, this is not possible with the current API. For me, MFD modes work like this:

  1. a certain MFD mode is selected in one of the MFDs of a vessel
  2. Orbiter's message pump calls the mode's registered MsgProc function with a special message and the vessel pointer as function parameters.
  3. The MsgProc returns a new instance of the the MFD mode (either built-in or custom registered). Orbiter stores the instance in its update list.
  4. Orbiter's worker thread loops through all MFD mode instances and calls the update callback, causing the mode to be rendered on the MFD display. It also calls a number of other callbacks to render buttons and menus. The vessel pointer, however, is not transmitted anymore.
In order to change the vessel pointer in that MsgProc call, you'd have to hook into Orbiter's message pump and redirect it.
While this would be certainly possible to do with a hack, it could lead to strange and unwanted side-effects with MFD modes that are not programmed with vessel- and/or MFD-persistence in mind.

regards,
Face
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Thank you very much for your answers.

Face said:
If I understand this right, you want to create a vessel (the MCC) with several MFDs (the screen "instruments") that can display MFD modes (what most people refer to with the term MFD) referencing other vessels instead of the MCC itself.

Yes you understood it perfectly

Face said:
AFAIK, this is not possible with the current API.

All right, thank you anyway and thanks for the very clear explanation, I'll think about it because i can develop a couple of MFD modes by myself with the required capabilities, but it will depends on free time of course, while if i had the chance to implement it with all the MFD modes it would have been a lot easier and would have not required a lot of work.
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
Thank you very much for your answers.



Yes you understood it perfectly



All right, thank you anyway and thanks for the very clear explanation, I'll think about it because i can develop a couple of MFD modes by myself with the required capabilities, but it will depends on free time of course, while if i had the chance to implement it with all the MFD modes it would have been a lot easier and would have not required a lot of work.

Actually, I'm not sure it would be impossible, just a little advanced. If you created a flight control center-vessel, you could create the big screen at the front of the room, draw a standard map texture onto it, then have the user type in their target vessel. If you could get a handle on that particular vessel, you might be able to return its flight elements from the OrbiterAPI & draw them onto the screen. It could work, just not with MFDs I think.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
BruceJohnJennerLawso said:
If you created a flight control center-vessel, you could create the big screen at the front of the room, draw a standard map texture onto it, then have the user type in their target vessel. If you could get a handle on that particular vessel, you might be able to return its flight elements from the OrbiterAPI & draw them onto the screen

That is actually true, but if there is no chance of interaction it is easier to set normal orbit and Map MFD with the desired vechicle set as target.
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
That is actually true, but if there is no chance of interaction it is easier to set normal orbit and Map MFD with the desired vechicle set as target.

True, but a flight control center with the big plotting board up front would be pretty cool IMO. I dont think I can do it right now, but I'll put it on my future projects list.
 

Goth

Occasional orbinaut
Donator
Joined
Aug 1, 2008
Messages
424
Reaction score
2
Points
0
AFAIK, this is not possible with the current API.
It is, you just have to use the ExternMFD class, which can focus a specific vessel. The orbiter implementation of external MFDs displays them on windows dialogs, but you could display them anywhere, e.g. in a mesh representing a big screen of a mission control.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
It is, you just have to use the ExternMFD class, which can focus a specific vessel. The orbiter implementation of external MFDs displays them on windows dialogs, but you could display them anywhere, e.g. in a mesh representing a big screen of a mission control.

You are right. Would be quite some work to re-implement glass cockpit, panel surface and VC behaviour, though. But doable.
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
You are right. Would be quite some work to re-implement glass cockpit, panel surface and VC behaviour, though. But doable.

This is actually pretty simple. If you look at ExtMFD source, you can see that it gets passed SURFHANDLE corresponding to the MFD screen, then it does blitting from that SURFHANDLE to a bitmap, and then it displays this bitmap.

So instead of displaying the bitmap, you use it as a texture of a VC element.

Even better, if you can get SURFHANDLE to a the target VC surface, then you eliminate the bitmap step and just do oapiBlt() between the two SURFHANDLEs.

To learn more about the dark art of blitting MFD screens, have a look VNCMFD sources :)
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Can this be used with any vessel? what add-on is that?? :blink:

It's here:

[ame="http://www.orbithangar.com/searchid.php?ID=5989"]http://www.orbithangar.com/searchid.php?ID=5989[/ame]

But it's a nice trick the FOI guys did: it's built inside the station (not usable with other addons) and simply when you press F8 to go inside the virtual cockpit, the mesh of the VC is the MCC mesh, so you can have screens and MFD easily.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
This is actually pretty simple. If you look at ExtMFD source, you can see that it gets passed SURFHANDLE corresponding to the MFD screen, then it does blitting from that SURFHANDLE to a bitmap, and then it displays this bitmap.

So instead of displaying the bitmap, you use it as a texture of a VC element.

Even better, if you can get SURFHANDLE to a the target VC surface, then you eliminate the bitmap step and just do oapiBlt() between the two SURFHANDLEs.

To learn more about the dark art of blitting MFD screens, have a look VNCMFD sources :)

I've already checked VNCMFD before, nice work :thumbup:. I never really used it because I found it lagging like hell on my machine, but the idea is pretty cool.

And I guess herein lies the problem of the implementation: you'd have to do that for all three modes (glass-cockpit, panel, VC) to really provide what Orbiter's MFD already does, of course with an acceptable performance. I don't consider this easy.

That said, I'd encourage you to implement a vessel-integrated ExtMFD to focus other vessels (even if it is "only" in VC) as an example, given that you already have knowledge in this particular area. This way the mission-control guys might be able to include this feature in their work.
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
I've already checked VNCMFD before, nice work :thumbup:. I never really used it because I found it lagging like hell on my machine, but the idea is pretty cool.

Did you check the last version (it was posted at the end of the thread)? The early versions indeed had performance problem, but this was solved at one point -- or so I believe :)

That said, I'd encourage you to implement a vessel-integrated ExtMFD to focus other vessels (even if it is "only" in VC) as an example, given that you already have knowledge in this particular area. This way the mission-control guys might be able to include this feature in their work.

I have an idea how that could work, and I will give it a try when time permits.
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
I have an idea how that could work, and I will give it a try when time permits.

Done!

[ame="http://www.orbithangar.com/searchid.php?ID=6456"]SlaveMFD[/ame]

slave.png
 
Top