| Author |
Sprint-Drift doctrine |
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-08-11 18:07  
I wrote a sprint-drift doctrine and is listed below. Here is the philosophy behind it. Surface warships use CIWS as their default doctrine. I have added a prolog to this doctrine which will cause a ship to perform a sprint-drift maneuver. It is designed so that the ship will, on average, keep station with any other ships in a formation. The ship will drift for 7 minutes at 5 knots, (my arbitrary choice), and then will sprint at flank speed to the next drift location. It will also randomly begin this maneuver within 10 minutes of the start of the game. This is done so that all the ships in a formation don't sprint at the same time. If the ship is under attack by a sub, it will abandon this maneuver. Once the coast is clear, it will begin again.
To use this doctine, copy it to the doctrine folder and give it a name such as CIWSSprintDrift.txt. Then use the DB editor to change the default doctrine to this new one for all the ships you wish to display this behaviour, (Perry, Udaloy, etc).
I have done some testing with this doctrine and it seems to work fine, however, it has not been exhaustively tested. Hopefully, a few of you can test it and find any bugs and report them. Also, if the amount of time a ship spends drifting is not realistic, that can easily be changed.
Cheers, jsteed
; CIWS Self-defense with Sprint-Drift movement
var Sprint ; boolean to tell program to implement sprint
var Drift ; boolean to tell program to implement drift
var Countdown ; boolean program is in countdown phase to sprint-drift
var Stime ; Amount of time to sprint (sec)
var Dtime ; Amount of time to drift (sec)
var StartT ; Start time for a sprint or drift leg
var OffsetT ; Time to wait before starting sprint-drift (sec)
if Init then {
; if we are already traveling at or near flank speed, sprint-drift is impossible
if ( OwnSpd <= ( MaxSpd - 5 ) ) then {
Sprint = False
Drift = False
Countdown = true
; randomly choose a time to begin sprint-drift (between 0 to 10 minutes)
OffsetT = ( 60 * rnd 10 )
; set drift time to 7 minutes (arbitrary value)
Dtime = 420
; drift speed is 5 knt, this gives us the sprint time at flank speed
Stime = ( ( ( OwnSpd - 5 ) * 420 ) / ( MaxSpd - OwnSpd ) )
; start of countdown to sprint
StartT = Time
} endif
} endif
; is it time to begin sprint-drift?
if ( Countdown AND ( ( Time - StartT ) >= OffsetT ) ) then {
; start of sprint
StartT = Time
Sprint = True
Countdown = False
; start sprint, go to flank speed
SetSpd MaxSpd
} endif
if Sprint then {
; check if sprint period is over
SetSpd MaxSpd
if ( ( Time - StartT ) >= Stime ) then {
Sprint = false
; DEBUGOUT "Time sprinted"
; DEBUGVALUEOUT ( Time - StartT )
Drift = true
; start of drift
StartT = Time
; drift speed = 5 knt
SetSpd 5
DEBUGOUT "Begin drift"
} endif
} else {
if Drift then {
SetSpd 5
if ( ( Time - StartT ) >= Dtime ) then {
; DEBUGOUT "Time drifted"
; DEBUGVALUEOUT ( Time - StartT )
Sprint = true
Drift = false
; start of sprint
StartT = Time
; sprint speed = flank speed
SetSpd MaxSpd
DEBUGOUT "Begin sprint"
} endif
} else {
; If no sprint-drift there was a threat present. Is threat gone?
if ( LostTrack AND ( ( TgtClass $= "WEAP" ) OR ( TgtClass $= "SUB" ) ) ) then {
; DEBUGOUT "Begin sprint-drift again"
; do we need to find random time to begin sprint-drift?
if NOT Countdown then {
Countdown = True
; randomly choose a time to begin sprint-drift (between 0 to 10 minutes)
OffsetT = ( 60 * rnd 10 )
; start of countdown to sprint
StartT = Time
} endif
} endif
} endif
} endif
; New Track
IF NEWTRACK THEN {
; Set Tactic
IF ( TgtClass $= "MISSILE" ) OR ( TgtClass $= "AIR" ) THEN {
SETTACTIC "CIWSAttack"
} ENDIF
; Auto Evade Torps
IF TgtClass $= "WEAP" THEN {
; under attack, suspend sprint drift
Sprint = False
Drift = False
; DEBUGOUT "Avoiding torpedo"
SETTACTIC "SurfEvadeWeap"
} ENDIF
IF TgtClass $= "SUB" THEN {
; found a sub, stop sprint-drift, go to drift speed
Sprint = False
Drift = False
SetSpd 5
; SETTACTIC "SurfAtkSub"
DebugOut "Prosecuting Sub Contact"
} ENDIF
} ENDIF
; AutoIdAir?
IF AUTOSURFIDAIR THEN {
; Inbound < -500?
IF TgtSilos < -500 THEN {
IDENTIFY "UAE"
} ENDIF
} ENDIF
 
