Not to multiply threads I'll ask a related question here.
I want to use more compact MP data types to shorten the packet size and lessen the load on MP servers.
New/additional types are described here:
https://wiki.flightgear.org/Multiplayer ... Data_typesIn my -set.xml I have:
- Code: Select all
<multiplay>
<generic>
...
<float n="0" alias="/controls/flight/elevator-trim"/>
...
<Short_float_norm n="0" alias="/gear/gear[0]/steering-norm"/>
...
</generic>
</multiplay>
and in my model.xml I have:
- Code: Select all
<nasal>
<load>
<![CDATA[
var rplayer = cmdarg();
...
rplayer.getNode("controls/flight/elevator-trim", 1).alias(rplayer.getNode("sim/multiplay/generic/float[0]") );
...
rplayer.getNode("gear/gear[0]/steering-norm", 1).alias(rplayer.getNode("sim/multiplay/generic/Short_float_norm[0]") );
]]>
</load>
...
This results in a Nasal error:
- Code: Select all
99.56 [ALRT]:nasal Nasal runtime error: props.alias() with bad argument
99.56 [ALRT]:nasal at /opt/fg/next/install/flightgear/fgdata/Nasal/props.nas, line 43
So how do I use the new shortened data types/encodings in a correct way?
EDIT:after looking at flightgear/src/MultiPlayer/multiplaymgr.cxx it seems that there is no direct way of requesting some data transmission types for chosen properties.
Types like short_float_norm or short_float_{1..4} are used in a fixed way for predefined properties.
Directly accessible are sim/multiplay/generic/{string[],float[],int[],short[],bool[]}.
I will need to experiment if I can repurpose transmitted but unnecessary properties gear/gear[{3,4}]/{compression,position}-norm, they use short_float_norm encoding.
Or engines/engine[1..9]/rpm in a single engine aircraft (it uses short_float_1 encoding).