| Author |
Doctrines |
Salty Old Skipper
Joined: Sep 24, 2002 Posts: 18 From: Helsinki
| Posted: 2002-09-26 02:33  
I got sick and tired of computer controlled subs inability to dodge torpedos. My torps appeard to hit always after they started homing. So I made a doctrine file to fix this little annoyance.
Computer controlled subs are now much better in dodging homing topedos without being too good at it.
I also noticed that the computer controlled subs don´t recognize what torpedo is following them. They always used jammers as countermeasure. Even if the torpedo active homing mode. This is due to a failure in use of the command line TgtSource $= "Active Intersept". AI subs never detect torpedos by using active intersept. TgtSource is always passive sonar.
Only way I could fix this was to program the subs to use always bouth countermeasure types at the same time.
To use my doctrine file backup the file SubAvoidWeap.txt clear the contents and copy paste the following lines in to the file.
Sorry to make this difficult but i dont have a place to store it as a zip file.
; SubAvoidWeap
var LegTimer
var RecognitionDelay
var Snapshot
var LegCourse
IF Init THEN {
RecognitionDelay = ( Time + 15 + rnd 15 )
LegTimer = -1
Snapshot = false
} ELSEIF LegTimer == -1 THEN {
IF Time > RecognitionDelay THEN {
IF Not Snapshot THEN {
DEBUGOUT "Firing Back!"
FireBest
Snapshot = true
} ENDIF
IF 500 > TgtRng < 16000 AND ( TgtSilos < 0 ) AND ( abs RelativeBearing TgtCrs ( TgtBrg + 180 mod 360 ) < 30 ) THEN {
DEBUGOUT "Sub running away from Torpedo!"
LegTimer = ( 20 + RND 20 )
SetPriority 255
LegCourse = ( TgtBrg + 180 mod 360 )
LegTimer += Time
} ENDIF
;Evasive Manover
IF TgtRng < 500 AND ( TgtSilos < 0 ) AND ( abs RelativeBearing TgtCrs ( TgtBrg + 180 mod 360 ) < 60 ) THEN {
LegTimer = ( 20 + RND 10 )
SetPriority 255
IF TgtAOB < 180 THEN {
LegCourse = ( TgtBrg + 260 mod 360 )
} ELSE {
LegCourse = ( TgtBrg + 100 mod 360 )
} ENDIF
; Set Depth Opposite Layer
SetAltLayer
; Throw CM?
DEBUGOUT "CM Decoy"
COUNTERMEASURE "Decoy"
DEBUGOUT "CM Jammer"
COUNTERMEASURE "Jammer"
LegTimer += Time
} ENDIF
} ENDIF
} ELSEIF Time > LegTimer THEN {
LegTimer = -1
} ELSE {
SetPriority 254
SetCrs LegCourse
SetSpd MaxSpd
} ENDIF
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-09-26 10:14  
Hi Salty,
Nice to see someone else making doctrines. I have a question. Does TgtSource $= "Active Intercept" always return false? In other words, is this another broken feature of the SC interpreter. Have you tried "Active Sonar" as an alternative?
Cheers, jsteed
 
|
Thomasew
Joined: Feb 28, 2002 Posts: 1898 From: Bluewater Bay, South Africa
| Posted: 2002-09-26 11:29  
Hi Salty
The 'Active Intercept' works just fine ... in the Evade Doctrine. The real problem is actually related to range.
Given that the Wep Sonar's, or any Torpedo Active Sonar, only has a range of 5000 odd yards .... it isn't being detected by the Active Intercept Receiver timeously.
Now ... there is a bug .... but whose is it? ... the Player's, or the AI's??
If you consider that the Torps are pinging at a Freq of 20000Hz i.e. High Frequency ... then why is the player picking it up so soon? ... 'cause you shouldn't be.
The AI's Active Intercept works on the premise ... that if it is within range of the Torp's Active ... it will detect it, and obviously deploy the correct countermeasures to counter it. The Player, however, can detect the same ping much further out ... thereby deploying the correct CMs much earlier.
This may be one of the reasons why there is ALSO a random determination when checking for the Source of the detection, and which CM to deploy i.e. RND 100 > 65 .... so, that the AI will STILL deploy Active Decoys ... just in case.
So, the AI does deploy Active Decoys, even though it hasn't actually determined that the incoming Torp is using Active Sonar. Once the Torp is close enough that the AI can pick up the Active ... it will then only deploy Active Decoys,..... as per the routine.
Having said all this ... I have made some changes in the DB to improve on the AI's ability to detect incoming Actives ... at range.
Although, I have also considered making adjustments to the Player Sub Active Intercept ... just to try and maintain a level playing field.
Hi John: Checking for Active Sonar wouldn't work in this case, as TgtSource pertains to the detecting Platform .... not the Target's Sonar state.
Cheers
Tom
_________________ He Who Will Not Risk Cannot Win
 
