![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
Subsim Diehard
![]() Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
|
![]()
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 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 |
![]() |
![]() |
![]() |
#2 |
Ocean Warrior
![]() Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
|
![]()
"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. |
![]() |
![]() |
![]() |
#3 | |
Subsim Diehard
![]() Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
|
![]()
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 Quote:
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. |
|
![]() |
![]() |
![]() |
#4 |
Ocean Warrior
![]() Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
|
![]()
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 ![]() ![]() |
![]() |
![]() |
![]() |
#5 |
Subsim Diehard
![]() Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
|
![]()
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 |
![]() |
![]() |
![]() |
#6 |
Navy Seal
![]() |
![]()
Good luck, hope you can figure this out. AI aircraft performance has always bugged me.
|
![]() |
![]() |
![]() |
#7 |
Subsim Diehard
![]() Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
|
![]()
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 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 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. |
![]() |
![]() |
![]() |
#8 |
Subsim Diehard
![]() Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
|
![]()
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 |
![]() |
![]() |
![]() |
#9 | |
Ocean Warrior
![]() Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
|
![]() Quote:
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 ![]() ![]() |
|
![]() |
![]() |
![]() |
#10 | |
Ocean Warrior
![]() Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
|
![]() Quote:
__________________
LW ![]() ![]() |
|
![]() |
![]() |
![]() |
#11 | |
Ocean Warrior
![]() Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
|
![]() Quote:
__________________
LW ![]() ![]() |
|
![]() |
![]() |
![]() |
#12 |
Subsim Diehard
![]() Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
|
![]()
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 |
![]() |
![]() |
![]() |
#13 |
Ocean Warrior
![]() Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
|
![]()
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 ![]() ![]() |
![]() |
![]() |
![]() |
#14 |
Subsim Diehard
![]() Join Date: May 2006
Location: Texas!
Posts: 971
Downloads: 78
Uploads: 3
|
![]()
Fun as in "my head hurts" fun?
![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#15 | |
Ocean Warrior
![]() Join Date: May 2005
Location: Free New York
Posts: 3,167
Downloads: 2
Uploads: 0
|
![]() Quote:
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 ![]() ![]() |
|
![]() |
![]() |
![]() |
|
|