|
Thomasew
Joined: Feb 28, 2002 Posts: 1898 From: Bluewater Bay, South Africa
| Posted: 2002-08-11 18:18  
Hi John
Looks good. Would you mind if I split off the 'Sprint-Drift' part of it?
I have some ideas about setting a 'Sprint and Drift' Tactic from the Mission Editor .. and not necessarily Enabled by default.
Cheers
Tom
_________________ He Who Will Not Risk Cannot Win
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-08-11 18:25  
Hi Tom,
No problem, use it however you like. It would be better as a selection in the Mission Editor. I assumed that the choices were hard coded so nothing could be added there. However if you found a workaround, that's great! If it looks like this doctrine works properly, I will add zig-zagging to it later.
Cheers, jsteed
 
|
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-08-12 08:30  
Just one question.
If I copy and paste this doctrine into wordpad or notepad etc I don't get the formatting that I see in doctrine files..
I get it as displayed on the forum. Will it still work OK?
Anyway I'll have a think about it..
_________________
Project 971
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-08-12 09:20  
Hi XabbaRus,
Yes, it should work fine. I can also send you a copy of it in a zip file if you like.
Cheers, jsteed
 
|
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-08-12 16:48  
OK, but send it to this address, XabbaRus"at"hotmail.com
_________________
Project 971
 
|
Bill Nichols
Joined: Feb 27, 2002 Posts: 664 | Posted: 2002-08-13 15:17  
The idea for a 'sprint-and-drift' doctrine/tactic is good. Now, how 'bout a 'Crazy Ivan' tactic? Any takers?
 
|
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-08-13 15:37  
Oh yea, that would be cool
Guess what though, I was watching an Akula running from some torps and he turned 180 degrees, after some CMs, which the torp had passed through, he outturned it and started heading the other way, cool.
However he didn't notice the second torp which took him on the nose.
Nice behaviour though.
_________________
Project 971
 
|
Three14
Joined: Feb 27, 2002 Posts: 313 | Posted: 2002-08-13 16:18  
Is it possible, via the DB and other tricks, to attached a variable to ships? My idea was this:
Create an invisible dummy object in the DB.
Allow any ship to carry this, and only this, dummy object.
Scripts could then use the count on this dummy object (assuming this is a variable -- I never read the scripting language). To start a sprint drift in 20 minutes, perhaps. Or to do whatever else...
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-08-13 16:19  
Hi Bill,
By Crazy Ivan I assume you refer to a sub periodically turning 360 degrees to clear its baffles. That would be easy to model. I assume that only subs without TA's do this. although with the random number generator, they could all be forced to do the maneuver occasionally. SubDef.txt, (the default doctrine for subs), could be modified for any sub that is to behave this way. This doctrine is Tom's baby, so he would have to agree to any changes.
Cheers, jsteed
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-08-13 16:30  
Hi Three14,
Good question! There appear to be very few parameters in the DB that are accessible through the doctrine language. However, DBUser1Flags and DBUser2Flags could be used. I believe that these are currently undefined. Is that correct Tom? If so then we could begin to use these to define which special doctrines ships, subs, etc can use.
Cheers, jsteed
 
|
ferenci
Joined: Apr 03, 2002 Posts: 283 From: Budapest, Hungary
| Posted: 2002-08-14 03:38  
jsteed, as far as I'm concerned there is no need to force the sub to perform the turn ocassianally. I've read somewher that some Russian SSBN CO's had the habit of performing Crazy Ivan every 90 minutes. We can model this behaviour, so there is nothing to do with random number generation. Just a variable containing the length of the period.
Cheers, ferenci
_________________ "There are only two kinds of warships: submarines and targets."

 
|
Madcowz
Joined: Feb 28, 2002 Posts: 574 From: Cambridge (UK)
| Posted: 2002-08-14 04:27  
If we can assign a variable to ships and then this could be used for all sorts of tricks with doctrines.
I like random.
 
|
Thomasew
Joined: Feb 28, 2002 Posts: 1898 From: Bluewater Bay, South Africa
| Posted: 2002-08-14 06:38  
Hi John
RE: Crazy Ivan ... that's fine, but could you just call it from the Subdef.txt, instead of imbedding it in there? i.e. SetTactic "Crazy_Ivan" ... or something like that.
Also, I don't think that this should be a default Tactic. It should either be a random determination, or preferably tied in with one of the Mission Editor Tactics ... which would give the Mission Designer some control over the situation.
E.G. What I have done with your 'Sprint-Drift' doctrine is ... I am using 'DBUser1Flags & 2' in conjunction with a ME Tactic to determine whether the Platform will perform a 'Sprint and Drift'.
I am using 'DBUser1Flags & 1' for something that I am doing with Sonobuoy Searches.
I haven't found any other instances of 'DBUserFlags' being utilised.
So, if you want to tie the Crazy Ivan in with the Subs, that 'don't' have a Towed Array ... then use any other value for DBUserFlags1, or DBUserFlags2 if you prefer.
Just let me know what value you are using ... so that I can set it in the DB.
Thanks
Cheers
Tom
_________________ He Who Will Not Risk Cannot Win
 
|
Bill Nichols
Joined: Feb 27, 2002 Posts: 664 | Posted: 2002-08-14 07:04  
re. Crazy Ivan -- I agree that it shouldn't be the 'default' behavior, it should be a tactic assignable by the mission creator. For example, while the sub is doing a 'transit' or 'transit search' type of tactic.
Also, perhaps it should come in two flavors: one where the sub goes 'active' with its sonar, the other 'passive'. Is this feasible?
 
|