Board index FlightGear Development Tutorials and missions

AI support

Interactive in-sim tutorials and missions

AI support

Postby Hooray » Fri Apr 25, 2014 7:51 am

DFaber wrote in Wed Apr 23, 2014 6:53 am:The AI System btw. has it's drawbacks regarding non-aircraft Entities. Also it is hard to pass specific Properties to an AI Model. It will always try to bank and pitch, which needs to be corrected per Model. This all can be solved by using animations and Nasal, but creates a lot overhead.


flug mentioned a while ago that he ran into the same issue with regard to his bombable/combat addon:

Subject: AI & MP Dogfighting now working! Bombable ships, aircraft...
Hooray wrote:
One basic problem is that Bombable is basically sitting on top of the FG AI flight system, which is indeed designed to make aircraft fly "like airliners". There is some improvement in the latest ver of Bombable (4.4q) but real improvement will depend on a solution like Hooray outlines above.
As I've mentioned in a few other messages, Bombable is always limited by FG's native AI flight system, which is very sedate both as far as turning and (even more so) climbing & diving. It's really designed to model airliners flying sedately from there to there & it will take just a few changes to the underlying C code to make more complex & aggressive maneuvers possible.


A while ago, durk also mentioned being certainly supportive of making his AI system more flexible and controllable, so that it could be better controlled/customized from Nasal space:

http://flightgear.org/forums/viewtopic. ... 15#p134970
durk wrote:if you have nasal code that would require certain components of the AI system to be shutdown, or need specific hooks to interface certain C++ components with nasal bindings, than I would certainly be willing to support that.



Subject: AI & MP Dogfighting now working! Bombable ships, aircraft...
Hooray wrote:
flug wrote in Fri Oct 14, 2011 6:57 pm:One basic problem is that Bombable is basically sitting on top of the FG AI flight system, which is indeed designed to make aircraft fly "like airliners".


I was looking into the code, and I think this is a "problem" that can be easily solved by disabling some of durk's AI traffic code, basically it is simply "too smart" and making too many assumptions about the type of aircraft/flights it is controlling, at the moment.

Disabling code should be merely a matter of introducing a bunch of new properties to make such assumptions optional.
Sort of like a more pure, or a "raw" controlling mode where everything related to "airliner assumptions" is simply disabled.

I think, durk won't mind that at all, because it's not really introducing new code or touching existing code, it would by default keep everything "as is", but only introduce a bunch of control properties to disable some of these defaults.

For your Nasal code, that would basically mean to set those new properties and handle those things in Nasal space instead. Maybe, you could come up with a list of "airliner-characteristics" that you would like to disable/control yourself eventually?


If you can provide a list of problematic behavior patterns, I can check the C++ code to see if/how things can be made more configurable there, i.e. with a focus on non-aircraft, but also aircraft that may not fly like airliners :?:
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: AI support

Postby DFaber » Fri Apr 25, 2014 3:54 pm

Hooray wrote in Fri Apr 25, 2014 7:51 am:If you can provide a list of problematic behavior patterns, I can check the C++ code to see if/how things can be made more configurable there, i.e. with a focus on non-aircraft, but also aircraft that may not fly like airliners :?:


OK, here's my wishlist part 1:


Disable the banking when turning with Ground Vehicles. There are Ground vehicles in FG, but mainly Trains, which I haven't been able to utilize for Cars. Also Cars need to lookup Ground elevation which AI Aircraft don't do too.

FG determines submodel hits on AI/MP Objects by square Boxes around the Aircrafts Origin. These are too wide to be useful with Ground Vehicles and small Aircraft. Some more Size opions would be useful.

When a new Target Heading is selected AI Aircraft don't turn harder than 30 degrees. It would be good to be able to configure this per Aircraft.

I'd like to specify Model specific Properties like Livery, Type in the AI Scenario file. Right now I need to create and set them within the nasal section.

These are some from the top of my head. More to come ...

Thanks and

Greetings
Detlef Faber
FlightGear Development:
http://flightgear-de.net

German FlightGear Forum
http://forum.flightgear-de.net
DFaber
 
Posts: 687
Joined: Fri Dec 01, 2006 7:51 pm
Location: Aachen, Germany
Version: GIT
OS: Linux

Re: AI support

Postby portreekid » Mon Feb 16, 2015 2:00 pm

I'm just looking in to the AI code since I'm not happy with the pitch calculation of trains.
  • Is there a central resource for ideas? Or are they posted here?
  • The fgai for HLA seems to be dead. Anybody working on it?
portreekid
 
Posts: 336
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7

Re: AI support

Postby Hooray » Mon Feb 16, 2015 2:37 pm

portreekid wrote in Mon Feb 16, 2015 2:00 pm:Is there a central resource for ideas? Or are they posted here?

