Jump to content
Sign in to follow this  
Guest luissa

airport elevation. i'm missing a step!

Recommended Posts

Hello Graeme,This whole thing is a real mess and this is a good time to set it all out clearly so that others do not fall into the same trap.A number of files contain airport information: - AP: this has all the default airport including the reference altitudes for the airport and for the runways. These files are located in the regional folders in the Scenery directory; - FL: this file contains a flatten for the airport. This flatten polygon is the same size and shape as the airport background (the skirting or grass that underlies the airport) and ensures that the area is perfectly flat. These files are also in the regional folders along with the AP files.The altitudes in the AP and FL files are the same, except in the case of some wayward error.AFCAD files are a means of deleting some of the default airport information in the AP files and substituting other elements (runways, aprons, taxiways, parking, etc.)While there are numerous commands for deleting airport elements (see the BGLComp SDK for details), there is no Delete Altitude command. So, an AFCAD file cannot delete the reference altitude of the AP file and substitute another.Peter's somewhat convoluted solution is to place a copy of the AFCAD file in the World/Scenery folder. This folder has higher priority in the scenery library than the regional folders and is therefore read before the AP files. This will certainly work, but it is hard to understand why anyone would choose such a work-around, as the problem can be dealt with more easily.Let's examine Peter's solution and the consequences: 1. There is a copy of the AFCAD file in the highest priority World/Scenery folder. It deletes the previous airport (except that there is no previous airport!), and creates a new airport at the correct reference altitude; 2. The AP file in the regional folder is read next. It contains the default airport that is drawn over the AFCAD file in the World/Scenery folder. In addition, it has the unwanted reference altitude that is read by Flight Simulator as well; 3. The AFCAD file in the local scenery folder is then read. It deletes the previous airport (both of them - the default and the first instance of the AFCAD file, but not the reference altitudes) and draws the new airport.Since AFCAD cannot delete the reference altitude, the first instance of the AFCAD file has established this value. BUT, the AP file has also been read and it has a different altitude. Is this a conflict between these two altitudes? Does Flight Simulator only read the first instance of altitudes and disregard the rest? Unless Peter or someone has demonstrated this, then much testing needs to be done.As you can see, a mess and ripe for problems of all sorts.Consider the alternatives: 1. If all you want is to place the AFCAD file in a higher priority, there is no need to place a duplicate in the World/Scenery folder. Simply create a folder for your AFCAD, as Dick suggests, and declare it at a higher priority than the regional folders. But, this seems unnecessarily complex; 2. Or, do as you did. Decompile the AP and correct the altitude. Problem solved. Jacky has made it even easier with his JABBgl - no need to decompile and recompile the AP file at all.However, this is not your problem. You have already corrected the AP file's altitude, so it is useless for you to start placing duplicate AFCAD file throughout the FS directory structure.Please delete all your duplicate AFCAD files.The problem is that there are 2 different places where airport altitude can be found: the AP file and the FL file. You must now correct the airport flatten polygon.As I mentioned, you can use any scenery design program to do this, although Steve Greenwood has provided a couple of utilities that allow doing this very easily.I am somewhat lazy and do not like slewing around in FS, so I just decompiled the FL file and changed the values there. But, this is not the most recommended method. Instead, it is probably better and easier to make a new flatten polygon with the correct altitude.Just for your information, however, the FL file, like all those terrain files, is broken up into sections. Every Cell contains the Areas that are modified within it, so you must know the Cell and Area coordinates of your flatten polygon. Jim's great Map Viewer, LWMView, will give you all this and more, and so will Dick's TCalc.Within the Cell section, you will find something like this:LWMDataAreaDrawPolygons 1,_Flatten_,1,1,18LWMPoly3 6, 0, _Water_, 5, 101, 5, 101LWMPoint3 255, 224, 0LWMPoint3 229, 255, 0LWMPoint3 186, 255, 0LWMPoint3 1, 186, 0LWMPoint3 1, 1, 0LWMPoint3 255, 1, 0The last two numbers of the first line are the Area coordinates.The second line contains the height information. Since this is a LWMPoly3, it can (and does) have multiple elevation values, but since it is meant to flatten the terrain to a level, they are the same.The elevation in this case is 5,101. It appears twice. The first number is a whole integer and represents meters (metres). The second number is a fraction and represents a 128th of a meter. Pull out your trusty Windows Calculator, divide 101 by 128, and you get .789 meters. So, total elevation for this flatten is 5.789 metres.To enter the correct elevation, replace the first number with the whole value in meters (do it for both entries), and multiply the fraction of a metre by 128 to get the fractional value, that you should also replace in both places. That is it.To anyone else who may be reading this, please do not start placing duplicate AFCAD files throughout FS. It is much easier to solve this problem by just modifying the default airport elevation with Jacky's program and you will avoid potential conflicts.Best regards.Luis

