"Curtis L. Olson" writes:

> David Luff wrote:
> > Whilst on the subject of initialisation order, currently the tile manager
> > gets initialised before an initial position is set.  This means that it
> > loads a set of tiles centered on lat/lon of 0,0, and then loads a set of
> > tiles at the correct location.  In conditions of limited visibility, this
> > can result in forced tile deletion messages and a stutter during forced
> > deletion at some point in the flight since the tilemanager thinks it can't
> > keep up with deletion, but is in fact due to having twice as many tiles as
> > necessary (exacerbated by the fact that visibility doesn't get picked up
> > properly for several iterations).  Moving the tile manager init to occur
> > after the view manager init would be a good thing IMHO, to prevent the
> > loading of bogus tiles.  (I've been testing this for a while, and it
> > doesn't seem to break anything).
> 
> Hmmm, the tile manager *needs* to be initialized before the FDM because the 
> FDM *needs* to know ground elevation for ground trimming, and we can't 
> determine that until the local tile is loaded.  We never used to load a set 
> of tiles around (0,0) so I'm not sure why that is.  The view manager code 
> is very complex and to be honest I've never quite tracked with the latest 
> changes in it.  There may be some odd dependency there. 

You can reproduce the forced tile deletion by starting with the following commandline:

bin/fgfs --prop:"/sim/ai-traffic/enabled"=false --visibility=5000 --aircraft=f16

Compile --with-theads and *don't* configure --without-logging (or the alert won't be 
visible).

Take off and turn left, flying over KSQL, KPAO etc, with gear up and max throttle.  
The alert should show just before overflying San Jose International.  There is no 
perceptible pause on a Linux box with ATA100 drives, but on a Cygwin compiled exe on 
ATA66 drives there definately was a pause during the forced deletion.

AFAICT, using some couts, what happens is this.  During tile manager initialisation, 
during the first pass the tile manager thinks the location is 0,0, and the visibility 
is 32000, and thus loads 49 tiles in the atlantic ocean somewhere off West Africa.  
Once the correct location is set, the correct visibility still isn't getting through 
from the environment properties, so another 35 tiles are loaded around the Bay Area.  
Then the correct 5000 visibility gets through to the tile manager, at which point the 
max cache size is set at 32, but 84 tiles are already in the cache!  This then 
triggers the forced deletion when the next insertion is required.

It is also possible to trigger a smaller number of forced deletions with the default 
visibility.  I'm not sure if slower aircraft can trigger it, or if it is the case that 
the f16 or ufo trigger it by reaching the next insertion before the very large delete 
queue has cleared.

Hope this makes some sort of sense!!

Cheers - Dave

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to