Board index FlightGear Development

Disable interpolation of MP generic properties?!

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Disable interpolation of MP generic properties?!

Postby jsb » Thu Aug 04, 2016 6:43 pm

Hi,
I am working on the CRJ700 dual control and I found out properties under /ai/models/multiplayer/sim/multiplay/generic/* gets interpolated instead of reflecting a newly received value immediately.

How can I disable this "feature"? It "disturbes" writing efficient dual control code.
Thanks for any hints.
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: Disable interpolation of MP generic properties?!

Postby Hooray » Thu Aug 04, 2016 8:33 pm

not sure if there is any way/option to disable this without rebuilding fgfs (don't think so), but you could probably use AndersG's mp_broadcast.nas framework to encode values in/as string properties, at that point, you will have to do all the packing/unpacking manually (see bits.nas)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Disable interpolation of MP generic properties?!

Postby jsb » Thu Aug 04, 2016 8:57 pm

It would be great to have a property to switch this on/off, maybe one of the core developers add some lines :)
I actually do use AndersGs work and only after reading it I found the "interpolation problem". It causes a lot of extra work / nasal code to "undo" the effects of interpolation, e.g. monitoring properties for stable values.
Even worse, this causes unnecessary delay that adds to the unavoidable network latency.
Packet size limit and data coding limitations makes things even more complicated but I try to work around this with another TDM encoder based on Anders work.
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: Disable interpolation of MP generic properties?!

Postby Hooray » Fri Aug 05, 2016 4:55 pm

feel free to file a feature request at the tracker
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Disable interpolation of MP generic properties?!

Postby jsb » Sat Aug 06, 2016 9:32 pm

Link? :)
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: Disable interpolation of MP generic properties?!

Postby wkitty42 » Sat Aug 06, 2016 9:33 pm

link to the tracker?? look at the very top of this page - bug tracker ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Disable interpolation of MP generic properties?!

Postby jsb » Sat Aug 06, 2016 9:38 pm

Far too obvious....
Never mind ;)
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: Disable interpolation of MP generic properties?!

Postby daveculp » Sat Aug 06, 2016 11:33 pm

I'm guessing the interpolation was added intentionally to smooth out erratic behavior due to Internet latency changes. If so, then some things that modellers tie to these properties won't work as well any more. Maybe we need special uninterpolated properties? Maybe an attribute to switch interpolation on/off on a per-property basis?
User avatar
daveculp
 
Posts: 505
Joined: Sun Feb 24, 2013 2:50 am
Location: Las Vegas, USA
Callsign: DCulp
Version: 2017.3.1
OS: Ubuntu 17.10

Re: Disable interpolation of MP generic properties?!

Postby Hooray » Sun Aug 07, 2016 11:31 am

the property attribute sounds like a good idea - alternatively, another set of non-interpolated properties should also work.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Disable interpolation of MP generic properties?!

Postby jsb » Sun Aug 07, 2016 3:41 pm

Having a per-property switch for the generic MP props would be perfect. While UDP is the right choice for most of the MP data, for dual-control a reliable TCP connection would be preferable but I guess that is out of scope - I expect this to be a bigger change and we would need a proper design for it.
I was wondering, if external tools would help, maybe a direct ssh tunnel between pilot and copilot PC + some default FG interface - I believe I read something about telnet etc?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: Disable interpolation of MP generic properties?!

Postby Hooray » Sun Aug 07, 2016 6:33 pm

FlightGear does have built in TCP/IP support using various options - these are just currently not used by/exposed to the MP subsystem - equally, the TCP/IP functionality (search terms: FGInterface and SGProtocol) are not exposed to scripting space - otherwise, the MP/fgms stack would have almost certainly been deprecated years ago, because all that is needed to re-implement MP/fgms in a much more generic, and efficient, form is exposing the corresponding SG/FG APIs to scripting space. In fact, most of the existing protocol could be easily made much more efficient by using a PUB/SUB approach.
However, most MP related ideas have been put on hold (read: blocked) by ongoing discussions involving HLA.

But HLA really isn't needed to make significant improvements to the MP stack, e.g. see: http://wiki.flightgear.org/Distributed_ ... Simulation

That being said, another -orthogonal- development may be Richard's Emesary framework: http://wiki.flightgear.org/Emesary
In conjunction with exposing the XDR handling wrappers, this could also be used to come up with a better MP system, without people necessarily having to be familiar with C++, or intimately familiar with fgfs internals.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Disable interpolation of MP generic properties?!

Postby jsb » Tue Aug 09, 2016 10:15 pm

I spent some time digging in the source trees of flightgear and simgear searching for "interpolation" "network" etc. but I could not really find a place where the above mentioned interpolation is done.
Some suspicious lines are in flightgear src/AIModel/AIMultiplayer.*
Could it be that my problem is connected to the lag compensation code?
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: Disable interpolation of MP generic properties?!

Postby Hooray » Wed Aug 10, 2016 5:15 pm

that may be part of the equation, but I think it also interpolates in between sampled MP data/packets specifically, but I really haven't looked at the code in years - if in doubt, I'd suggest to discuss this with the fgms folks, who are most likely to provide suitable pointers
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Development

Who is online

Users browsing this forum: No registered users and 11 guests