• 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.

FSXA Multiplayer and L:Vars

Roy Holmes

Resource contributor
Messages
1,805
Country
us-virginia
In a few month old thread, (see below) it was stated that changing the value of L:Vars in one airplane in Multiplayer would change the same L:Var in another airplane.

Here is my hypothetical problem. I make six identical airplanes (apart from texture) for use in Multiplayer. Interaction between the various systems in the airplane uses a lot of L:vars.

For example. The TACAN frequency is altered by changing the value of an L:Var through mouse action. Does that mean that the last player to change TACAN frequency changes the TACAN in the other 5 airplanes?

Please say it ain't so.

Roy

http://www.fsdeveloper.com/forum/showthread.php?t=77148&page=2
 
It ain't so. Well, at least from what I've observed. Unless, of course, if you're running in Shared Cockpit, in which case I believe all L: vars are synchronized between the two pilots.
 
Shared Cockpit/Multiplayer/L:Vars

I know shared cockpit is "shared cockpit", but without a c++ written .dll in common between the two systems it won't work at all.

But Roy's question is if 12 pilots are partnered into six identical aircraft in one online "room", and they all have shared cockpit mode running... will one pilot's action affect gauges in all the other planes? or just the gauges in their own plane?

I too am curious.
 
Shared cockpit would only transmit information between 'pairs'. Thus it would only transmit information between a pilot and copilot connected via shared cockpit. No one else would see their information... period.
 
Aha

Then it is only necessary to transmit L:vars that control options on gauges visible in the cockpit through the dll, therefore why need be any wasteful transmission of other A-Z:Vars into multiplayer server?
 
