Board index FlightGear Development New features

AI & MP Dogfighting now working! Bombable ships, aircraft...

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby flug » Fri Oct 21, 2011 4:04 pm

Latest version of Bombable is 4.4t (devel).

http://brenthugh.com/flightgear/bombable4-4tdevel.zip

It has some very significant improvements, including:

* AI AIRCRAFT MOVE VERTICALLY--AND DO LOOPS: AI aircraft now move much more
realistically in the vertical direction. They do loops, dive, and all the
rest. Their behavior (climb rates, dive rates, and so on) matches those of
the corresponding FG aircraft. This makes for a much more realistic 3-D
dogfighting experience in FlightGear.

* SIGNIFICANT PERFORMANCE IMPROVEMENTS: Bombable now makes much less of
an impact on your framerate, and much less stuttering & slowdown at
key points, like when numerous machine gun rounds are impacting. [Further
improved since ver. 4.4q]


Also I updated the F-15E StrikeEagle that works with Bombable: http://brenthugh.com/flightgear/F-15E.zip Unzip the F-15E zip file to Fg/data. Note that the F-15E is alpha quality code. All the bombable elements work fine but the F-15E itself is a work in progress and will throw tons of errors in your console window.
Last edited by flug on Fri Oct 21, 2011 8:10 pm, edited 2 times in total.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby flug » Fri Oct 21, 2011 7:05 pm

Hooray wrote in Sat Oct 15, 2011 9:49 am:
flug wrote in Fri Oct 14, 2011 7: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".


. . . 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've done quite a bit more work on this in the past few weeks & figured out some things. Also I've figured out how to work around most of the problems.

It boils down to these three:

1. The AI system restricts vertical speed of AI aircraft to 50 fps (down) and 25 fps (up). If you input values larger/smaller than these it will gradually return them to these limits.

Solution: Create a prop tree value that would allow this behavior to be disabled, so we can set whatever vertical speed we want and the AI system won't change it.

2. When you set a roll angle for an AI aircraft, the AI system gradually returns it to roll angle = 0.

Solution: Similarly, create a property tree value to allow this behavior to be disabled.

3. Aircraft turns in the AI system work by setting aircraft roll angle. But there is a somewhat complicated relationship between roll angle, speed, and the resulting turn rate. And roll angles near 90 degrees result in near infinite turn rates. This makes it difficult/impossible to smoothly transition from upright to inverted flight. This isn't a big issue for airliner type flight but for fighter aircraft it certainly is.

Solution: Create a new (optional) mode where AI aircraft turn rate can be set directly. Then set the aircraft roll angle to match so that it looks right visually (but allow this visual roll effect to be turned off by a node in the property tree).

4. Aircraft climb and dive according to the target altitude ( ai/. . ./ controls/flight/target-alt) and this over-rides any values you put into ai/ ... / velocities/vertical-speed-fps. This is related to problem #1.

Solution: Create a new mode for AI aircraft where target altitude is ignored and you can just input values to vertical-speed-fps instead.

Also we probably ought to create a page in the wiki explaining which values of Ai aircraft (and other AI objects) can be manipulated via the property tree and how they each work. It took quite a bit of experimenting to figure out some of the behavior, which really turned out to be quite simple in the end.

Some things I never have figured out, like in /ai/models/aircraft[X]/controls/flight there is lateral-mode and longitude-mode. I'm not sure what, if anything, they do. and FYI in Bombable I've rarely used the /controls/flight values to control the AI aircraft, instead I set values in /velocities and /orientation directly, which gives a much greater degree of control.

EDIT: Added issue #4
Last edited by flug on Sun Oct 23, 2011 9:03 am, edited 4 times in total.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby Hooray » Fri Oct 21, 2011 7:48 pm

flug wrote in Fri Oct 21, 2011 7:05 pm:1. The AI system restricts vertical speed of AI aircraft to 50 fps (down) and 25 fps (up). If you input values larger/smaller than these it will gradually return them to these limits.

2. When you set a roll angle for an AI aircraft, the AI system gradually returns it to roll angle = 0.


This is a wild guess, but some of these sound like they are possibly competing with the built-in performance database, have you already tried adding some custom "combat"-specific performance classes to $FG_ROOT/AI/Aircraft/performancedb.xml?
http://gitorious.org/fg/fgdata/blobs/ma ... ancedb.xml
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby flug » Fri Oct 21, 2011 7:55 pm

Hooray wrote in Fri Oct 21, 2011 7:48 pm:
flug wrote in Fri Oct 21, 2011 7:05 pm:1. The AI system restricts vertical speed of AI aircraft to 50 fps (down) and 25 fps (up). If you input values larger/smaller than these it will gradually return them to these limits.

