SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Modern-Era Subsims > Dangerous Waters > DW Mod Workshop
Forget password? Reset here

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-01-06, 07:27 PM   #1
LoBlo
Subsim Diehard
 
Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
Default Better Aircraft Behavior Experiment

I'm trying to improve the AAW behavior of fighters like the CVN escorts (Migs and F14/F18). I've modifed the FighterEvade Doctrine as an experiment to see if they're behavior is any better... trying to get them to vector in and attack planes that maybe threatening friendly ships.

What I've done is to create a new doctrine called "Interceptor" for the fighters and tried some changes. So far here's what I've tried with the doctrine to see if its an improvement:

Code:
 
; $Header: FighterEvade.txt   Wed Apr 23 16:04:39 EDT 2003    $
; $Revision: 1 $
; $Copyrt1: Copyright (c) 2003, Sonalysts, Inc.  All rights reserved. $
;
; FighterEvade
; LoBlo attempted Edits,June 2006
; attempting to script better anti-air behavior from interceptors to make them better protectors
; currently untested
; Set Tactic
IF NEWTRACK THEN {
 ; AAM or SAM Missile?
 IF TgtClass $= "MISSILE" AND ( TgtMissileClass "AAM" OR TgtMissileClass "SAM" ) THEN {
  SETTACTIC "AirEvadeMissile"
 } ENDIF
 ; SSM or ASM Missile?
 IF TgtClass $= "MISSILE" AND ( TgtMissileClass "ASM" OR TgtMissileClass "SSM" ) THEN {
  ATTACKBEST
 } ENDIF
 
 ;What about enemy fighter response?
 IF TgtClass $= "AIR" AND ( TgtID $= "HOSTILE" OR ( TgtID $= "UAE" ) OR ( TgtID $= "UPD" ) ) THEN {
  ATTACKBEST
 } ENDIF
} ENDIF
I'm not sure if this improves Interceptor/Fighter escort behavior though. The next step that I'll probably try is to script some behavior to set better intercept course and speeds instead of planes just waiting for an enemy to get into firing range they would actively set up some intercept courses and then fire... that's the next step anyway.

If anyone tries out the above doctrine give some feedback. Better? Worse? No Change really?

thx,
lb
__________________
"Seek not to offend or annoy... only to speak the truth"-a wise man
LoBlo is offline   Reply With Quote
Old 06-01-06, 07:41 PM   #2
LuftWolf
Ocean Warrior
 
Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
Default

"AttackBest" is the command to fire a weapon if those conditions are met. To the best of my knowledge, it doesn't include any persuit logic, so you'll have to include commands that reference the ranges of the weapons to have them fire intelligently.

So I'd add something like IF TgtClass $= "Air" AND tgtID $= "Hostile" THEN intercept/ IF ( tgtrng <= AttackRng ) THEN ATTACKBEST ENDIF ENDIF.

I haven't done much with the non-asw functions of the aircraft AI, but I do know that the Sim seems to excert a lot of control over them, because they do things that are not scripted AT ALL in the doctrines, like attack ships and other aircraft, and drop sonobuoys.

PS Intercept is a function that automatically sets an intercept course for the target.

PPS I'd also use the default platform doctrine to reference a target doctrine for these features, and create a priority structure for all the commands.

PPPS If you want your interceptors to shoot down incoming vampires, make sure you enable missiles as legit targets in your database for those air launched missiles.
__________________
LW

Last edited by LuftWolf; 06-01-06 at 07:44 PM.
LuftWolf is offline   Reply With Quote
Old 06-01-06, 07:56 PM   #3
LoBlo
Subsim Diehard
 
Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
Default

EDIT: The doctrine below isn't working right yet. Don't use it yet.

Thanks for the tips. Yeah, I've noticed that sometimes fighters engage surface ships with HARMS and sometimes they don't. Sometimes they actively engage a target and sometimes they loiter. Its all really aimless without any discernable logic to why and when.

Thanks for the doctrine tips. I'm not really a programmer. How about this then, per your suggestions

Code:
 