Roy [url said:
http://www.fsdeveloper.com/forum/sho...t=77148&page=2[/url]

My last post ^^^^^^^^^^^
Pertaining to the link Roy posted (A-Z:Vars flooding multiplayer servers reducing frame rates.) and to this thread as well.
 
Thanks to all for the inputs. They solved my immediate problem.

I was strictly talking about multiplayer, not shared cockpit.

I find it hard to understand why any code in one aircraft would affect another in multiplayer or indeed how anything other than the visual positioning and model rendering of the participants is sent to all players.

I assume this is done by the Scenery engine is FS

Can anyone point me at an explanation of how Multiplayer actually works?

Roy
 
Roy, these "stock events" are transmitted via the multiplayer server so that the user's "representative aircraft" will show up on the screens of the other players connected!
 
Bill,
I can see how animation states would need to be communicated to the other players so they are visible. I can not see why anything not normally visible like avionics selections would need to be communicated.

Here is my situation. I fly with a group where we practise formation flying and so we (unless we lose sight of each other) continually see the other airplanes and their labels (when switched on) The aircraft are identical except for paint jobs. All interior avionics are the same. All use the same L:vars. I see no evidence that the state of L:vars is received and I just wanted confirmation that that was truly the correct conclusion.

While on the subject of L:vars, I recently spotted a case where units does mean something. I had one gauge broadcasting the height of an object with units "number". In another gauge I had the same L:var name but with units "feet". The second gauge reacted as if the number was a bit more than 3 times what it was. Took me a while to realise that FS works in meters and was happily converting my numbers to feet! Bit like the time I saw a road sign that said "Distances in kilometers for the next 20 miles"

Sorry for the diversion from my main question, should know better!

The SDK states that in multiplayer mode, only a small number of variables are communicated between aircraft. The Multiplayer column refers to these as "shared cockpit" or "all aircraft".

I guess I am in the "all aircraft" situation.
The SDK has 26 "all aircraft" A:vars
11 vars to do with lights, which makes sense.
Concorde visor nose handle, makes sense
"G force". Strange.
Electrical Master battery.Strange
Pitot heat. Strange
Smoke enable. makes sense
Water rudder handle position, gear handle position, flaps handle index, spoilers handle position, all make sense
Spoilers armed. Strange
Avionics Master switch. Strange
Alternate static source open. Strange
Com active frequency
Com standby frequency
Transponder code

Just to consider the last three, the Event ID for coms frequency DEC and INC are also All Aircraft as are transponder code settings. What effect does that have on the other aircraft? And whose aircraft is in charge of changes?

I'm having a hard time understanding this, sorry

Roy
 
Hi,

I wouldn't know how they are used, but remember these are A: variables, which are read only - they won't affect *your* plane. Even L: variables are read only in the sense that they don't affect the sim directly (like K: variables do).

I don't think there is any affect on your plane if another plane sends an L: variable - never seen it. If they did, all the switches on my panel based on custom L: variables would start switching on and off - and they don't.

Hope this helps,
 
Tom,
What you say makes sense and confirms what I have experienced so far as an effect on my plane in Multiplayer. Perhaps the strange "all aircraft" variables and Event IDs are just another error in the SDK lists.

Feeling better though still a little confused, but I'll get over it!

Thanks
Roy
 
I don't think there is any affect on your plane if another plane sends an L: variable - never seen it. If they did, all the switches on my panel based on custom L: variables would start switching on and off - and they don't.

No they aren't, which is why the cumbersome and annoyingly complicated CustomEventID system needs to be implemented via a C++ .dll in order to enable a fully functional Shared Cockpit aircraft! :mad:

Everything that must be "shared" requires at a minimum 2 (L:vars) and one CustomEventID to function. Now, consider what is required of the programmer/modeler when there's a total of 738 such CustomEventIDs required for an aircraft such as a large biz-jet or smaller commercial aircraft such as a 737-100 or -200!!!

So, what is transmitted during multi-player?
  1. All key_events (whether C or XML)
  2. Selected set of aircraft variables (whether C or XML)
 
In a few month old thread, (see below) it was stated that changing the value of L:Vars in one airplane in Multiplayer would change the same L:Var in another airplane.

Here is my hypothetical problem. I make six identical airplanes (apart from texture) for use in Multiplayer. Interaction between the various systems in the airplane uses a lot of L:vars.

For example. The TACAN frequency is altered by changing the value of an L:Var through mouse action. Does that mean that the last player to change TACAN frequency changes the TACAN in the other 5 airplanes?

Please say it ain't so.

Roy

http://www.fsdeveloper.com/forum/showthread.php?t=77148&page=2

It ain't so. TRY it .. the Freqs will not update. The Lvars are NOT shared across MP, unless the planes are SHARING COCKPIT with each other.

Geoff
 
Since I started this thread I feel duty bound to summarize what I have learned.

Multiplayer has two categories: Shared cockpit mode and non-shared cockpit mode. They are very different and my question related to non-shared cockpit mode only, though I did not realize it when I started the thread.

In non-shared cockpit mode your aircraft will be able to read all internal variables and will respond to all internal key events. A selected small set of variables and related key events will be transmitted to the other aircraft. These are marked as "All Aircraft" in the SDK.

The other aircraft in non-shared cockpit mode are not affected by the state of variables of any type in your aircraft. The only key events that are transmitted between aircraft are those concerning the settings of the items in the list below, hence one should take care in coding them to avoid flooding the bandwith with unnecessary key events.

Engines.
Magnetos
Fuel valves
Electric fuel pumps
Controls.
Flaps
Spoilers
Avionics.
Comms
Transponders
Lights.
Misc Systems.
Smoke
Gear
Pitot heat
Master battery
Alternators
Alternate static

Or so the SDK says!

Roy
 
Last edited:
>L: / >L: / server flood / macros

If L: variables really spread across a mp server as no one has ruled out in this thread (although I haven't seen for myself)... then gauge designers ought to consider using as many macros as needed to do all the custom calculating the gauge will need. And only use a L:ocal variable when needed.
I've learned that macros can: transfer any data across any element within a single gauge, be referenced as a gauge text, offer a huge advantage in doing complicated calculations as opposed to writing a L:ocal variable for every aspect of the calculation if they need not be displayed in some form on a gauge, usually only the final number need be seen. Also, if one was to design a universal style panel that would require a .ini style .xml file to update the gauges differently or use different base numbers to be calculated using the same math formulas for say... a different aircraft type or variant using the same panel (I will post an example of this)
I've found that macro's cannot: Transmit data to any other gauge than where it's located ":( and :)"<<<get to this later (it can recieve data however). It also cannot be referenced in a visibility code for a gauge element, I tried and tried, correct me if I'm wrong here.
":( :)" - Macros can't flood any server or gauge other than their own location. Which is bad because you have to write a L:ocal for every transmission outside the gauge. And this is also good because they don't flood the rest of your gauges or MP server.
This is a sneak peak at a system I'm designing, it's purpose is to give the pilots an exact radio height acording to WHERE THE LOWEST PART OF THE AIRCRAFT IS IN RELATION TO THE GROUND!! It does this by 1st deducting the height of the main gear from the default Rad Alt, user input macros where you enter: radio alt at tailstrike angle divided by tailstrike angle. Times A: attitude indicator angle, Then the same for at 45 degrees which is more complicated math. The rest you would have to see for yourself.
You may think "what's the point of this gauge?" or "that's an awful lot of work for a RAD ALT anything!" Either way, my point in this long post (sorry) is imagine if every macro in the text below was an L:var instead.

<Macro id="RadAlt" Name="RadAlt">
<MacroValue>(A:Radio Height, feet)</MacroValue>
</Macro>
<Macro id="AircraftPitch" Name="AircraftPitch">
<MacroValue>(A:Attitude indicator pitch degrees, degrees)</MacroValue>
</Macro>
<Macro id="AOA" Name="AOA">
<MacroValue>(A:INCIDENCE ALPHA, degrees)</MacroValue>
</Macro>
<Macro id="RadAltGroundFactor" Name="RadAltGroundFactor">
<MacroValue>@RadAlt @HeightAboveGround -</MacroValue>
</Macro>
<Macro id="HeightAboveGround" Name="HeightAboveGround">
<MacroValue>13.30</MacroValue>
</Macro>
<Macro id="RadAltAtRollingTailstrike" Name="RadAltAtRollingTailstrike">
<MacroValue>5</MacroValue>
</Macro>
<Macro id="RadAltAt45Tailstrike" Name="RadAltAt45Tailstrike">
<MacroValue>50</MacroValue>
</Macro>
<Macro id="PitchRollingTailstrike" Name="PitchRollingTailstrike">
<MacroValue>-12</MacroValue>
</Macro>
<Macro id="PitchRadAlt50Tailstrike" Name="PitchRadAlt50Tailstrike">
<MacroValue>-45</MacroValue>
</Macro>
<Macro id="RollingCommonD" Name="RollingCommonD">
<MacroValue>@RadAltAtRollingTailstrike @PitchRollingTailstrike /</MacroValue>
</Macro>
<Macro id="AirbourneCommonD" Name="AirbourneCommonD">
<MacroValue>@RadAltAirbourneSubCommon @PitchAirbourneSubCommon /</MacroValue>
<Macro id="RadAltAirbourneSubCommon" Name="RadAltAirbourneSubCommon">
<MacroValue>@RadAltAt45Tailstrike @RadAltAtRollingTailstrike -</MacroValue>
</Macro>
<Macro id="PitchAirbourneSubCommon" Name="PitchAirbourneSubCommon">
<MacroValue>@PitchRadAlt50Tailstrike @PitchRollingTailstrike -</MacroValue>
</Macro>
</Macro>
<Macro id="RollingMultiplier" Name="RollingMultiplier">
<MacroValue>@AircraftPitch @RollingCommonD *</MacroValue>
</Macro>
<Macro id="AirbourneMultiplier" Name="AirbourneMultiplier">
<MacroValue>@AircraftPitch @PitchRollingTailstrike - @AirbourneCommonD *</MacroValue>
</Macro>
<Macro id="RadAltGroundFactorRoll" Name="RadAltGroundFactorRoll">
<MacroValue>@RadAltGroundFactor @RollingMultiplier -</MacroValue>
</Macro>
<Macro id="RadAltGroundFactorAir" Name="RadAltGroundFactorAir">
<MacroValue>@RadAltGroundFactor @AirbourneMultiplier - @RadAltAtRollingTailstrikeX2 -</MacroValue>
<Macro id="RadAltAtRollingTailstrikeX2" Name="RadAltAtRollingTailstrikeX2">
<MacroValue>@RadAltAtRollingTailstrike 2 *</MacroValue>
</Macro>
</Macro>
<Update id="Update">
<Script>@PitchRollingTailstrike (&gt;L:Pitch_Rolling_Tailstrike,number) @AircraftPitch (&gt;L:Aircraft_Pitch,number)</Script>
</Update>
This really works, I set it to give a safety margin after rotation or flare, by about 1 1/2 feet. Great for takeoff and landing. Hope this gives some of you more seasoned developers some new ideas. And saves some fellow rookies some time, and helps keep MP servers less intoxicated with usless data.
Hope this post isn't "too long" ha.
 
Help

I feel real deprived here, so help me stop depriving you all of space and tell me how to make my long posts scrollable.

Would like to thank:

I have tried
Code:
<Value>(A:SPOILER HANDLE POSITION,position) 4097 &gt; (A:AIRSPEED INDICATED,Knots) 345 &gt; AND if{  4096 (>K:SPOILERS_SET) }</Value>
It doesn't have any effect at all :-((((((((
vololiberista

And

Of course not, it goes in an update, not a value tag.

I was ripping my hair out for almost 3 days trying to figure that one out last week building the formula i just posted.
Thanks guys. You are all great.
 
I think you are reading far too much into just what XML @Macros actually are...

They are simply direct substitutions for literal ASCII text. This is clearly explicated in the Wiki article, and illustrated by the example provided.

http://www.fsdeveloper.com/wiki/index.php?title=XML:_Using_Macros

Code:
<Macro Name="Macro1">
    (A:VELOCITY WORLD X, m/s) (A:VELOCITY WORLD Z, m/s) atg2 rnor
</Macro>

In the example, everywhere you see @Macro1, when the parser reads the XML statement it will replace @Macro1 with the literal ASCII text defined.

Macros are very useful if one has to use some specific arrangement of XML script multiple times as shown in the example, but otherwise is rather pointless.
 
The only other time I find them helpful is if I have a very complex formula and placing that formula in a macro makes the actual gauge code much more readable and understandable (especially if it is used more than once).
 
Tom, that's an even clearer way of saying the same thing I wrote. Ease of scripting and readabilty for the programmer is the only time they are useful...
 
I think you are reading far too much into just what XML @Macros actually are...

They are simply direct substitutions for literal ASCII text. This is clearly explicated in the Wiki article, and illustrated by the example provided.

http://www.fsdeveloper.com/wiki/index.php?title=XML:_Using_Macros

Code:
<Macro Name="Macro1">
    (A:VELOCITY WORLD X, m/s) (A:VELOCITY WORLD Z, m/s) atg2 rnor
</Macro>

In the example, everywhere you see @Macro1, when the parser reads the XML statement it will replace @Macro1 with the literal ASCII text defined.

Macros are very useful if one has to use some specific arrangement of XML script multiple times as shown in the example, but otherwise is rather pointless.

They still don't pass around the info to other gauges, I am going by trial and error since FSX SDK simply tells you little about what they do, and absolutely nothing about what they can't do or specifications on how you can or can't use them in script, leaving one to learn of their usefulness by seeing good examples of them in an existing gauges, and trial and error. If the gauge I posted above used an L:var for every part of the formula above, it would continuously send those values to the entire panel system (and from what I understand by this thread and a few others, also floods MP servers with the same data.) To the best of my knowledge only a c++ or GDi+ .gau or .dll custom code can transfer macro values to other gauges when referenced as part of a xml gauge. This will become more helpful when I need to take the same figures and reverse the math to come up with a "Tailstrike warning bar" on the ADI / FD, and on the AOA Display. I know macros can bloat a file in a similar way than with using L:vars, but they don't let that "flooding" outside the gauge which was discussed about L:vars in this thread and a couple others recentely. If you misunderstood what my point was I can understand, if I am wrong and there is a way to use a .xml witten macro from another xml (not c++ or gdi+) please explain because I tried and tried and got nothing when attempting to use macros from xml to xml.
 
Back
Top