Status of AI in FlightGear: Difference between revisions
Line 39: | Line 39: | ||
|author=<nowiki>Hooray</nowiki> | |author=<nowiki>Hooray</nowiki> | ||
|date=<nowiki>Thu Aug 29</nowiki> | |date=<nowiki>Thu Aug 29</nowiki> | ||
}} | |||
}} | |||
{{FGCquote | |||
|the code to do this is already readily available in FlightGear. <br/> | |||
[http://gitorious.org/fg/fgdata/blobs/master/Nasal/tanker.nas $FG_ROOT/tanker.nas] is a good demonstration for code that iterates over the AI properties. <br/> | |||
Another good example is the multiplayer pilot list, which also iterates over the property tree.<br/> | |||
You only need to combine snippets from these two files to come up with what you need. | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=103863&sid=287f5e97edb454a41f517f8c4d2eb7f3#p103863 | |||
|title=<nowiki>Re: Working with AI/Multiplayer properties</nowiki> | |||
|author=<nowiki>Hooray</nowiki> | |||
|date=<nowiki>Mon Nov 29</nowiki> | |||
}} | }} | ||
}} | }} |
Revision as of 09:34, 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 code to do this is already readily available in FlightGear. $FG_ROOT/tanker.nas is a good demonstration for code that iterates over the AI properties. |
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) |