|
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-09-26 17:21  
I'd prefer you to make adjustments to the player active sonar intercept Thomas, though I wonder what effects it would have on picking up low frequency stuff?
_________________
Project 971
 
|
MBot
Joined: Apr 28, 2002 Posts: 602 From: Switzerland
| Posted: 2002-09-26 17:27  
Yup, I'd prefere a bit restriction on the player subs aswell.
But be aware that active pings can be heared twice further than its max. range.
_________________
SCX Website: www.comsa.co.uk/scx
YVAN EHT NIOJ
 
|
Salty Old Skipper
Joined: Sep 24, 2002 Posts: 18 From: Helsinki
| Posted: 2002-09-30 02:41  
I have been playing for a while and so far I have never seen AI using decoys or dodge a torpedo (passive of active) successfully.
Problem as I see it is that the AI will detect torpedos first in passive sonar and will react accordingly. It will not re-evaluate the situation before the Legtimer runs to zero. "Legtimer = 0" and "AI Active intersept" very rarely happens at the same time. So the result is usually "passive sonar" reaction, because passive detection is continous.
 
|
Three14
Joined: Feb 27, 2002 Posts: 313 | Posted: 2002-09-30 13:47  
Is Snapshot a game variable? If so, does that mean that firing only snapshots will confuse the AI's response (as the code above makes an exception for it)?
 
|
Thomasew
Joined: Feb 28, 2002 Posts: 1898 From: Bluewater Bay, South Africa
| Posted: 2002-10-01 15:37  
Hi
Salty: IF you have 'never' seen an AI Sub deploy an Active Decoy ... then you have a problem somewhere, ... as, based on what you are saying .. RND 100 will never be greater 65 .... which isn't the case at all.
The 'Active Intercept' line is as follows:-
IF TgtSource $= "Active Intercept" OR ( RND 100 > 65 ) THEN {
Countermeasure "Decoy"
So, even if the AI couldn't, at this point, determine that the Torp was Active, it could (and does) still launch an Active Decoy based on the Random Determination.
That's aside from the fact .... that the 'Active Intercept' does, in fact, work ... but, only if the Sub is within the Active Range of the Torp.
The reason I know this .... is primarily because I have tested it ... literally hundreds of times. Prior to my involvement with SCX ... much of the stuff I was doing was on the Torpedo Doctrines and CMs. All I did was fire Torpedoes ... and watch the result ... so, I have seen the AI deploy Active Decoys .... many, many, many times.
The only 'basic' problem with the standard Evade Doctrine ... is that the RND 100 > 65 is actually in the wrong place. It should be a seperate IF ... below the Passive Decoy launch. The reason being ... that the AI should be allowed to fire one of each ... and not just one or the other .... unless, it knows that the Torp is definitely Active, or not.
BTW, Legtimer will never be 0. It is given a random number upon initialisation .... and then incremented by time .... until the Sub goes into Evade, at which point is is evaluated as a fixed number, until Time > the original random number + time before Evade. Then it will get incremented by the new time etc etc. It is also at this time ... that TgtSource will be checked again.
One of the biggest problems with the standard Evade Doctrine .... is that the AI cannot deploy CMs whilst it is Evading .... which is obviously incorrect.
The Evade Doctrine that I have done for SCX 1.3 has been very much revamped.
CMs are not launched randomly anymore ... but rather based on whether the AI Sub has CMs loaded in the Launchers. Whilst it is Evading ... it is also re-loading CMs (based on game reload times), and will deploy them once they are available ... even if it is still Evading.
If at any time ... the AI Sub determines that the Torp is Active or Passive (believe me, it can & will determine it) ... then it will reload the launchers with either 2 Actives or 2 Passives ... as the case may be. Another reason why I know that the Active Intercept works .... I had to get this routine working correctly ... and, it does work.
Plus other changes to extend the AI Subs' life a bit longer ... and make yours a bit more difficult. If you thought it was a Turkey Shoot before .... it ain't no more.
Three14: Snapshot is a Doctrine variable ... and can be used in different ways. The example above is used to determine whether or not ... the AI took a Snapshot at you, prior to Evading. The AI can't determine that the Torp that was launched at him ... was based on a Snapshot solution ... it just knows that a Torp is coming/came from that bearing.
Cheers
Tom
_________________
He Who Will Not Risk Cannot Win

[ This Message was edited by: Thomasew on 2002-10-01 16:13 ]
 
|
|