2. When you set a roll angle for an AI aircraft, the AI system gradually returns it to roll angle = 0.


This is a wild guess, but some of these sound like they are possibly competing with the built-in performance database, have you already tried adding some custom "combat"-specific performance classes to $FG_ROOT/AI/Aircraft/performancedb.xml?
http://gitorious.org/fg/fgdata/blobs/ma ... ancedb.xml


I tried adding a new performance class there but I couldn't figure out how to turn in on with a specific AI aircraft. My impression is that database only comes into play for aircraft that are being run by the Traffic Manager http://wiki.flightgear.org/Interactive_Traffic and not for those loaded by a scenario, but I could be wrong.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby Hooray » Fri Oct 21, 2011 8:06 pm

According to the C++ source code (see line 112), it seems you must set a child node named "class" to the corresponding string value, i.e. "jet_transport".
EDIT: it seems, you are right - the code honoring this property is apparently only called in the "scenario loading" code, also it seems there is some mismatch between the code and the wiki docs: the code explicitly looks for a "class" child node, while the docs refer to "performance-class" apparently. But using the performance entry for "ufo" here would seem like a good workaround?

flug wrote:Some things I never have figured out, like in /ai/models/aircraft[X]/controls/flight there is lateral-mode and longitude-mode. I'm not sure what, if anything, they do.


After having had another look at the source code, it seems "lateral" and "longitude" mode are used for AI traffic without flight plans, i.e. look at this comment in line 1002:
Code: Select all
        // no flight plan, update target heading, speed, and altitude
        // from control properties.  These default to the initial
        // settings in the config file, but can be changed "on the
        // fly".


The conditional blocks after #1002, suggest that in lateral mode AI traffic without flight plans can either be commanded to use a target-roll or a target-hdg, while in "longitude" mode the whole thing is about differentiating between either a target altitude or a target pitch.
Last edited by Hooray on Fri Oct 21, 2011 8:11 pm, edited 1 time in total.
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby ofna01 » Sat Oct 22, 2011 9:39 pm

HELP!
i downloaded bombable,installed,it works,but i cant see the planes.
i have the particles on and all that,i did the SanFranCessnaInvasion,and i couldnt see the planes or the smoke trails.
i have bombable 4.4 and im on a macbook
User avatar
ofna01
 
Posts: 8
Joined: Mon Mar 14, 2011 9:39 pm
Callsign: Maverick
Version: 2
OS: Macbook

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby flug » Sun Oct 23, 2011 12:15 am

ofna01 wrote in Sat Oct 22, 2011 9:39 pm:HELP!
i downloaded bombable,installed,it works,but i cant see the planes.
i have the particles on and all that,i did the SanFranCessnaInvasion,and i couldnt see the planes or the smoke trails.
i have bombable 4.4 and im on a macbook

What version of FG are you using?

There are a few different command line parameters that disable different parts of the AI system and you might have the wrong one turned off. Make sure "AI models" is checked in FGRun and also look in click on the "advanced" button and look in all the tabs for anything related to AI and models, and try turning them on.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby flug » Sun Oct 23, 2011 12:25 am

Hooray wrote in Fri Oct 21, 2011 8:06 pm:According to the
The conditional blocks after #1002, suggest that in lateral mode AI traffic without flight plans can either be commanded to use a target-roll or a target-hdg, while in "longitude" mode the whole thing is about differentiating between either a target altitude or a target pitch.


Aha, this is helpful. I've never managed to get the target-hdg or target pitch methods to work.

However, the solution to most of the problems I've outlined above would be to create 1. a new heading/directional mode that disables target roll and target hdg and 2. a new altitude control mode that disables target altitude and target pitch.

Then, using Nasal, we can just input our roll and vertical speed directly and not have the AI system try to change them.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby ofna01 » Sun Oct 23, 2011 3:01 am

i have AI models on,all that stuff related to it is on,but when i fly,i cant see any planes.
Flightgear 2.4.0
Macbook 10.5.8
GMA 950 graphics card
User avatar
ofna01
 
Posts: 8
Joined: Mon Mar 14, 2011 9:39 pm
Callsign: Maverick
Version: 2
OS: Macbook

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby flug » Sun Oct 23, 2011 9:05 am

New version:

http://brenthugh.com/flightgear/bombable4-4wdevel.zip

I've mostly concentrated on fixing bugs and anomalies, but I couldn't resist adding one interesting new feature:

* REPORTS AND STATISTICS: How many hits, how much damage--look in the Bombable menu for Bombable Statistics.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby Vodoun da Vinci » Sun Oct 23, 2011 4:03 pm

