| Author |
Errors in Doctrine Files |
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-07-22 19:20  
While writing the ballistic missile doctrine, I became tired of rebooting my computer everytime I made a mistake. So I spent a day and wrote a syntax checker program for doctrine files. I decided to check all the doctrine files from SC and the 1.05 patch. I found several errors which undoubtedly cause problems such as the doctrine not executing as it should or worse. Here is a list of those errors:
1. Disengage.txt line 13: a "{" is missing after THEN
IF TIME > CrsChangeTimer THEN
2. CIWS.txt line 17: AUTOSURFIDAIR is not mentioned in SA's doctrine paper. Is this an error or an undocumented feature?
IF AUTOSURFIDAIR THEN {
3. CIWSAttack.txt line 15: same as above
IF NOT AUTOSURFENGAGEAIR THEN {
4.SubAvoidWeap.txt line 109 there needs to be a space between the + and 50
EvasionDepth = ( MinAlt +50 )
Also the number of IF/ENDIF do not balance.
line 42 should have ENDIF after the "}"
}
5.ShkvalAttack.txt line 5 The variable should be TgtName
DEBUGOUT TargetName
6. Terminal_home.txt line 11 same as above
DEBUGOUT TargetName
Hopefully, someone with more knowledge of doctrines can look at these items and render an opinion. There were also other errors in several other doctrines of a ";" not having a space immediately after it. My experience has shown that this will occasionally effect the behavior of the doctrine file, but not consistently!
I have not looked at the doctrine files from SCX yet. If I find any errors there, I will post them.
Cheers, jsteed
[ This Message was edited by: jsteed on 2002-07-22 19:48 ]
 
|
Thomasew
Joined: Feb 28, 2002 Posts: 1898 From: Bluewater Bay, South Africa
| Posted: 2002-07-22 20:03  
Hi Jsteed
1. Not sure about this one. I can't find anything that actually calls this doctrine ... unless it is called internally. Might be worth investigating. Did your syntax checker not pick up the last routine in this doctrine i.e. 'Done'
2. This is valid. AUTOSURFIDAIR is a flag that is set in the Subcommand.ini file. Default = False ..... therefore the statement IF NOT AUTOSURFIDAIR THEN ...... is True.
3. As above.
4. Not sure what SubAvoidWeap.txt you are using. Mine only has 68 lines ... and MinAlt is not used therein.
5. TargetName is correct ... it returns the name of the platforms currently assigned target. TgtName is a string used to check for a target e.g. If TgtName $= "Cheyenne".
6. As above.
Cheers
Tom
_________________
He Who Will Not Risk Cannot Win

[ This Message was edited by: Thomasew on 2002-07-22 20:29 ]
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-07-22 20:42  
Hi Tom,
The 'Done' instruction is commented out in my version of Disengage. My copy of SubAvoidWeap has 136 lines! I wonder if I am checking the NWS patch here? Below is a copy of the doctrine. Unfortunately, I fixed the 2 errors so I don't know the original creation date. Thanks for the info on the other items.
Cheers, jsteed
; SubAvoidWeap
var LegTimer
var TimeToImpact
var RecognitionDelay
var Snapshot
var LegCourse
var CourseA
var CourseB
var ShadowAbove
var ShadowBelow
var EvasionDepth
var LastMinute
IF Init THEN {
RecognitionDelay = ( Time + 15 + rnd 15 )
LegTimer = -1
Snapshot = false
EvasionDepth = OwnAlt
} ELSEIF LegTimer == -1 THEN {
IF Time > RecognitionDelay THEN {
IF Not Snapshot THEN {
DEBUGOUT "Firing Back!"
; won't actually fire unless it has detected the enemy
FireBest
Snapshot = true
} ENDIF
IF TgtRng < 16000 AND ( TgtSilos < 0 ) AND ( abs RelativeBearing TgtCrs ( TgtBrg + 180 mod 360 ) < 30 ) THEN {
DEBUGOUT "Sub Evading Torpedo!"
TimeToImpact = ( TgtRng / ( ( TgtSpd * 2000 ) / 3600 ) )
IF TimeToImpact < 60 THEN {
LastMinute = true
} ELSE {
LastMinute = false
} ENDIF ***this was changed
DEBUGOUT "Time To Impact:"
DEBUGVALUEOUT TimeToImpact
LegTimer = ( TimeToImpact * 0.60 )
; don't do more than 30 second legs
IF LegTimer < 30 THEN {
LegTimer = 30
} ENDIF
DEBUGOUT "LegTimer:"
DEBUGVALUEOUT LegTimer
SetPriority 255
SetSpd MaxSpd
; Choose an evasive course that takes us OUT of the acquisition cone
CourseA = ( TgtBrg + 80 + rnd 20 )
CourseB = ( TgtBrg - 80 + rnd 20 )
IF abs RelativeBearing TgtCrs CourseA > abs RelativeBearing TgtCrs CourseB THEN {
LegCourse = CourseA
} ELSE {
LegCourse = CourseB
} ENDIF
DEBUGOUT "Leg Course:"
DEBUGVALUEOUT LegCourse
; Throw CM
IF TgtRng < 8000 THEN {
IF TgtSource $= "Active Intercept" THEN {
DEBUGOUT "Launching Decoy"
COUNTERMEASURE "Decoy"
} ELSE {
DEBUGOUT "Launching Jammer"
COUNTERMEASURE "Jammer"
} ENDIF
} ENDIF
; Set Depth Opposite Layer
DEBUGOUT "Layer Depth:"
DEBUGVALUEOUT LAYER
; Shadow depth is LAYER +- 60m
ShadowAbove = ( LAYER + 180 )
ShadowBelow = ( LAYER - 180 )
IF NOT LastMinute THEN {
IF TgtAlt < LAYER THEN {
IF ShadowAbove < PeriDepth THEN {
EvasionDepth = ( LAYER + 180 )
} ELSE {
EvasionDepth = ( PeriDepth - 150 )
} ENDIF
} ELSE {
IF ShadowBelow > TerrainAlt THEN {
EvasionDepth = ( LAYER - 180 )
} ELSE {
EvasionDepth = ( TerrainAlt + 100 )
} ENDIF
} ENDIF
} ELSE {
DEBUGOUT "Last Ditch Effort!"
IF TgtAlt < LAYER THEN {
EvasionDepth = ( PeriDepth - 50 )
} ELSE {
IF MinAlt > TerrainAlt THEN {
EvasionDepth = ( MinAlt + 50 ) ***this was changed
} ELSE {
EvasionDepth = ( TerrainAlt + 100 )
} ENDIF
} ENDIF
} ENDIF
DEBUGOUT "Evasion Depth:"
DEBUGVALUEOUT EvasionDepth
SetAlt EvasionDepth
LegTimer += Time
} ENDIF
} ENDIF
} ELSEIF Time > LegTimer THEN {
LegTimer = -1
} ELSE {
SetPriority 255
SetSpd MaxSpd
SetCrs LegCourse
SetAlt EvasionDepth
} ENDIF
 
|
Thomasew
Joined: Feb 28, 2002 Posts: 1898 From: Bluewater Bay, South Africa
| Posted: 2002-07-23 00:43  
Hi Jsteed
Ahhh!. I remember that one. It was written by someone called ... Polonius??? ... I think, ... about 3 or 4 months ago.
The 'ShadowAbove' etc stuff sort of rings a bell.
I did try it out .... however, I felt that the Enemy Maneuvering was a bit on the wild side. I remember seeing a Typhoon doing pirouettes and spiraling upwards, around it's vertical axis ..... totally impossible .... and totally unrealistic.
It was about this time that I started fiddling with the DB, and sensors etc etc. Once I had tweaked the AI's default sensors, so that they could actually 'hear' something ... the standard 'SubEvadeWeap' worked fine.
Given some decent info .... the AI is actually pretty good.
Cheers
Tom
_________________
He Who Will Not Risk Cannot Win

[ This Message was edited by: Thomasew on 2002-07-23 01:17 ]
 
|