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, aircraft...

Postby Thorsten » Fri Jun 18, 2010 8:13 am

After a bit more tryouts:

For me, preferences are definitely not saved and restored - I have to reset them every time. I'm not sure what the options 'realistic' 'easy' and 'super-easy' do when I tick all of them. Does the combination of 'easy' and 'super-easy' make 6 times the normal damage, just ticking 'super-easy' 3 times? Or does the easiest setting win out?

In WW-I dogfights, I could down an opponent in usually 5 minutes on 'easy'. Setting it to 'realistic', I had 30 minutes of intense fighting getting him to 43% damage, at which point we crashed in mid-air (most of my dogfights with the new package so far ended with a min-air crash - the opponents seem to have no instinct for self-presenvation...). I think that is quite challenging as it stands.

I have realized quickly that the AI scenarios are way too crowded for me - I cooked them down to 1 vs. 1, so I can focus on one opponent and build a mental picture of where he is and what he is doing. I think that's better suited for a realistic difficulty level than the arcade-like 1 vs 10.

I have been toying with a scheme to let the opponents shoot back. If you give them actual bullets with real ballistics, you may have a very hard time training the AI pilots to anticipate movement of bullet and target and to maneuver into a good position to shoot. So I would suggest a simplified scheme:

* for each AI plane, check if the target is within shooting distance, if direct_course_to target is closer than, say, 3 degrees (make this a tunable number) to actual course and also if the vertical angle to target is within 3 degrees of the pitch angle) - if yes, the AI plane can potentially fire, if no, go to next frame. For bombers like the B-17, one can define different firing cones behind the aircraft.

* if it can fire, start a timer to see how long the opportunity lasts - let the timer run till either 3 seconds (or a small time) or till the target is out of the firing cone.

* use (length_of_opportunity)/(3 sec) as a probability that the AI craft fires - basically, if you dodge wildly, you'll not be in the firing cone for long, so it's very unlikely that he can shoot, if you do nothing and he is allowed to remain in your six for 3 seconds, he has a good opportunity and will shoot

* if the aircraft fires, calculate the probability of a hit dependent on the marksmanship of the pilot , modified by penalties for distance and muzzle velocity, weapon accuracy and the time taken earlier

* sample that probability do do damage

* and keep track of trivial things like ammo usage and so on