Share this post


Link to post
Share on other sites

Hi all.I don't see a work-around other than Peter's discovery. The first instance of the Airport code determines the elevation of the aprons.However, only the simple Airport info is needed, not the entire copy of the new AFCAD. The code to set the ident, latitude, longitude, and elevation can be done with a simple XML-compiled code like this:<?xml version="1.0" encoding="ISO-8859-1"?>This may have some advantage over using a copy of the AFCAD, as it doesn't include any drawing routines... In this case, I reset the elevation to 1796.00 meters. When this BGL is placed in the Scenery Library near the bottom of the loading order, it works just fine, with the new AFCAD.Note for anyone just reading this thread: this would only be needed when changing the elevation of the airport.I would rather see this implementation, than altering part of the "AP" code... unless the entire LOD5-sized AP code is corrected and used as a replacement for the default ( much as I recommend for LWM and VTP ). Dick

Share this post


Link to post
Share on other sites

Again, thank you, Dick. This creative solution is so much better than duplicating AFCAD files. You are absolutely right and I just hope that anyone that is modifying airport altitudes and distributing the files will make this very small bgl and distribute it along with the rest of his files acoompanied by detailed instructions. As usual, you come through with solutions to the sticky problems.Like you, I have been thinking that the best solution for hyp, flattens, and even airports is to integrate the new elements into the complete default file and distribute that instead. This solution has the inevitable and evident pitfalls that we can all imagine, but at least removing the local scenery folder will not radically affect the default scenery.I was also thinking that instead of removing entire sections from the hyp files, it might be interesting to consider modifying those Areas in the default hyp file by changing the elevation to mesh-clinging. This replacement for the default will then allow any new Water Mask and altitude mesh to display correctly. And if the local scenery is removed, the default Water Mask is still intact in such a modified hyp file. I am very interested in your opinions, as you know how much we value what you think.By the way, Dick, I decided to take another look at your very clear and concise LWM tutorial and realized that it does not cover the new types of polygons and points. Undoubtedly, you wrote this back in the days of FS 2002. I wonder if you would consider updating the document - we would all benefit greatly.Luis, my friend, you are right that Dick's solution appears to resemble Peter's. There is one important difference: Dick does not place anything in the default folder. His solution addresses the true problem (which is scenery priority) without creating a potentially messy confusion. He keeps these duplicate files away from the default files and makes everything much clearer and neater. This has all sorts of advantages, I am sure you see.Jacky's program is available here in the AvSim library. I rarely recommend anything without indicating where it can be found, unless it is already right here.Best regards.Luis

Share this post


Link to post
Share on other sites

HiHappy new year everyone!Celebrations and a rampant stomach bug in the family took me away from this thread.It's back to [paid] work now, but scanning the thread I think I can see the answer in creating a new flatten polygon so I'll work on that one day soon. Any advise on utilities/tutorials gratefully received, but I'm sure I'll find them when I have time to search.Thanks for all your help.RegardsGraeme

Share this post


Link to post
Share on other sites

Hi all,>Again, thank you, Dick. This creative solution is so much>better than duplicating AFCAD files. You are absolutely right>and I just hope that anyone that is modifying airport>altitudes and distributing the files will make this very small>bgl and distribute it along with the rest of his files>acoompanied by detailed instructions. As usual, you come>through with solutions to the sticky problems.Bit late, but I just noticed this thread. In the NL2000 scenery team we have also been looking into this problem. And when we placed the additional file with the correct altitude in a lower priority scenery folder or in the sceneryworldscenery it seemed to work fine, but we got crashes when you read the weather from the internet.I don't know if this also happens if you use the small XML file Dick suggested, but I think it should be something we should be aware of.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Thank you very much, Arno. I suspected that there would be some complications to this approach of duplicate AFCAD files.Jacky's program is very easy to use. Perhaps anyone who is providing AFCAD files with a different reference altitude will consider recommending that anyone who downloads it should use JABBgl to modify the AP file. This will not have any hidden problems and directly solves the problem of conflicting altitudes.Best regards.Luis

Share this post


