Board index FlightGear Development AI Traffic

animating AI PA-28 lights  Topic is solved

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

Re: animating AI PA-28 lights

Postby wkitty42 » Thu Aug 02, 2018 7:03 pm

WoodSTokk wrote in Wed Aug 01, 2018 11:49 pm:@wkitty42
Why do you control the lights via the effect?
Code: Select all
<intensity_scale type="float"><use>controls/lighting/beacons</use></intensity_scale>

thats what makes the blink patterns...

WoodSTokk wrote in Wed Aug 01, 2018 11:49 pm:I think you can also turn on/off via a select animation.
Code: Select all
<animation>
    <type>select</type>
    <object-name>BeaconGrouped</object-name>
    <condition>
        <property>controls/lighting/beacon</property>
    </condition>
</animation>

AFAIK, that's what we're using to see them at all... at least for now... i know it isn't as smooth a flow as it should be but we're working on it... plus that should end in "enabled"... i don't know which is better... having the effect to do the blinks or leave the lights on full intensity and use the select to blink them... that's something we would need to figure out and test...

WoodSTokk wrote in Wed Aug 01, 2018 11:49 pm:I don't know if the property will automaticaly taken from /ai/models/aircraft[n]/.
But i think there is a possibility for relative property path.

not automatically, no... we are using relative property paths now since we finally figured out the nasal and how to get it to put the code and properties in ai/models/aircraft*...

i should mention that that code was posted as an example that was working but we've made a lot of changes since then... i know that at least two files have been adjusted several times and then copied to other craft as we work to generalize the process...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: animating AI PA-28 lights

Postby wkitty42 » Thu Aug 02, 2018 7:08 pm

BecOzIcan wrote in Thu Aug 02, 2018 4:05 am:
wkitty42 wrote in Wed Aug 01, 2018 9:21 pm:cool! did you catch the code fix for nasal so we can stop polluting /sim/model with the various craft and their lighting property branch? i know you may not be using it but it is good information to know if we need it in the future ;)


Correct, I have no nasal at all in my newest code. Only touchpoint with /sim/model is reading the existing Transponder Value to trigger my beacons animation.

we shouldn't be using /sim/model at all... that has another purpose and we've been polluting it with our AI light blinking code... that's why i've been saying that we need to be using the craft's personal ai/models/aircraft* property tree or we need to find another place to use...

i've thought about having a setting in the AI menu where we can disable all AI Traffic lights... that means having a global property that has to be true for any of these lights to work... then each set of lights can be turned on/off by another property... that would be the enabled property, i think... kinda like each set's own toggle switch in the craft... if we're not going to be using the nasal code any more, then we need a third property to make the blinks...

the transponder value is in transponder-id and that is not anywhere near /sim/model... it is in whichever /ai/models/aircraft* tree that belongs to the craft at hand...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: animating AI PA-28 lights

Postby WoodSTokk » Fri Aug 03, 2018 1:32 am

wkitty42 wrote in Thu Aug 02, 2018 7:03 pm:
WoodSTokk wrote in Wed Aug 01, 2018 11:49 pm:@wkitty42
Why do you control the lights via the effect?
Code: Select all
<intensity_scale type="float"><use>controls/lighting/beacons</use></intensity_scale>

thats what makes the blink patterns...

But if you use a boolean property for intensity, the final effect is exacly the same.

wkitty42 wrote in Thu Aug 02, 2018 7:03 pm:
WoodSTokk wrote in Wed Aug 01, 2018 11:49 pm:I think you can also turn on/off via a select animation.
Code: Select all
<animation>
    <type>select</type>
    <object-name>BeaconGrouped</object-name>
    <condition>
        <property>controls/lighting/beacon</property>
    </condition>
</animation>

AFAIK, that's what we're using to see them at all... at least for now... i know it isn't as smooth a flow as it should be but we're working on it... plus that should end in "enabled"... i don't know which is better... having the effect to do the blinks or leave the lights on full intensity and use the select to blink them... that's something we would need to figure out and test...

The strobes doesn't fade in and fade out. Thats are flasher like on a photocamera. I think the cheapest method is the select animation.
Also the most rotating beacon are today lights with on/off cycles.
But if you lighting up a old aircraft (like the PA-28), they have in real a rotating beacon.
For that you need a filter or nasal script that generate a float thats run from 0.0 to 1.0 and back and use that property for intensity.
Or you let rotate a texture. Look at the latest Citation II where i have updated the beacon.
The light of the beacon will be formed from two textures. The first is a billboard animation and strong transparent (to show a permanent corona if the beacon is on). The second is a cone with a rotate animation. And thats without nasal or filter.
WoodSTokk
 