Thanks again, Flug, for all your hard work! :D

I installed and flew Bombable4-4T last night in one of my favorite scenarios. While I did not catch any 'Bots looping in a capture, I did notice that they react my more realistically when fired upon, attacking or being chased. One more huge step towards total realism! Well done. I'll load up Bombable 4-4w and give that a try as well. :D

I still do not see return tracers from attacking 'Bots - is this feature part of the Bombable code in the AI 'Bot or is it in the main scripting? Maybe I have not transplanted code from the proper aircraft. I am using the code from the A6M2-Bombable.

Also, is the enhancement of the 'Bots (the ability to loop/roll and use enhanced evasion and attack parameters) a function of the Nasal in the aircraft or part of the main script and unable to be tweaked?

Thanks in advance!!

VooDoo
FGFS version 2.4.0 on Windows 7
Primarily Flying Warbirds, Jet and Prop - Visit: http://www.fguk.eu
VooDoo's FGFS/FGUK Movies!: http://www.youtube.com/user/VooDoodaVinci?feature=mhee
"Imagination is more important than knowledge"
A. Einstein
User avatar
Vodoun da Vinci
Retired
 
Posts: 405
Joined: Thu Mar 25, 2010 4:29 pm

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby flug » Wed Oct 26, 2011 11:19 pm

Vodoun da Vinci wrote in Sun Oct 23, 2011 4:03 pm:I still do not see return tracers from attacking 'Bots - is this feature part of the Bombable code in the AI 'Bot or is it in the main scripting? Maybe I have not transplanted code from the proper aircraft. I am using the code from the A6M2-Bombable.

Are you getting hits and damage from the AI aircraft? If you have a 'weapons' section in your AI aircraft then they should shoot at you and you should see the 'little white bullets' when they are shooting. If you don't have a 'weapons' section you won't see either one.

They don't shoot all the time, basically only when they are aimed directly at you or close to it.

Also make sure "AI weapon fire visual effect" is checked in the bombable menu. Try turning IE weapon effectiveness to "much more effective"--they will shoot more often and hit you more often. Also, the "white bullets" are a particlesystem effect, so make sure particles are turned on in FlightGear. If you can see the smoke trails, engine smoke, etc., those are from the particlesystem, too.

Also, is the enhancement of the 'Bots (the ability to loop/roll and use enhanced evasion and attack parameters) a function of the Nasal in the aircraft or part of the main script and unable to be tweaked?


It is built in, and works if the "AI aircraft flying/dogfighting skill" is turned on, but there are some things you can tweak in the AI aircraft's settings as well.

Look at the sample code included here, it's been updated:

http://wiki.flightgear.org/Howto:_Addin ... e.xml_file

Particularly note these new settings:

* under evasions, rollRateMax_degpersec : 300,
* under attacks, rollRateMax_degpersec : 300,
* under velocities, new sections for dive & climb velocities that look like this:
Code: Select all
                       
             diveTerminalVelocities: {
                 point1: { airspeed_kt : 1060, vertical_speed_fps : - 337},
                 point2: { airspeed_kt : 1230, vertical_speed_fps : - 755},
                 
             },
 
             climbTerminalVelocities: {
               point1: { airspeed_kt : 468, vertical_speed_fps : 236},
               point2: { airspeed_kt : 843, vertical_speed_fps : 251},
               #point3: { airspeed_kt : 1100, vertical_speed_fps : 161},
           
             },
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Now to Bombable 4.4 zb (beta) - and FEATURE FREEZE

Postby flug » Fri Oct 28, 2011 8:02 am

OK, I have now officially lapped the entire alphabet with new Bombable versions.

It is now up to version 4.4zb, which I am declaring a beta version:

http://brenthugh.com/flightgear/bombable4-4zb-beta.zip

I am also doing a feature freeze, meaning I won't add any new features but will spend any (limited) time I have trying to stamp out any bugs.

If you're interested in helping, it would really help to download & try out ver 4.4zb--all the scenarios, all the aircraft, over multiplayer, and every other variation possible.

Any bugs you report here we'll fix and then release the result as Bombable 4.5.

(And then we can start developing on ver 4.6devel again . . . ).

I'm particularly interested in:

* Any Nasal errors from Bombable you see in the console window

