• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

VS2013 question

Jon,

FS uses a basic concept for shared cockpit. Once the two aircraft get connected, those A:Vars that are listed in the SDK as All/Shared Cockpit, together with custom C-serialized vars, are synchronized at once. After that, and appart from the positional info which is constantly transmitted to the slave aircraft, data exchange happens through event process only (K: and shared_event_out alike). Complete synchronization will take place also in case any of the aircraft was paused and resumed flying.

I, like you, had similar trouble when trying to code ACES' blog example within a C++ module. Never got serialization/deserialization to work; neither the shared_event, which seems to need a valid GAUGEHEADER pointer.

I think John Cage's aircraft problem was too many constantly-fired events, which are indeed a networking nightmare. Or any other thing, but surely not XML custom vars (L/C/G), which are not transmitted ever.

Tom
 
Last edited:
I got process_shared_event_out to work with my gauges but it was overall just too tedious and unreliable.

Anyways XML Gauges (not L vars specifically) ARE synchronized over shared cockpit, including L vars within the xml gauge. Setting Lvars outside of XML gauges however doesn't share. Before Aerosoft had problems, the guy in the backseat could change things like radar mode and other custom Lvar based functions and they would propagate across without a problem. When they started adding more functionality however, things would become too much for the system to handle.

Just to reiterate, this only occurs in XML Gauges. Not L vars written to in the modeldef.xml or from a C++ gauge. Furthermore this was noted by someone else early on as well

http://www.fsdeveloper.com/forum/threads/gauges-in-multiplayer-shared-cockpit.160630/#post-334425

I worked with Chris Dub for a while and he has done almost everything that can be done with FSX.
 
Jon,

Anyways XML Gauges (not L vars specifically) ARE synchronized over shared cockpit, including L vars within the xml gauge. Setting Lvars outside of XML gauges however doesn't share.

After your statement, and thinking about what process_shared_event_out does in FS1000 C macro, I made some tests with 2D gauges in shared cockpit aircraft and found the following:

-LVars in shared XML gauges are NOT synchronized at all as long as they are updated within other gauge command outside of <Mouse> section (for example <Update>,<Element>,<On Event>, etc)

-LVars updated within a <Mouse> <Area> <Click> section are transmitted to the other aircraft, and the point of insertion is the next panel cycle. I mean, LVars values on the local aircraft start the current cycle with the values received from the remote aircraft, if any.

So it seems that XML gauges are translated into classes similar to those instantiated by C gauges with FS1000 macro structure; and include as well a process_shared_event_out function called within the <Mouse> section. A struct with data and ID of LVars involved must be automatically generated at gauge instantiation, and sent to the other side each time the gauge's area is clicked.

Now I clearly understand why LVars values are not transmitted when updated in modeldef or C standard gauges, as you stated.

Previously I've done lot of Shared Cockpit test with LVars coming from modeldef and XML standard gauge structures (Update,Element,etc); also with C++ named variables, but never played with <Click> sections of 2D XML gauges!:eek:

I worked with Chris Dub for a while and he has done almost everything that can be done with FSX.

What Chris states in his post is very logical. You can obviously program a C FS1000 macro and serialize/deserialize/event_out LVars ID and values, and surely will run slow if too many vars are included...I started working on that side while thinking to provide XMLTools with Shared Cockpit functionality.


Tom
 
Ok so C++ you must write more code to make them shareable.

And i do use L vars and A vars and both are shareable. But i write most of my code inside the Model.def and wonder if this is why. The only coding i write outside the Model.def is for custom rules, 2D panel info and if i have a complex system I just stick a L var inside the Model.def and write the code outside. But the majority of my L and A vars are in the Model.def

So i can say yes that L vars are shareable in XML. I think i would rather pay someone to write me a code that needs C++ rather than learn it from scratch since i have 8 years in XML. Thanks for sharing your thoughts on this issue! And glad my products are shareable.:santahat:
 
Jon,



After your statement, and thinking about what process_shared_event_out does in FS1000 C macro, I made some tests with 2D gauges in shared cockpit aircraft and found the following:

-LVars in shared XML gauges are NOT synchronized at all as long as they are updated within other gauge command outside of <Mouse> section (for example <Update>,<Element>,<On Event>, etc)

-LVars updated within a <Mouse> <Area> <Click> section are transmitted to the other aircraft, and the point of insertion is the next panel cycle. I mean, LVars values on the local aircraft start the current cycle with the values received from the remote aircraft, if any.

So it seems that XML gauges are translated into classes similar to those instantiated by C gauges with FS1000 macro structure; and include as well a process_shared_event_out function called within the <Mouse> section. A struct with data and ID of LVars involved must be automatically generated at gauge instantiation, and sent to the other side each time the gauge's area is clicked.

Now I clearly understand why LVars values are not transmitted when updated in modeldef or C standard gauges, as you stated.

Previously I've done lot of Shared Cockpit test with LVars coming from modeldef and XML standard gauge structures (Update,Element,etc); also with C++ named variables, but never played with <Click> sections of 2D XML gauges!:eek:



What Chris states in his post is very logical. You can obviously program a C FS1000 macro and serialize/deserialize/event_out LVars ID and values, and surely will run slow if too many vars are included...I started working on that side while thinking to provide XMLTools with Shared Cockpit functionality.


Tom

There we go :)
 
Back
Top