Link to post
Share on other sites

Yes, agreed. In the end we also edited the AP files involved and provided a configuration tool with the scenery to do the backup and restore of the default file.This seems the best solution, but in general the altitude of the MS scenery is correct, so these problems should not happen too often.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

just a reminder that duplicate afcads and ammending the AP file didn't work anyway! Still have sinking landing AI.RegardsGraeme

Share this post


Link to post
Share on other sites

For us it worked. The AI is working correctly in our scenery now.So you might have another problem beside this as well :(.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Graeme.I'm about as confused as you are. :(Let me get this straight.You have a copy of someone else's addon Hong Kong scenery.You want to change the elevation of that addon airport.Is this right?Does that author give you a FS2004 AFCAD in his addon?If so, this is what you need:1) Save his AFCAD under a different name, with the extention .ORIG, so you know it's the original, and that extension will deactivate that AFCAD.2) Reload his AFCAD into the AFCAD program, alter all the elevations where you want them, and resave the BGL to your Hong Kong scenery folder. 3) Make a copy of that new AFCAD and place it in the "C:Program FilesMicrosoft GamesFlight Simulator 9SceneryWorldscenery" folder.4) Now, make an LWM or SCASM flatten for that new elevation and shape, and place it alongside the altered AFCAD in your addon folder. At this point, all elevations should be good.Deactivate the original AFCAD, place the altered AFCAD in your Hong Kong scenery folder, place the LWM or SCASM flatten in your Hong Kong scenery folder, place the copy of the altered AFCAD in your World scenery folder. That's it.If you can't get this to work, why not zip the AFCADs, and the flatten you made, attach them to a post, and we can test this out, instead of guessing?Dick

Share this post


Link to post
Share on other sites
Guest luissa

HelloI just would like to refer that this elevation problem also affects "YOUR" aircraft in addition to the "AI" aircraft. If you do "Goto Airport" "YOUR" aircraft floats (if you increased the altitude of the airport) or sinks (if you lowered the altitude).Regards, LuisPS: anyone confirms crashes when loading weather as Arno referred to?

Share this post


Link to post
Share on other sites

Hi Luis,well, I decided to use Peter's tweak as modified by Dick for about 20 small airfields in Oregon/Washington (all re-defined in a single XML file) and I have had no problems at all with loading weather, pre-defined or real world. The nice thing about this approach, compared to JABbgl, is that it is so easily reversible. Well, I guess one could write scripts or instructions for reversing changes to the AP9*.bgl via JABbgl as well but the single small patch file seems much easier to uninstall.I'd be interested to hear more about the specific situations in which this method caused crashes for Arno or others.Cheers, HolgerP.S.: One interesting observation for U.S. users of AirNav data: the smaller the airfield the less accurate they are. FS slavishly used the data presented at AirNav.com but many airfields are either at a different location, different altitude, or have the runway(s) oriented differently. In fact, usually it's combination of those three factors and is the direct cause of the many airfields on plateaus or in ditches when using high-res ad-on mesh in mountainous terrain. I suspect the situation is similar in other countries.

Share this post


Link to post
Share on other sites
Guest luissa

>P.S.: One interesting observation for U.S. users of AirNav>data: the smaller the airfield the less accurate they are. FS>slavishly used the data presented at AirNav.com but many>airfields are either at a different location, different>altitude, or have the runway(s) oriented differently. In fact,>usually it's combination of those three factors and is the>direct cause of the many airfields on plateaus or in ditches>when using high-res ad-on mesh in mountainous terrain. I>suspect the situation is similar in other countries.Hi Holger,That is precisely what I am finding! Small airfields in Portugal are either displaced or have a wrong altitude. Regarding the altitude I can understand that, with standard terrain (30 second sampling interval - LOD ?), a designer could place the airfield at an altitude matching the terrain instead of the real value (or one could create plateaus or valleys). But when you have better elevation data you need to correct the altitudes.I will discuss more of this on a new topic ...Regards, Luis

Share this post


Link to post
Share on other sites
Guest luissa

>However, only the simple Airport info is needed, not the>entire copy of the new AFCAD. The code to set the ident,>latitude, longitude, and elevation can be done with a simple>XML-compiled code like this:Hi Dick,The elevation of the airport is not sufficient. In order for OUR aircraft to start at the correct altitude when using the "GoTo Airport" command I had to include the Start Positions. I am using this:<?xml version="1.0" encoding="ISO-8859-1"?>Regards,Luis

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...