To be honest, the AI component hasn't been actively maintained over the last few years - so you can find ideas all over the place, not just here, but also in the devel list archives.
Ideally, the issue tracker would be used for such things - so that whenever people are taking an interest in getting involved, they can just look through open bugs and feature request.

A summary of the main discussions revolving around the AI traffic system is kept here (I originally started this in response to some frequently asked questions on the forum, but contributions/help etc are definitely appreciated): http://wiki.flightgear.org/Status_of_AI_in_FlightGear
This definitely requires some attention, i.e. it's a huge collection of quotes from various sources, broadly categorized according to the focus of each discussion.


portreekid wrote in Mon Feb 16, 2015 2:00 pm:I'm just looking in to the AI code since I'm not happy with the pitch calculation of trains.

This "collection of quotes" is already useful in that it does cover a few things that you are apparently interested in:

Subject: Tutorials/Missions/Adventures: requests for features
DFaber wrote:The AI System btw. has it's drawbacks regarding non-aircraft Entities. Also it is hard to pass specific Properties to an AI Model. It will always try to bank and pitch, which needs to be corrected per Model. This all can be solved by using animations and Nasal, but creates a lot overhead.


Subject: AI support
DFaber wrote:
Hooray wrote in Fri Apr 25, 2014 7:51 am:If you can provide a list of problematic behavior patterns, I can check the C++ code to see if/how things can be made more configurable there, i.e. with a focus on non-aircraft, but also aircraft that may not fly like airliners :?:


OK, here's my wishlist part 1:


Disable the banking when turning with Ground Vehicles. There are Ground vehicles in FG, but mainly Trains, which I haven't been able to utilize for Cars. Also Cars need to lookup Ground elevation which AI Aircraft don't do too.

FG determines submodel hits on AI/MP Objects by square Boxes around the Aircrafts Origin. These are too wide to be useful with Ground Vehicles and small Aircraft. Some more Size opions would be useful.

When a new Target Heading is selected AI Aircraft don't turn harder than 30 degrees. It would be good to be able to configure this per Aircraft.

I'd like to specify Model specific Properties like Livery, Type in the AI Scenario file. Right now I need to create and set them within the nasal section.

These are some from the top of my head. More to come ...



The latest, and most generic, effort involving scripted AI objects is Red Leader's work, for details refer to the wiki: http://wiki.flightgear.org/Scripted_AI_Objects

The fgai for HLA seems to be dead. Anybody working on it?

fgais was started by F-JJTH, and it got killed/stalled when some of the more/most senior core developers (specifically Mathias) stated that they'd believe the approach taken there would be a dead-end due to a number of reasons, but mainly because the traffic injected into FG would be entirely "passive" and never interact with the simulation as a whole, including other AI traffic, the main aircraft but also ATC. In addition, there are technical scaling issues. However, the code as such works and can be easily built (it being based on fgms). Personally, I believe the concept to be "useful" and working well enough for people just wanting more going on. I think there are 2-3 bugs involving segfaults IIRC - but those should be easy to fix for someone familiar with C++. IIRC, the main issue back then was that we started introducing smart pointers (boost) which would have required redesigning a few things - but otherwise, the code as such works - and people are obviously interested in such efforts, as can be seen in a number of threads where "fgais" is getting mentioned, most recently:

Subject: Real life traffic in FlightGear
jalocha wrote:Did anybody think about feeding real-life and real-time traffic into FlightGear ?


In summary, there is at least a handful of people obviously interested in doing this - so if someone were to coordinate these efforts a little better, fgais/fgms could still provide a compelling solution for this particular problem.
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: AI support

Postby portreekid » Mon Feb 23, 2015 3:25 pm

Thank you for your insight. I'm currently chewing through the posts and the wiki. Since I originally wanted to run trains, the problem of passivity wouldn't have been so bad, but applying it to aircraft I see the problem. On the other hand I don't want trains or ships appearing as traffic in ATC anyway.

For fgai to work in a non developer setting HLA has to be "productive". When is it planned, that HLA will be on by default?

I see the following use-cases for "AI" aka moving stuff in FG. All with different requirements.

1. Ground vehicles (possibly live, can be passive)
2. Other Aircraft without interaction (possibly live-data) should be ATC aware
3. Interactive Objects (Tankers/Wingmen/Missiles)

all three can be solved using different approaches. My current focus would be 1. and I don't see the reason for stalling fgai being a problem in this scenario.
portreekid
 
Posts: 336
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7

Re: AI support

Postby Hooray » Mon Feb 23, 2015 4:43 pm

HLA is not currently used by the fgais code, fgais is a modified fgms (multiplayer) server.
For simulating ground traffic, we also once had a discussion about using "sumo" to feed traffic back into FG.
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: AI support

Postby portreekid » Tue Feb 24, 2015 6:38 am

Oh I'll have another look then. Thx
portreekid
 
Posts: 336
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7


Return to Tutorials and missions

Who is online

Users browsing this forum: No registered users and 3 guests