Question about parking codes

Let's hear all about the eye candy at those military bases.
Post Reply
Blank Fang
MAIW Veteran
MAIW Veteran
Posts: 449
Joined: 29 Aug 2006, 16:32
Version: FS9
Location: LSZH

Question about parking codes

Post by Blank Fang »

Maybe this has been asked before but how are the parking codes being dealt with by FS AI engine.
in AFCAD
M001 F5 F18
M001 F5
M001 F18
aircraft.cfg
atc_parking_codes=F5
atc_parking_codes=M001,F18

Now the F/A-18's appear on all spots including the M001 F5 ones. whereas the F-5's seem to respect the M001 F18 ones.

Can someone explain how these priorities are being handled. I even think having read somewhere that the aircraft cfg is only interpreted to the first position!

Any clue :?:
Thanks in advance
-----
Willy
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12137
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: Question about parking codes

Post by Firebird »

The ones marked atc_parking_codes=F5 will park in a slot coded 'F5' that the aircraft can fit in size-wise, somewhere in its list. Only when it can't find one will it look for any other slot that matches its parking type and size.
The ones marked atc_parking_codes=M001,F18 will park in a slot marked 'M001' that allows an aircraft of its size, which includes the ones you have coded for the F5s.

Parking can be a complicated thing. I would suggest that if you are not going to use unit codes, only type codes then the slots in your specific afcad example should be :-
F5 F18 M001
F5 M001
F18 M001
With the aircraft parking codes :-
atc_parking_codes=F5,M001
atc_parking_codes=F18,M001

Another tool that you can use is altering the slot size in the afcad so that the F5 slots are too small for the F18s to park there but big enough for the F5s, but maybe you won't need to worry about that.
I understand that the second parm in the arcraft.cfg is ignored in FS9 and so is really only there for book-keeping purposes.
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
Blank Fang
MAIW Veteran
MAIW Veteran
Posts: 449
Joined: 29 Aug 2006, 16:32
Version: FS9
Location: LSZH

Re: Question about parking codes

Post by Blank Fang »

Thanks for the fast reply Steve
That clarifies it. I'll give this a try and see the effect.
-----
Willy
User avatar
kungfuman
Lieutenant Colonel
Lieutenant Colonel
Posts: 845
Joined: 01 Jun 2008, 18:21
Version: FS9
Location: EGGD

Re: Question about parking codes

Post by kungfuman »

May I suggest that having more than one code in the "atc_parking_codes=" muddies the water, and should be avoided - even for book-keeping reasons.

Chances are that somewhere down the road either you, or someone else, will see your multiple code entries and be mislead into thinking that they serve some purpose, which they don't. In fact, this is likely to be the source of your current confusion on the matter: You saw multiple code entries, and have thus (incorrectly) assumed that they serve some purpose.

Of course, you are free to do what you want. I'm only trying to prevent potential future confusion...
Dan
User avatar
kungfuman
Lieutenant Colonel
Lieutenant Colonel
Posts: 845
Joined: 01 Jun 2008, 18:21
Version: FS9
Location: EGGD

Re: Question about parking codes

Post by kungfuman »

As to how the FS AI engine works out what parks where, there is a section in the AFCAD help file that explains this fairly concisely.

But basically, when the FS ai engine needs to assign an aircraft to a parking space, it takes certain info from the aircraft FDE (model radius, "atc_parking_type=" and "atc_parking_code=" values) and uses this data to find a suitable parking spot from the pool of available parking spots. It does this on a "first come first served" basis. So as the parking spots are assigned to aircraft, the pool of remaining available spots gets smaller, and the chance that there will be a suitable spot sharing the same code as the aircraft reduces too. So the more traffic you have, the greater the chance that there will be aircraft that have nowhere suitable to go, resulting in aircraft in "wrong" places - or sometimes not even appearing at all if all the spots large enough for the aircraft are already occupied.

While codes are the most obvious way to affect where ai aircraft will park, they are not able to have the final say - sometimes other factors come into play that will result in aircraft parked in spots that do not share the same codes. The only absolute control that you can have over parking is with parking radius: You can be certain that an aircraft will never park in a parking spot with a smaller radius than the model. This is the most "absolute" tool at your disposal, in that this "rule" will never be broken. So when your ai aircraft needs to be sent to a parking spot, the only possible contending spots will be the empty spots with a radius greater than or equal to the aircraft model radius. If you like, we now have a reduced "pool" consisting of only those unoccupied spots that are large enough for the aircraft.

