c172p icon indicating copy to clipboard operation
c172p copied to clipboard

Migrate to 2017.2 MP protocol

Open onox opened this issue 6 years ago • 8 comments

In the 2017.2 MP protocol we have access to about 90 booleans, 40 floats, and 80 short ints.

We should make a list of all the properties that are transmitted as integers, but are actually used like booleans like sparks and water effects (on/off). We could use a JSBSim <switch> instead of FG's autopilot/property-rule XML to set a boolean.

See http://wiki.flightgear.org/Multiplayer_protocol#Properties_Packet

See https://github.com/onox/p51d/blob/master/p51d-jsbsim-set.xml#L171-L232 and https://github.com/onox/p51d/blob/master/Systems/effects.xml#L166-L175 for an example.

As an addendum to this issue there are two known other issues that need to be addressed.

It was reported and verified that the exterior lighting of the aircraft are not very visible at any distances greater than a 10-20 yards.

The other is that none of the new interior lighting effects are implemented in MP mode.

  • [x] Tiedowns, pitot cover, wheel chock visibility

  • [ ] Tiedowns orientation and length (float)

  • [ ] Navigation, beacon, strobe, landing, taxi lights (bool)

  • [ ] Red flood, white dome lights (short float)

  • [ ] Yellow spark effects (bool)

  • [ ] Touch down smoke effects (bool)

  • [ ] Other(?) smoke effects (bool)

  • [ ] Water spray effects (bool)

  • [ ] Optional: overhead vents position (short float)

  • [ ] Water rudder position (short float)

  • [ ] Wing damage (short int)

  • [ ] Gear rollspeed ((short) float)

  • [ ] /params/engine/crashed (bool)

  • [ ] /params/cockpit/electrical/gear-amphibious (bool)

  • [ ] GPS - /sim/model/c172p/garmin196-visible

  • [ ] Mooring anchor /controls/mooring/anchor (bool) This one may require more than one simple MP property. For example I think at least some if not all of these would also have to be set /fdm/jsbsim/mooring/anchor-lon /fdm/jsbsim/mooring/anchor-lat /sim/anchorbuoy/enable /fdm/jsbsim/mooring/anchor-dist /fdm/jsbsim/mooring/anchor-length /fdm/jsbsim/mooring/mooring-connected I think on some of the missing and new features or options one might have to be in the middle of it to know what is going to be required.

Some props use engines/engine[any]/{n1,n2,rpm} which are short float, so probably don't need any changes.

onox avatar Mar 16 '18 01:03 onox

So we can simply change any of the int's to bool where appropriate?

We could use a JSBSim instead of FG's autopilot/property-rule XML to set a boolean.

I'm not quite following this one. Aren't we using switch in this manner already? Can you direct me to a situation where we are not?

wlbragg avatar Mar 16 '18 16:03 wlbragg

I meant some of the <filter>'s in Systems/ground-effects.xml.

onox avatar Mar 16 '18 19:03 onox

So we can simply change any of the int's to bool where appropriate?

Yes, but many of the XML files for the effects have to be changed. In those files we have a <condition> with a <greater-than> (for example) in it. That <greater-than> can then be removed.

onox avatar Mar 16 '18 19:03 onox

If we use a JSBSim <output> property (in Systems/c172p-ground-effects), then we can use/alias that property in <multiplayer><generic> and in the flight recorder. And we don't need those filters in Systems/ground-effects.xml anymore then.

onox avatar Mar 16 '18 19:03 onox

Hey @dany93, I noticed on the FG forums you mentioned the P-51D. I've worked on it for a while in my repostory.

onox avatar Mar 27 '18 03:03 onox

Yes, I had seen that (I don't remember how and when).

As the aircraft had serious issues in Nov. 2015 (did not open, engine did not start), I wished to ask and propose a few changes to Hal (among them, one Autostart from efel). I wondered why he did not react. That's when I learned (and announced in the US forum) that Hal V. Engel had passed away.

Since then, I've made it a bit milder at takeoff and landing, changed the spiraling propwash formulation, moved the markers on the dashboard (they were outside their right place). Maybe a few other small things. More importantly I discovered the reason (rather the way it happened) of an old, not understood, erratic bad bug, which made it crash under unclear circumstances at engine start. It was a bug in the core FG code, fixed by Bertrand Coconnier after my observations. These changes have been included in SVN with the help of Ludovic Brenta.

I don't know if your changes can be included in SVN (with not too many conflicts) by the same way or your own rights, you are much better than me on this.

dany93 avatar Mar 27 '18 10:03 dany93

They already are. Stuart has merged the changes back to fgaddon just after the release of FG 2018.1. It also contains your changes to the FDM that you have made in the past.

onox avatar Mar 27 '18 17:03 onox

@wlbragg I've started working on refactoring the MP properties. If there are any effects missing in the list above, feel free to add it.

I've moved several properties from /sim/model/c172p/securing to /aircraft/securing because navigating to /sim/model/c172p/ in the property dialog is just a big pain.

onox avatar Jul 13 '18 00:07 onox