* Any extremely bizarre or unusual behavior (like today the AI aircraft were just stopping in mid-air when they stalled out--I've fixed that one, I hope)

* However, I will say that I am **not** really interested in reports of bugs or errors in the main or AI aircraft. Pretty much all those errors are due to the underlying FG code for those aircraft, not the small bits that I've added to make them compatible with Bombable. You're welcome to report those problems (and better yet solutions) but I can't promise to spend any time trying to fix them. It would be wonderful to get those little things fixed for the next version of FG, but for me, there is plenty to fix in Bombable itself!

Ver 4.4 zb (beta) has a few very interesting new features:

* AI AIRCRAFT HAVE LIMITED AMMO AND FUEL: In FlightGear, YOU have limited ammo
and fuel. Now the AI aircraft do, too. If they run low on ammo or fuel they
will retire from the combat area and won't attack you unless you attack them.
Once they leave the combat area they will refuel and re-load their ammo and
you can re-engage them if you like. Or they may re-engage you. This makes
combat much more realistic--when you run low on ammo you can disengage, land,
and re-load your ammo as the AI aircraft are doing the same. Then take off and
re-engage. You may come across enemy aircraft that are low on fuel or out of
ammunition. You can devise strategies to take advantage of the enemy fighters
when they are low on fuel or ammo.

* BOMBABLE SOPWITH CAMEL IMPROVED/MORE REALISTIC: The flyable Sopwith Camel
YASim settings have been updated to more closely reflect the performance
capabilities of a real Sopwith Camel aircraft, particularly the maximum speed,
which had been almost 20 knots slower in FG than in real life. The attributes
of the AI version of the Camel, SPAD VII, and Fokker DR.1 were also updated
so that all very closely match historical performance data for the aircraft and
all can be flown against each other on comparable terms (ie, fly the Camel vs
the Fokker or SPAD over Multiplayer; fly the Camel, Fokker, or SPAD against the
AI scenarios involving the Camel, Fokker, and SPAD, while maintaining good
realism)

* BOMBABLE A-10 WARTHOG IMPROVED: The YASim file for the A-10 Warthog has been
tweaked to make the aircraft more precisely match the perform of the real
A-10 and to make it handle better a lower speeds (one of the main
characteristics of the real A-10). Still, if you're dogfighting with the A-10
you'll likely want to jettison all the bombs and a lighten the fuel load as
well . . .
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby Vodoun da Vinci » Mon Oct 31, 2011 3:15 am

Loading it up and checking it out, Flug! :D

Thanks for the continued development...I do love my Bombable Scenarios!! Movies to follow I'm sure. :wink:

VooDoo
FGFS version 2.4.0 on Windows 7
Primarily Flying Warbirds, Jet and Prop - Visit: http://www.fguk.eu
VooDoo's FGFS/FGUK Movies!: http://www.youtube.com/user/VooDoodaVinci?feature=mhee
"Imagination is more important than knowledge"
A. Einstein
User avatar
Vodoun da Vinci
Retired
 
Posts: 405
Joined: Thu Mar 25, 2010 4:29 pm

Re: AI & MP Dogfighting now working! Bombable ships, aircraf

Postby redneck » Tue Nov 01, 2011 7:30 pm

Very very nice. Just one problem. My AI MiG-21s are now extremely agile. Like The Phantom II is no match for them. Even the F-15E failed. Finally, I managed to take all 5 of them down by flying the F-16 with the FBW disabled so I could pull extreme moves like the Pugachev's Cobra and such. I never imagined my flight hand would get steady enough to handle that thing continuously without the FBW. Before, it just seemed uncontrollable, but now, I guess my skills improved. But enough bragging 8) I need to figure out what I'm doing wrong. Sure it was more exciting and all, but the way they performed is probably more fitting for the Typhoon, or at least an extremely skilled F-16 pilot flying with the FBW turned off, than the MiG-21, and I'm sure you would know that's a HUGE difference. Perhaps you can give me a hint as to what I'm doing wrong. I think my numbers in the Bombable-include file may be bad, but I don't know which ones.

As for any bugs, I've found one. But for those just getting the new version of Bombable, it is IMPERATIVE that you add the new code to the velocities definitions. That terminal velocity thing. B/c, without it, the console will throw errors, and may cause FG to crash, and if FG does not crash, all your enemies will be plummeting into the ground regardless of how high the operations floor is.

By the way. Did I mention that was EXTREMELY intense? Got my neck a good workout in less than an hour. I bet someone could sell this with the FaceTrackNoIR as a combo neck workout. Just imagine, all of a sudden, people will be balancing cars on their heads, even though they can't lift them with their arms, like this guy.
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck
 
Posts: 3617
Joined: Mon Feb 02, 2009 3:17 am
Location: Pennsylvania, USA
Version: 240

PreviousNext

Return to New features

Who is online

Users browsing this forum: benih and 3 guests