Board index FlightGear Development AI Traffic

Bird strikes script

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

Bird strikes script

Postby gustavo oliveros » Sat Sep 18, 2010 5:34 pm

Hello!
watching some videos on youtube on bird collisions with airplanes, I got the idea that someone could make "AI file", which included a model. ac a bird, an xml saying that when the bird is the engine passes goal something like this:

or...

the latter is a bit disgusting, but it happens ... :|
I think they should make these "virtual birds, near the airport, to increase the risk :twisted:

PS: Happy bicentennial of Chile!!! :D
We are a small dot in the known universe ... and the unknown?
Vive FlightGear! Have you a Ñ on your keyboard? Spain-LatinAmerica FlightGear community
CC-GOM
My Airport: SCSE (La Serena, Chile)---some screenshot: front-- back--taxi lights
User avatar
gustavo oliveros
 
Posts: 27
Joined: Sat Sep 04, 2010 9:28 pm
Location: La serena, Chile (SCSE)
Callsign: CC-GOM
Version: cuatro

Re: Bird strikes script

Postby Hooray » Sat Sep 18, 2010 7:33 pm

Using the AI system should work for something like this.
However, personally I would model a whole flock of birds instead of a single bird.
That should be less complicated, and increase the collision risk.

Another issue is that there is no collision detection being done for AI models.
So you would need to model this yourself, by using the aircraft position, computing an offset for vital points (i.e. engines, ailerons, elevator) and then simply set a property to cause a malfunction, so that the corresponding engines or control surfaces get disabled.

This sort of thing probably will not work too well with the conventional AI flight plans.
But you can control an AI object using Nasal. The neat thing about this approach would also be that you could model the birds behave realistically.
For example, the local weather system models also thermal lift - which could be used for making the birds fly where the thermals are.

In this sense, this would also be useful for other uses - glider pilots routinely rely on birds to find thermal activity.
Bottom line, I think the idea is pretty good and could be useful for a number of things.

If you want to look into this, you'll probably want to check out the $FG_ROOT/Nasal/tanker.nas file - which shows you how to control objects from Nasal.
In the beginning, you could even continue using the tanker as a "very big bird". Later on, you could use a smaller 3D model. But it's probably not too difficult to find a 3D model for a bird. Animations might be a bit more complicated, though.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: Bird strikes script

Postby Hooray » Wed Sep 22, 2010 8:31 am

Just to prove my point: It really doesn't take any longer than say 2-3 minutes to open the tanker.nas script, change the model file name to point to the 3D model of a bird, what you end up with is a "funny bird" flying at 330+ kts ground speed at 17000 ft AMSL (I took the first freely available bird model that I could find...):

Image

As a next step, one could change the heuristics that move the bird (assuming that you don't want it to keep flying refueling patterns...), making it search actual thermals (local weather) would also not seem too complicated - it would just involve calls into the local weather code.

Probably, you'll want to add some collision detection code then.
Once this is working, you may want to animate the whole thing and probably change its size, too.

Like I said, it's all perfectly possible with the tanker.nas script.

Also, please do let me know if you need help creating "effect contrails" out of feathers and blood, okay :lol:
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: Bird strikes script

Postby Johan G » Wed Sep 22, 2010 6:35 pm

Here's another classic YouTube clip:

It seems that the "pumping" flameout is a common thing.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5437
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit


Return to AI Traffic

Who is online

Users browsing this forum: Applebot [Bot] and 1 guest