; $Header: FighterEvade.txt   Wed Apr 23 16:04:39 EDT 2003    $
; $Revision: 1 $
; $Copyrt1: Copyright (c) 2003, Sonalysts, Inc.  All rights reserved. $
;
; FighterEvade
; LoBlo attempted Edits,June 2006
; attempting to script better anti-air behavior from interceptors to make them better protectors
; currently untested
; Set Tactic
IF NEWTRACK THEN {
 ; AAM or SAM Missile?
 IF TgtClass $= "MISSILE" AND ( TgtMissileClass "AAM" OR TgtMissileClass "SAM" ) THEN {
  SETTACTIC "AirEvadeMissile"
 } ENDIF
 ; SSM or ASM Missile?
 IF TgtClass $= "MISSILE" AND ( TgtMissileClass "ASM" OR TgtMissileClass "SSM" ) THEN {
  ATTACKBEST
 } ENDIF
 
 ;What about enemy fighter response?
 IF TgtClass $= "AIR" AND ( TgtID $= "HOSTILE" OR ( TgtID $= "UAE" ) OR ( TgtID $= "UPD" ) ) THEN {
  Intercept
  IF (tgtrng <= AttackRng) THEN {
  ATTACKBEST
 } ENDIF
} ENDIF
Also...
Quote:
PPS I'd also use the default platform doctrine to reference a target doctrine for these features, and create a priority structure for all the commands
Is that a better method then just creating all behavior in one .txt file without SETTATICS?

thx
__________________
"Seek not to offend or annoy... only to speak the truth"-a wise man

Last edited by LoBlo; 06-01-06 at 08:21 PM.
LoBlo is offline   Reply With Quote
Old 06-01-06, 08:01 PM   #4
LuftWolf
Ocean Warrior
 
Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
Default

The problem is, if you don't use that method, than the all of the target referencing commands become non-functional or problematic, because the platform doctrine often can be refering to many different targets. In general, its best to only use the platform doctrine in DW to reference the NEWTRACK variable and then assign a target doctrine using some conditions to decide the appropriate assignment. Then, using the priority structure, you can allow the platform to intelligently manage multiple contacts.

So, in other words, you have to start over somewhat if you want it to work.

Also, make sure you watch your whitespace and spacing.

Cheers,
David
__________________
LW
LuftWolf is offline   Reply With Quote
Old 06-01-06, 08:16 PM   #5
LoBlo
Subsim Diehard
 
Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
Default

I'll see what I can come up with then. Definately WIP.

thx.
__________________
"Seek not to offend or annoy... only to speak the truth"-a wise man
LoBlo is offline   Reply With Quote
Old 06-02-06, 05:14 PM   #6
XabbaRus
Navy Seal
 
Join Date: Sep 2001
Posts: 5,330
Downloads: 5
Uploads: 0


Default

Good luck, hope you can figure this out. AI aircraft performance has always bugged me.
__________________
XabbaRus is offline   Reply With Quote
Old 06-02-06, 09:55 PM   #7
LoBlo
Subsim Diehard
 
Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
Default

EDIT: Corrections made
Ok, here's what I'm testing so far and its shown some marginal improvement over current behavior. First is a modification to the FighterEvade doctrine that will call upon a "AirIntercept" Doctrine when an enemy plane is detected.


Code:
 
; $Header: FighterEvade.txt   Wed Apr 23 16:04:39 EDT 2003    $
; $Revision: 1 $
; $Copyrt1: Copyright (c) 2003, Sonalysts, Inc.  All rights reserved. $
;
; FighterEvade
; LoBlo attempted Edits,June 2006
; attempting to script better anti-air behavior from interceptors to make them better protectors
; currently untested
; Set Tactic
IF NEWTRACK THEN {
 ; AAM or SAM Missile?
 IF TgtClass $= "MISSILE" AND ( TgtMissileClass "AAM" OR TgtMissileClass "SAM" ) THEN {
  SETTACTIC "AirEvadeMissile"
 } ENDIF
  ; Enemy fighter?
 IF TgtClass $= "AIR" AND ( TgtID $= "HOSTILE" OR ( TgtID $= "UAE" ) OR ( TgtID $= "UPD" ) ) THEN {
  SETTACTIC "AirIntercept"  
 } ENDIF
 ; SSM or ASM Missile?
 IF TgtClass $= "MISSILE" AND ( TgtMissileClass "ASM" OR TgtMissileClass "SSM" ) THEN {
  SETTACTIC "AirIntercept"
 } ENDIF
} ENDIF
The AirIntercept Doctrine is then called (if an enemy plane is detected) and hopefully the AirIntercept will act in the following ways
3. A intercept course to the enemy plane is plotted and engines are revs to 85% trottle.
4. When within attack range missiles are released
5. After missile release, a evasion route is plotted.

Code:
 
; By LoBlo, attempt to script better intercept and attack behavior from fighters
; Intercept incoming aircraft
IF NOT LostTrack THEN {
 IF TgtClass $= "AIR" AND ( TgtID $= "HOSTILE" OR ( TgtID $= "UAE" ) OR ( TgtID $= "UPD" ) ) THEN {
  SetSpd Maxspd / 1.15
  Intercept
  IF ( TgtRng <= AttackRng ) THEN {
   ATTACKBEST
  } ENDIF
 } ENDIF 
} ENDIF
; Evasion after firing
IF WeaponAway THEN {
 SteerAway
 SetSpd Maxspd / 1.1
  } ENDIF
That's the theory anyway, it accomplishes it with moderate consistency on the small scale battles that I've been testing, though there are some problems. The main one being that the evasion route after engaging the target, are not taken most of the time and the planes will still close on the target after their weapons have been released, where they should better evade to avoid return fire... WIP:hmm:

If anyone would like to give it a try themselves feedback would be appreciated.

lb
__________________
"Seek not to offend or annoy... only to speak the truth"-a wise man

Last edited by LoBlo; 06-03-06 at 07:30 AM.
LoBlo is offline   Reply With Quote
Old 06-02-06, 10:18 PM   #8
LoBlo
Subsim Diehard
 
Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
Default

On a side note:

Those F14 are looking pretty fierce now with the most aggressive attacks in the game. The 100+nm range of those Phoenix missiles + Mach 3+ speed equal GROWL.
__________________
"Seek not to offend or annoy... only to speak the truth"-a wise man
LoBlo is offline   Reply With Quote
Old 06-03-06, 12:43 AM   #9
LuftWolf
Ocean Warrior
 
Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
Default

Quote:
If anyone would like to give it a try themselves
I've put this on my list of things to fix for LWAMI4.

It is interesting how little actually has to be done sometimes to get major effects from the AI, so my style for the AI is to keep it consistent and let the SimEngine do as much of the decision making work as possible.
__________________
LW
LuftWolf is offline   Reply With Quote
Old 06-03-06, 06:36 AM   #10
LuftWolf
Ocean Warrior
 
Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
Default

Quote:
The main one being that the evasion route after engaging the target, are not taken most of the time and the planes will still close on the target after their weapons have been released, where they should better evade to avoid return fire... WIP
Instead of using "Engaging" in the last conditional, use "WeaponAway".
__________________
LW
LuftWolf is offline   Reply With Quote
Old 06-03-06, 06:41 AM   #11
LuftWolf
Ocean Warrior
 
Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
Default

Quote:
TgtRng <$= AttackRng
This should not be a $=, since the string is not being tested for, but rather the value held in the variable taken from the database.
__________________
LW
LuftWolf is offline   Reply With Quote
Old 06-03-06, 07:29 AM   #12
LoBlo
Subsim Diehard
 
Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
Default

So that's why my fighters weren't engaging consistently... thanks

after further testing, the fighter behavior is..... still darn bizzare. With the most bizzare coming whenever a fighter expends its missile load, it will go Kamikaze on reckless intercepts util its closes to point blank, then twirl around to eventually fall into the ocean...

Its obvious the reason why...but how to fix it?...:hmm:
__________________
"Seek not to offend or annoy... only to speak the truth"-a wise man
LoBlo is offline   Reply With Quote
Old 06-03-06, 07:37 AM   #13
LuftWolf
Ocean Warrior
 
Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
Default

Interesting.

I would add a minimum range to the intercept command conditional, like 1/4 of AttackRng. If that doesn't work, try using an absolute value.

Also, try adding If AttackRng > 0 to test for the results of going winchester on that variable. (or better yet, use the Debugviewer and DebugOut "" commands, which is really necessary for doctrine scripting at this level to figure out what's going on)

Ah, isn't modding SO much fun?
__________________
LW
LuftWolf is offline   Reply With Quote
Old 06-03-06, 07:52 AM   #14
LoBlo
Subsim Diehard
 
Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
Default

Fun as in "my head hurts" fun? j/k...actually not really. I just can't stand to see such illogical AI behavior, ruins my "simulation" experience.

I'll try the minimal range to see if it helps the behavior... but this brings up an interesting question...

... How to get planes to automatically return to base after expending their weapons?... :hmm:... this may be biting off more than I can chew. I'll have to cogitate on this one for a while...
__________________
"Seek not to offend or annoy... only to speak the truth"-a wise man
LoBlo is offline   Reply With Quote
Old 06-03-06, 01:14 PM   #15
LuftWolf
Ocean Warrior
 
Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
Default

Quote:
Originally Posted by LoBlo
Fun as in "my head hurts" fun? j/k...actually not really. I just can't stand to see such illogical AI behavior, ruins my "simulation" experience.

I'll try the minimal range to see if it helps the behavior... but this brings up an interesting question...

... How to get planes to automatically return to base after expending their weapons?... :hmm:... this may be biting off more than I can chew. I'll have to cogitate on this one for a while...
There is no way to do this in the doctrines...

You can keep track of how many times the aircraft fires, but this is only useful if you make a unique doctrine for each aircraft.
__________________
LW
LuftWolf is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.