This should be reasonably easy to implement and add tons of danger to the experience while keeping it reasonably realistic (i.e. you will benefit if you dodge or get out of range, opponents won't always hit,...).
Thorsten
 
Posts: 11747
Joined: Mon Nov 02, 2009 8:33 am

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

Postby Vodoun da Vinci » Fri Jun 18, 2010 11:07 am

I flew one of my custom AI scenarios last night involving a Spitfire Circus @ 20,000 feet With the newest bombable installed and while the graphics effects seemed enhanced I did not notice any change in the evasion behavior of the attacked aircraft. That is, they do not turn into me or seem to have changed their tactics in any way when attacked. Then it occurred to me that some additional code has likely been added to the individual aircraft .xml. A quick look and comparison with the bombable Spad and Sopwith Camel confirms the addition of ATTACK DEFINITIONS section in the bombable code that is not present in the models I have included in my scenarios.

So, I need to jiggle the code in my custom scenarios to include the new basic changes.

I wonder if Flug would be so kind as to post a "generic" or base section of the newest bombable code for the individual aircraft that I could "copy and paste" into my bombable 'Spit, P-38, Beaufighters, etc to gain the added effects and performance? When I created them I basically borrowed (copied and pasted) the code from the bombable Warthog and bombable Cessna and then tweaked it a bit. Can I do this with the new Warthog code now or do only the sopwith Camel and Spad have the enhanced code and features? I didn't see any changes to the Cessna or Warthog code in the "N" package but I'm not adept with these things.

Thanks for the help!!

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 3:29 pm

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

Postby flug » Sat Jun 19, 2010 4:41 am

Vodoun da Vinci wrote:I wonder if Flug would be so kind as to post a "generic" or base section of the newest bombable code for the individual aircraft that I could "copy and paste" into my bombable 'Spit, P-38, Beaufighters, etc to gain the added effects and performance? When I created them I basically borrowed (copied and pasted) the code from the bombable Warthog and bombable Cessna and then tweaked it a bit. Can I do this with the new Warthog code now or do only the sopwith Camel and Spad have the enhanced code and features? I didn't see any changes to the Cessna or Warthog code in the "N" package but I'm not adept with these things.

Best plane to use as a model is A6M2. Sopwith Camel, SPAD VII, and FKDR1 are also good models (all in the AI subdirectory).

Within the AI aircraft's XML file, you do have to add TWO new things.

1. is the attack definitions, looks something like this:
Code: Select all
 # 
          #########################################
          # ATTACK DEFINITIONS
          #
          # The attack system makes the AI aircraft turn and fly towards
          # other aircraft
          attacks : {               
            maxDistance_m : 12000, #max distance to turn & attack main aircraft
            minDistance_m : 500, #min distance to turn & attack main aircraft,
               #ie, fly away this far before turning to attack again.  If you
               #make this short it will be more like a turning fighter (Zero),
               #longer will become more like an energy fighter that zooms
               #way out, turns around, etc.
           
            continueAttackAngle_deg : 60, #when within minDistance_m, the aircraft will continue to turn towards the main aircraft and attack *if* if the angle is less than this amount from dead ahead.  A wider angle will make it work more like a twisty/turning fighter, narrower angle more like an energy fighter.
            altitudeHigherCutoff_m : 3000, # will attack the main aircraft unless this amount higher than it or more
            altitudeLowerCutoff_m : 500, # will attack the main aircraft unless this amount lower than it or more
            rollMin_deg : 50, #when turning on attack, roll to this angle min
            rollMax_deg : 80, #when turning on attack, roll to this angle max
            attackCheckTime_sec : 10, # check for need to attack/correct course this often 
            attackCheckTimeEngaged_sec : 1, # once engaged with enemy, check/update course this frequently   
          },

2. is the call initialize the attack routine, which would look something like this:
Code: Select all
#
        # ATTACK: Make the object attack the main aircraft       
        bombable.attack_init ( thisNodeName );


You're right that not all aircraft do attack--only if they have this code. It didn't make much sense to make the Cessnas attack. The A-10s however Do have the attack code.

However keep in mind that I have special ver of the A-10 in the package (A-10-bombable subdirectory) so if you have any other A-10 scenario that doesn't use that special version you'll just have a plain old straight-flying A-10 instead of an attacking one.

Also keep in mind that you can de-select 'attack' in the bombable menu so if you have that de-selected then nothing will happen.

In addition easy & super-easy modes make them fly straighter & less wiggly.
flug
 
Posts: 218
Joined: Wed Jun 17, 2009 1:06 am

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

Postby flug » Sat Jun 19, 2010 4:50 am

Ver 3.0o of Bombable released!

In the 'great minds think alike' department, it has AI aircraft shooting weapons at you in a scheme very similar to the one Thorsten outlines above.

It's not 'real' ballistic weapons as FG should be capable of at some future time, but a simplified 'simulated weapons' system similar to what Thorsten outlines above (though a bit simpler for now--some refinements might come in the future). At any rate it makes dogfights much more interesting because you have to watch your tail at all times.

http://brenthugh.com/flightgear/bombable3o.zip

WHAT'S NEW IN BOMBABLE 3.0o
----------------------------------------
AI AIRCRAFT SHOOT AT AND DAMAGE YOU: When in an AI dogfight, if you let the AI aircraft get into position they have a chance to shoot at and possibly damage you. This is working best with WWI AI Aircraft (Camel, SPAD, Fokker) as in the Marin County Camel Invasion scenarios, but it will also work with the Zero and Warthog scenarios.

MOSTLY FIXED MENU/OPTIONS SAVE/RESTORE BUG: Some of the options still don't save/restore correctly, but most do now.

NUMEROUS OTHER BUGFIXES/SMALL IMPROVEMENTS
flug
 
Posts: 218
Joined: Wed Jun 17, 2009 1:06 am

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

Postby jack » Sat Jun 19, 2010 4:55 am

Flug, you are the best. :D
For Military Aircraft, Scenery, and more, visit http://alphashangar.co.nr/

'Retired' from FlightGear as of July 2011. You can contact me via my website if you'd like to pick up any old projects.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

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

Postby flug » Sat Jun 19, 2010 5:38 am

Thorsten wrote:For me, preferences are definitely not saved and restored - I have to reset them every time.


This is partly fixed in the latest version.

I'm not sure what the options 'realistic' 'easy' and 'super-easy' do when I tick all of them. Does the combination of 'easy' and 'super-easy' make 6 times the normal damage, just ticking 'super-easy' 3 times? Or does the easiest setting win out?


In order from hardest to easiest it is:

1. Realistic mode
2. Normal (none of realist/easy/super-easy checked)
3. Easy
4. Super-easy
5. Easy & Super-easy

Easy is 2X the damage plus a somewhat bigger damage radius (ie, the target area becomes bigger & thus easier to hit).

Super-easy is 3X the damage plus an even bigger damage radius.

Selecting both easy & super-easy multiplies them, so yes--6X the damage.

Realistic mode basically shrinks the target area down to only a core area where hits do damage. With normal mode, there is a large 'halo' around this core area where hits have at least a probability or chance of doing damage. With realistic mode, only if the shot is actually within that restricted damage radius will it do damage.

In theory this is in fact the most realistic but the way FG works in detecting ballistic impacts, I'm not sure. Either way, it's definitely more challenging to get hits within that smaller area.

(And BTW you're right it is sort of confusing how this works & the menu really needs to be re-worked to be more clear--maybe radio buttons or a slider to choose the difficulty level rather than the series of checkboxes.)
flug
 
Posts: 218
Joined: Wed Jun 17, 2009 1:06 am

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

Postby Vodoun da Vinci » Sat Jun 19, 2010 1:38 pm

OK, I loaded the 3O version of the Bombable Code and then implanted the nasal from the A6M2-Bombable into my Spitfires. Then I took my circus of 'Spits scenario for a test fly... :shock: :shock: :shock:

Upon the first attack the whole pack of the little devils turned on me and it was all I could do to stay out of their gunsights and to keep them off of my 6 oclock. Excuse my French but *HoLy CraP!* are they aggressive! :lol: :shock: I got a few shots in but seriously never hit even one aircraft let alone brought one down. Tried to shoot some video of it (and got some good stuff, mostly of them forming in a pack on my 6 and trying to shoot *me* down..) but was mostly busy being very impressed at the level of realism this has achieved. No more stalking them, lining up, and blazing away on a Boom and Zoom attack. These greedy little devils see what you are up to and very quickly decide to make you take a deflection shot or Split-S to escape. Dive for the deck, get up some speed and then zoom back up and look behind 'cause here comes that 'Spit and 3 of his buds after my FW. :shock: :evil:

Scary good, Flug. Awesome, in fact. I offer a huge *Thank You* and I'll try and get some new movies shot of this latest invention.

...Did I say *WOW*? :D

VooDoo
Last edited by Vodoun da Vinci on Sat Jun 19, 2010 4:53 pm, edited 1 time in total.
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 3:29 pm

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

Postby Vodoun da Vinci » Sun Jun 20, 2010 11:07 pm

A short movie of my weekend experience with Bombable3o. Watch at about 15 seconds into the movie and you'll see a vicious wolfpack of Spitfires turning hard behind the FW 190 to get on my six oclock...these are the most awesome and persistant AI adversaries I have ever encountered. No more sneaking up and laying down the smack...



The other unnerving and challenging aspect of the new script is the propensity of the attacking adversaries to come at you head on....I have actually managed to down a few of these aircraft in head on attacks but *WoW* is it difficult to get a burst on target when the target is maneuvering to shoot you and is closing at probably something like 450+ knots. :shock:

Awesome addition. Flug! I can't wait to see what you come up with next but this will keep me busy for weeks upgrading my various scenarios with aircraft that fight back.

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

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 3:29 pm

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

Postby clrCoda » Sun Jun 20, 2010 11:34 pm

Very cool! VooDoo! Sweet. Was not aware FG was that sophisticated already. Thanks for sharing this.
Ray
Ray St. Marie
clrCoda
 
Posts: 1228
Joined: Wed Apr 07, 2010 11:04 am

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

Postby Vodoun da Vinci » Mon Jun 21, 2010 12:06 am

Oh yeah...FGFS = sophistication in the AI virtual combat and virtual ACM realm thanks to Flug and a little judicious "cut and paste" of pertinent code. :wink: This stuff now blows the doors off of any available air combat software I have used. And it's just beginning really. I can make my own air combat scenarios and include any aircrafts I feel are situation critical. Gaad knows where it will be 2 years from now. :shock: :o :D I make my own liveries and hack the FDMs to give me the performance data that the books I have tell me is appropriate for the aircraft used and it is getting scary real....I end up with jitters and sweaty palms after going head to head with 'Spits at 19000 feet at 210+ knots. Awesome.

It gets better every day. :D I'm in Heaven. Whoo Hoo!!

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 3:29 pm

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

Postby obk01 » Wed Jun 30, 2010 7:38 pm

sorry but im not the best with this stuff so i have to ask a few things. i downloaded the zip now where do i extract it to? does it all go to one folder or does each of the 4 folders inside the zip go somewhere else please tell me exactly where to put each one. does this mean i can go shoot planes on fg multiplayer? do they also have to have this for it to work? thanks
obk01
 
Posts: 103
Joined: Fri Apr 03, 2009 12:45 am

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

Postby jack » Wed Jun 30, 2010 8:44 pm

obk01 wrote:sorry but im not the best with this stuff so i have to ask a few things. i downloaded the zip now where do i extract it to? does it all go to one folder or does each of the 4 folders inside the zip go somewhere else please tell me exactly where to put each one. does this mean i can go shoot planes on fg multiplayer? do they also have to have this for it to work? thanks


I happen to have a .pdf on bombable installation, I hope it helps: http://alpha-jsfilestorage.yolasite.com ... RST!!!.pdf
For Military Aircraft, Scenery, and more, visit http://alphashangar.co.nr/

'Retired' from FlightGear as of July 2011. You can contact me via my website if you'd like to pick up any old projects.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

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

Postby Vodoun da Vinci » Wed Jun 30, 2010 8:53 pm

There is a "read me" inside the Bombable zip file...I'm pretty sure you just need to extract/unzip the file you downloaded to the data folder inside your FlightGear folder.

It seems to do the rest itself if I'm not mistaken. But try reading the Read Me file in the file you downloaded. It has instructions.

GoodLuck! `

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 3:29 pm

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

Postby obk01 » Wed Jun 30, 2010 9:20 pm

thanks guys let me go try it out now (with my horrible flying skills)
obk01
 
Posts: 103
Joined: Fri Apr 03, 2009 12:45 am

New version 3.0p (alpha release)

Postby flug » Thu Jul 01, 2010 4:49 pm

New version of Bombable now available at

http://brenthugh.com/flightgear/bombable3p.zip

3.0p
------------------------
This is a bit of an alpha release and has not been as thoroughly test with all scenarios as previous releases. I don't know of any problems but touched enough code it could be creating unexpected problems with some AI vehicles or aircraft. Please let me know if you notice anything!

AI AIRCRAFT ARE MORE MOBILE VERTICALLY: AI Aircraft dodge and chase you more vertically, diving and climbing. Result is they catch up with you quicker and are quite a bit more challenging to shoot down.

VARIOUS BUGFIXES
flug
 
Posts: 218
Joined: Wed Jun 17, 2009 1:06 am

PreviousNext

Return to New features

Who is online

Users browsing this forum: No registered users and 1 guest