Posts: 1077
Joined: Tue Oct 17, 2017 3:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: SX-W57
IRC name: WoodSTokk
Version: 2020.4.0
OS: Debian Bullseye

Re: animating AI PA-28 lights

Postby BecOzIcan » Fri Aug 03, 2018 2:39 am

wkitty42 wrote in Thu Aug 02, 2018 7:08 pm:the transponder value is in transponder-id and that is not anywhere near /sim/model... it is in whichever /ai/models/aircraft* tree that belongs to the craft at hand...


Wrong wording, I meant my only touchpoint to PropertyTree is Transponder reading so no pollution at all once I have completed my ALS migration
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: animating AI PA-28 lights

Postby wkitty42 » Fri Aug 03, 2018 4:39 pm

WoodSTokk wrote in Fri Aug 03, 2018 1:32 am:
wkitty42 wrote in Thu Aug 02, 2018 7:03 pm:thats what makes the blink patterns...

But if you use a boolean property for intensity, the final effect is exacly the same.

the pattern is the goal... not some plain on/off/on/off/on/off...

WoodSTokk wrote in Fri Aug 03, 2018 1:32 am:The strobes doesn't fade in and fade out. Thats are flasher like on a photocamera. I think the cheapest method is the select animation.

the strobes are not fading in and out like a beacon does... they are flashing with a 0.02 on time... that's two hundredths of a second... immediate on, immediate off...

as stated previously, we're still working on it... right now, just getting lights to show is a plus... refining their appearance comes later ;)
Last edited by wkitty42 on Fri Aug 03, 2018 4:40 pm, edited 1 time in total.
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: animating AI PA-28 lights

Postby wkitty42 » Fri Aug 03, 2018 4:40 pm

BecOzIcan wrote in Fri Aug 03, 2018 2:39 am:
wkitty42 wrote in Thu Aug 02, 2018 7:08 pm:the transponder value is in transponder-id and that is not anywhere near /sim/model... it is in whichever /ai/models/aircraft* tree that belongs to the craft at hand...


Wrong wording, I meant my only touchpoint to PropertyTree is Transponder reading so no pollution at all once I have completed my ALS migration

oops! ok :)

so just the transponder? not even the speed or valid properties any more?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: animating AI PA-28 lights

Postby WoodSTokk » Fri Aug 03, 2018 8:51 pm

wkitty42 wrote in Fri Aug 03, 2018 4:39 pm:the pattern is the goal... not some plain on/off/on/off/on/off...

I know, but this is simple. Give the select animation a timed condition (based on sim/time/elapsed-sec).
Code: Select all
    <animation>
        <type>select</type>
        <object-name>strobe.left</object-name>
        <object-name>strobe.right</object-name>
        <condition>
            <and>
                <property>controls/lighting/strobe</property>
                <less-than>
                    <expression>
                        <mod>
                            <sum>
                            <!-- add reciprocal of ID to time for desync all planes -->
                                <div>
                                    <value>1.0</value>
                                    <property>id</property>
                                </div>
                                <property>sim/time/elapsed-sec</property>
                            </sum>
                            <value>1.0</value>
                        </mod>
                    </expression>
                    <value>0.02</value>
                </less-than>
            </and>
        </condition>
    </animation>

wkitty42 wrote in Fri Aug 03, 2018 4:39 pm:the strobes are not fading in and out like a beacon does... they are flashing with a 0.02 on time... that's two hundredths of a second... immediate on, immediate off...

Thats exacly what the above animation does.

wkitty42 wrote in Fri Aug 03, 2018 4:39 pm:as stated previously, we're still working on it... right now, just getting lights to show is a plus... refining their appearance comes later ;)

And i show what comes to my mind and deliver eventually new ideas ;)
Last edited by WoodSTokk on Sat Aug 04, 2018 5:52 am, edited 1 time in total.
WoodSTokk
 
Posts: 1077
Joined: Tue Oct 17, 2017 3:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: SX-W57
IRC name: WoodSTokk
Version: 2020.4.0
OS: Debian Bullseye

Re: animating AI PA-28 lights

Postby wkitty42 » Sat Aug 04, 2018 2:20 am

ok thanks! sometimes it is confusing when "advanced" code is posted... i've looked over all the code posted but some of it just doesn't make sense when it is out of context... i'll definitely keep your posts in mind when i resume my messing around with the AI lights code... for now, i'm going to back off a bit, save some code and revert my local living repo to what is in the upstream (ie: SF FG) repos... this way i can also keep up with what i'm actually doing easier and not getting confused over older code working and newer code not... or the other way around...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Previous

Return to AI Traffic

Who is online

Users browsing this forum: No registered users and 4 guests