[Flightgear-devel] [RFC][patch] Multiplayer bandwidth savings

2008-07-15 Thread Anders Gidenstam

Hi all,

I have in previous (last winter IIRC) discussions on #flightgear claimed 
that modifying the MP protocol to only send MP properties that have 
changed would be problematic and break backwards compatibility.

I was wrong.

It is in fact easy to implement and is nearly 100% backwards compatible 
(more on that below).

The idea is simple:
1. Only include properties that have changed since the last packet was
sent.
2. To cope with thee potential for message loss include the changed
property in the next 4 packets too.
3. To ensure that newcomers have the full state include all MP enabled
properties (i.e. a packet like those FG sends
today) every 25 packets.

The parameters 4 and 25 could of course be configurable.

For the c172p (a fairly lightweight MP aircraft) the size (as reported 
by tcpdump) of most MP packets dropped from 470-480 bytes to 250-260 
bytes, even in flight. That is a pretty significant bandwidth reduction.


The patch:

http://www.gidenstam.org/FlightGear/misc/more-efficient-mp-protocol.diff
(In all 106 changed lines in src/Network/multiplay.?xx)


Now, what about _nearly_ 100% backwards compatible?

First, note that I've only made changes to the code that decides what 
properties to put in a MP packet. There are no changes to the code that 
process received MP packets, so there is very good chance that there 
are very few compatibility issues.

I can think of two issues, the first one is real (I've seen it) the second
I think is a non-issue but I'm not 100% sure.

1. At the receiver side a multiplay entry can be created without having
all its MP enabled properties in place (since it first received packet
might be a small one). This could cause animations to misbehave until
the full state has been received (after at most 2.5 sec in the case of
no packet loss).
Worse, Nasal code activated (e.g. from the model file or from
listeners) could try to read an so far uninitialized MP property and
crash. This happened with my Submarine Scout but was easy to solve by
a small change to the Nasal code.
Alternatively, one could delay making the multiplayer entry visible in
the property tree until the full state has been received (which begs
the question how to detect that the full state has been received,
though).

2. It is possible that sending property values at irregular intervals
could upset the MP state interpolation done at the receiver's side.
However, so far I have seen no indications of that being the case.
Moreover, the rate of packet transmission and the interpolation
parameters included in each packet are the same as before.

Have I overlooked some other (potential) issue?

Comments, suggestions and discussion are welcome!


Making this change could make our mpservers able to cope with another 
two dozen users (or so). :)

Cheers,

Anders
-- 
---
Anders Gidenstam
WWW: http://www.gidenstam.org/FlightGear/

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Aerodrome taxiways/aprons and terragear

2008-07-15 Thread Ralf Gerlich
Hi Martin!

Martin Fenelon wrote:
 Now to another question with regard to hold lines. Let's say I have a bit 
 of concrete apron with a hold line:
  true 090, length 150, width 15
 Where will the yellow line be? along the length EW? and is it in the 
 centre?

As far as I know, terragear does not generate hold lines at all.

In general, the X-Plane definition says that the yellow line is supposed
to be across the long axis[1], but the definition does not say where
it will intersect the long axis.

Cheers,
Ralf

[1] http://www.x-plane.org/home/robinp/Apt810.htm#RwySfcCodes


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel