Status of AI in FlightGear: Difference between revisions
Line 67: | Line 67: | ||
|author=<nowiki>Hooray</nowiki> | |author=<nowiki>Hooray</nowiki> | ||
|date=<nowiki>Mon Feb 04</nowiki> | |date=<nowiki>Mon Feb 04</nowiki> | ||
}} | |||
}} | |||
{{FGCquote | |||
|he simplest solution is probably using scripted AI traffic nodes. Note however that AI traffic cannot currently make use of any FDMs (JSBSim/YaSim), instead you need to come up with your own "pseudo FDM" in scripting space.<br/> | |||
<br/> | |||
You might be able to circumvent this restriction by coming up with a separate FDM and communicating with FG using sockets.<br/> | |||
<br/> | |||
We have a number of more or less complex examples for this. $FG_ROOT/Nasal/tanker.nas is the simplest test case you'll find, which basically spawns an "AI tanker" that can be used for refueling purposes. It would be possible to generalize the script some more in order to spawn an arbitrary number of aircraft. Also, you could equip them with a scripted control loop, so that each node can be controlled individually, i.e. by either setting a bunch of properties, or even by issuing ATC instructions.<br/> | |||
<br/> | |||
Curt has recently provided a more complex example.<br/> | |||
The most complex example for this technique is certainly the "bombable addon" which implements "AI bots" entirely in scripting space to provide "dog fighting" support.<br/> | |||
<br/> | |||
I would suggest to search the archives (wiki, forum, mailing list) and look into the aforementioned examples.<br/> | |||
<br/> | |||
Also, you'll inevitably need to look into the Nasal documentation, too: [[Nasal_scripting_language]] | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=146562&sid=5da9333fd84aa2d8c0e6f3235e6acb11#p146562 | |||
|title=<nowiki>Re: Multiple intelligent flyers</nowiki> | |||
|author=<nowiki>Hooray</nowiki> | |||
|date=<nowiki>Tue Jan 03</nowiki> | |||
}} | }} | ||
}} | }} |
Revision as of 09:33, 26 June 2014
AI Scenarios vs. Scripting
The AI system itself is not all that flexible, but the various scripted approaches (tanker.nas, bombable etc) do use it as the backend for placing traffic, even though all the control logic is then handled in scripting space.
— Hooray (Thu Aug 29). Re: Suitability of this software to run a swarm simulation.
(powered by Instant-Cquotes) |
the most flexible approach would be using scripting - FligthGear has a built-in scripting language (called "Nasal"), that can be used to control aircraft, and even to instantiate multiple AI aircraft, one of the most straightforward examples is the "tanker.nas" script, which creates a fully scripted AI tanker - that could be easily extended to create dozens of tankers, and obviously you could also change the 3D model if you wanted to. In fact, we have a separate addon, named "bombable" that adds "AI bots" to the simulator, for dogfighting purposes - none of that required C++ changes, it's all done in scripting space. Another users implemented a fully scripted missile (fox2.nas) that tracks aircraft - and we also have a feature for "wingman" support, too.
— Hooray (Wed Aug 28). Re: Suitability of this software to run a swarm simulation.
(powered by Instant-Cquotes) |
Scripted AI in FlightGear
Another example is the "tanker.nas" script in $FG_ROOT which implements a simple scripted AI tanker for AAR purposes: search.php?st=0&sk=t&sd=d&sr=posts&keywords=tanker.nas http://www.mail-archive.com/search?q=ta ... eforge.net <iframe width="420" height="315" src="http://www.youtube.com/embed/LL7bdHrR8uI" frameborder="0" allowfullscreen=""></iframe>
— Hooray (Mon Feb 04). Re: Possibility to run a fully automatized mission ?.
(powered by Instant-Cquotes) |
he simplest solution is probably using scripted AI traffic nodes. Note however that AI traffic cannot currently make use of any FDMs (JSBSim/YaSim), instead you need to come up with your own "pseudo FDM" in scripting space.
|
Scripted AI Missiles
xiii is the developer of the F14b's fox2 implementation, the original thread was: Subject: Missiles with seeking capabilities.
<iframe width="420" height="315" src="http://www.youtube.com/embed/UL7jQkl1qe4" frameborder="0" allowfullscreen=""></iframe>
|
Fully Automatized Missions
Yes, it is possible "to make" such a mission - but you will literally have to MAKE it by writing a script to outline all required steps for your aircraft. Curt did that a while back for the f14b, which did a fully automated carrier approach using just Nasal scripting: <iframe width="420" height="315" src="http://www.youtube.com/embed/cvbtSG9cy20" frameborder="0" allowfullscreen=""></iframe>
— Hooray (Mon Feb 04). Re: Possibility to run a fully automatized mission ?.
(powered by Instant-Cquotes) |