Next, you need to consider how the "AI engine" works out the most preferable parking spot from the remaining pool. But first, understand this: As long as there is a large enough empty parking spot somewhere, the aircraft will park - irrespective of whether or not that parking spot shares the same code as the aircraft. So, because of this fact, codes are not as powerful a tool as radius size: they do not have the same "absolute" control that radius has in being able to exclude large aircraft from smaller parking spots. Coded parking spots cannot exclude aircraft with different codes from using that spot entirely on their own.

There are different ways to describe this, and essentially it is down to an internal scoring system within the programme code - with the final decision of where to park the aircraft being worked out as the parking spot with the best score.

Effectively how this plays out can be explained like this: Take the reduced "pool" of qualifying parking spots I referred to above, and split it into two groups: First, those with a Parking_Type that corresponds to the "atc_parking_type=" entry of the aircraft, and second, those that don't. (I say "correspond" because the various parking_spot_types do not exactly match the "atc_parking_types=" aircraft.cfg entries.)

Now take the first group, and list the spots in order of radius size, going from smallest to largest. If some of them share the same size, then within that same-size-sub-section, list them in order of their index number (ie. the order they appear in AFCAD's "parking list" view). Finally, work your way through that list (from top to bottom) until you find a parking spot that includes the same code as you have in your aircraft's "atc_parking_codes=" entry. This will be the parking spot that the aircraft will be assigned to.

If necessary, move on to the second group, having ordered it in the same way as the first (I have made a minor simplification here for brevity). If none of the spots in the reduced "pool" of qualifying parking spots has a matching parking code, then take the first group, list it in radius order as before, but this time rather than look for a matching code, you are looking for a spot with no codes (and continue to the second group if necessary, as before). If there are no available un-coded spots, then I think it goes to the spot with the least number of codes.

So, in a nutshell: FS will look through the empty parking spots which are big enough to fit the aircraft model, and will send the aircraft to the smallest possible spot that contains the correct code. If there is more than one smallest possible spot to choose from, it will park in the spot highest up the "Parking List" as viewed in AFCAD. If none of the spots have the same code as the aircraft, then it is a little more complex, but basically FS will try to park it in an un-coded spot if possible.


Sorry if that's a bit of a "head do" to read through, but hopefully it will help you understand the issue of priorities a little better. All the above is merely an explanation of how an aircraft is assigned to a parking spot. Questions about good practice in the coding of parking spots by afcad designers is another seperate matter, deserving of a seperate answer.

Cheers,

Dan
Dan
User avatar
gsnde
MAIW Admin
MAIW Admin
Posts: 4381
Joined: 05 Apr 2007, 08:13
Version: P3D
Location: South-West Germany
Contact:

Re: Question about parking codes

Post by gsnde »

Firebird wrote: I understand that the second parm in the arcraft.cfg is ignored in FS9 and so is really only there for book-keeping purposes.
That is true to the letter :smt002 FSX does honor more than one parameter which allows a more flexible configuration.
Cheers,
Martin
________________________________________
The Owl's Nest * Military Aircraft Reference * ICAO Reference * Distance Calculator * MAIW, Military AI & UKMil Reference
User avatar
Joecoastie
Lieutenant Colonel
Lieutenant Colonel
Posts: 860
Joined: 30 Jan 2007, 17:46
Version: P3D
Location: 8.2mi/077 radial of GVE

Re: Question about parking codes

Post by Joecoastie »

Excellent write-up, Dan.
Service to my Country 9/61 - 2/03
US Navy - HS-3, VX-1, HS-7 (USS Intrepid, USS Wasp, USS Yorktown)
Va National Guard - 229th Cbt Avn Co
US Coast Guard - E City CGAS, CGC Morro Bay, RTC Yorktown
NOAA - Co-op Observer 1983 - present
Blank Fang
MAIW Veteran
MAIW Veteran
Posts: 449
Joined: 29 Aug 2006, 16:32
Version: FS9
Location: LSZH

Re: Question about parking codes

Post by Blank Fang »

Thanks Dan
Probably the best summary I could get. :smt023
-----
Willy
User avatar
kungfuman
Lieutenant Colonel
Lieutenant Colonel
Posts: 845
Joined: 01 Jun 2008, 18:21
Version: FS9
Location: EGGD

Re: Question about parking codes

Post by kungfuman »

Your welcome, let's just hope I got it mostly right... :lol:
Dan
Post Reply