Board index FlightGear Development AI Traffic

AI Navigation lights

Intelligent, computer controlled vehicles that drive/fly over the planet!

AI Navigation lights

Postby gooneybird » Sun Apr 11, 2021 9:57 pm

Has anyone else noticed that incoming AI aircraft have no navigation lights showing unless they have taken off from the local area, the strobes are working fine.
This is on FG 2020.3.6, if it has been fixed in later versions please ignore.

Not sure if this the correct way but as a temporary fix on my local files I've replaced the following in the ***-NavLights. xml :

Code: Select all
    <!-- Show Static Lights & Beacons when aircraft is moving -->
    <animation>
        <type>select</type>
        <object-name>StaticGrouped</object-name>
        <object-name>BeaconGrouped</object-name>
        <nopreview/>
        <condition>
            <greater-than>
                <property>transponder-id</property>
                <value type="string">0</value>
            </greater-than>
        </condition>
    </animation>


With this:
Code: Select all
    <!-- Show Static Lights & Beacons when aircraft is moving -->
    <animation>
        <type>select</type>
        <object-name>StaticGrouped</object-name>
        <object-name>BeaconGrouped</object-name>
        <nopreview/>
        <condition>
            <or>
                <greater-than>
                    <property>transponder-id</property>
                    <value type="string">0</value>
                </greater-than>
                <greater-than>
                    <property>velocities/true-airspeed-kt</property>
                    <value>10</value>
                </greater-than>
            </or>
        </condition>
    </animation>
My Github repository (mostly AI stuff) https://github.com/gooneybird47
User avatar
gooneybird
 
Posts: 3046
Joined: Sat May 31, 2008 2:57 pm

Re: AI Navigation lights

Postby portreekid » Mon Apr 12, 2021 7:14 am

While snarking around the AI I discovered that the AI Aircraft covers 9 distinctive legs.

Code: Select all
    case 1:
        retVal = createPushBack(ac, firstFlight, dep,
                                radius, fltType, aircraftType, airline);
    case 2:
        retVal =  createTakeoffTaxi(ac, firstFlight, dep, radius, fltType,
                          aircraftType, airline);
        break;
    case 3:
        retVal = createTakeOff(ac, firstFlight, dep, speed, fltType);
        break;
    case 4:
        retVal = createClimb(ac, firstFlight, dep, arr, speed, alt, fltType);
        break;
    case 5:
        retVal = createCruise(ac, firstFlight, dep, arr, latitude, longitude, speed,
                     alt, fltType);
        break;
    case 6:
        retVal = createDescent(ac, arr, latitude, longitude, speed, alt, fltType,
                      distance);
        break;
    case 7:
        retVal = createLanding(ac, arr, fltType);
        break;
    case 8:
        retVal = createLandingTaxi(ac, arr, radius, fltType, aircraftType, airline);
        break;
    case 9:
        retVal = createParking(ac, arr, radius);
        break;


I'm pretty sure I also saw code to set lights directly. Sadly I can't find it just now, but I'll have a look. Using other properties to guess these legs are a hack. The C++ code should provide a way to avoid this.
portreekid
 
Posts: 651
Joined: Tue Jan 14, 2014 4:36 pm
Location: Leipzig
Callsign: PORTREE
Version: 2020.2.1
OS: Windows 10

Re: AI Navigation lights

Postby gooneybird » Mon Apr 12, 2021 2:18 pm

The same problem also affects AI aircraft already in motion when the sim starts.
My Github repository (mostly AI stuff) https://github.com/gooneybird47
User avatar
gooneybird
 
Posts: 3046
Joined: Sat May 31, 2008 2:57 pm

Re: AI Navigation lights

Postby BecOzIcan » Mon Apr 12, 2021 3:06 pm

@portreekid : Properties introduced recently By Stuart who added them to AI Airbus aircrafts https://wiki.flightgear.org/AI_Traffic. Issue found with parked aircraft (lights always on) fix should have been deployed by now.
@gooneybird: Thisd is my xml, I ll look into the incoming aircraft navlights.

Cheers
Ian
Current Projects: AI Traffic, Models & Liveries
User avatar
BecOzIcan
 
Posts: 1302
Joined: Tue Oct 04, 2011 11:43 pm
Location: Sydney, NSW, Australia
Version: 2020.4.0
OS: Win10

Re: AI Navigation lights

Postby portreekid » Mon Apr 12, 2021 3:41 pm

That's why I couldn't find them. I haven't the most recent changes. We should definitely move to that approach.
portreekid
 
Posts: 651
Joined: Tue Jan 14, 2014 4:36 pm
Location: Leipzig
Callsign: PORTREE
Version: 2020.2.1
OS: Windows 10

Re: AI Navigation lights

Postby BecOzIcan » Tue Apr 13, 2021 9:01 am

@gooney

Your suggested change makes a lot of sense.

I had noticed before that on sim start departing aircrafts where 'phantom' ones ie did not have any transponder ID.
but never realized it was also the same for arriving flights.

Adding a speed condition like you did corrects the problem. I will deploy that to the rest of the models as I update the xmls to leverage the new properties

Cheers
Ian
Current Projects: AI Traffic, Models & Liveries
User avatar
BecOzIcan
 
Posts: 1302
Joined: Tue Oct 04, 2011 11:43 pm
Location: Sydney, NSW, Australia
Version: 2020.4.0
OS: Win10

Re: AI Navigation lights

Postby gooneybird » Tue Apr 13, 2021 9:56 am

It also has the advantage of the lights going out when stopping at parking pos. but they then come on as normal for the next flight.
The only minor drawback is the lights go out if the AI stops while taxiing, but that problem is currently present in propeller driven aircraft anyway, I changed <property>velocities/true-airspeed-kt</property> value from 10 to 0 so the lights spend less time off while taxiing.

I only noticed the problem when I added a VC-10 flight from London to New York and was waiting for it to arrive when I realised none of the incoming aircraft had nav lights showing only strobes.

I'll grab a nightly in the next few days and give that a try.
My Github repository (mostly AI stuff) https://github.com/gooneybird47
User avatar
gooneybird
 
Posts: 3046
Joined: Sat May 31, 2008 2:57 pm


Return to AI Traffic

Who is online

Users browsing this forum: No registered users and 4 guests