SUBSIM Radio Room Forums



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

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > Silent Hunter 5
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-05-10, 01:16 PM   #1
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,109
Downloads: 109
Uploads: 2


Default Anyone operated with wolfpacks? Seen friendly subs attacking?

With all this mess about the DRM, we had been distracted of what was the most supported petition by the community

What about wolfpacks? Anyone here been able to operate yet with them? Cooperating with friendly subs, or at least have you seen them attack the same convoy?

Come on, I'm interested in knowing what happened to this
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 03-05-10, 02:05 PM   #2
shawnyp420
A-ganger
 
Join Date: Mar 2005
Posts: 78
Downloads: 38
Uploads: 0
Default

Nope. I've even been experimenting with the "Send Contact Report" hoping subs would show up.
shawnyp420 is offline   Reply With Quote
Old 03-05-10, 02:13 PM   #3
ReFaN
Grey Wolf
 
Join Date: Jul 2008
Location: Sweden
Posts: 831
Downloads: 101
Uploads: 0
Default

Not really, but i nearly crapped my pants having 2 torpedoes swish by my own ship, couldnt find the aggressor tho.

this was near Norway during the invasion days.
__________________



Liverpool is my relegion, Anfield is my church. True believers never walk alone.
ReFaN is offline   Reply With Quote
Old 03-05-10, 02:24 PM   #4
SteamWake
Rear Admiral
 
Join Date: Mar 2005
Posts: 13,224
Downloads: 5
Uploads: 0
Default

Only passed a friendly sub in the Kiel canal damn near smacked into em they had to throw it into astern flank to avoid me.
__________________
Follow the progress of Mr. Mulligan : http://www.subsim.com/radioroom/showthread.php?t=147648
SteamWake is offline   Reply With Quote
Old 03-05-10, 02:29 PM   #5
TripleDaddy
A-ganger
 
Join Date: Apr 2007
Location: Charlotte
Posts: 76
Downloads: 1
Uploads: 0
Default

Saw one operating off the coast of England. Thought he was going to steal my kill, but he motored on...
TripleDaddy is offline   Reply With Quote
Old 03-05-10, 03:45 PM   #6
sergbuto
Pacific Aces Dev Team
 
Join Date: Sep 2002
Location: Sweden
Posts: 1,331
Downloads: 15
Uploads: 0


Default

Quote:
Originally Posted by Hitman View Post
With all this mess about the DRM, we had been distracted of what was the most supported petition by the community

What about wolfpacks? Anyone here been able to operate yet with them? Cooperating with friendly subs, or at least have you seen them attack the same convoy?

Come on, I'm interested in knowing what happened to this
The same goes for British subs. Curious to see confirmations on whether they can dive and attack with torpedoes.
__________________
Serg's SH4 and SH3 pages
sergbuto is offline   Reply With Quote
Old 03-05-10, 03:51 PM   #7
piri_reis
Seasoned Skipper
 
Join Date: Aug 2005
Location: Istanbul, Turkiye
Posts: 715
Downloads: 115
Uploads: 0
Default

Quote:
Originally Posted by sergbuto View Post
The same goes for British subs. Curious to see confirmations on whether they can dive and attack with torpedoes.
They have been reported to dive when attacked but I haven't seen anything about wolfpacks or AI subs torpedoing people..

We're trying to test this using custom missions but the mission editor is not being cooperative, if you can help, please check this thread.
__________________

Lt.z.S. Barbaros Hayreddin, U-35, 2nd Flot/Kiel, Type VIIB
Oct.29.1939, 2nd Patrol Eastern English Waters
Running SH5/TWOS
piri_reis is offline   Reply With Quote
Old 03-05-10, 04:39 PM   #8
sergbuto
Pacific Aces Dev Team
 
Join Date: Sep 2002
Location: Sweden
Posts: 1,331
Downloads: 15
Uploads: 0


Default

Quote:
Originally Posted by piri_reis View Post
They have been reported to dive when attacked ..
Have not seen such reports. Can you point out?
__________________
Serg's SH4 and SH3 pages
sergbuto is offline   Reply With Quote
Old 03-05-10, 04:57 PM   #9
JU_88
Silent Hunter
 
Join Date: Jan 2006
Location: UK
Posts: 3,811
Downloads: 11
Uploads: 0
Default

Tested the British U class abit in the mission editor.
I can confirm they can dive and surface -but they seem to a have a few problems with this in shallow depth. (they bottom out on occasion)
I have yet to see one make an attack with guns or torpedos.

Im my test mission i put a submerged U-class up against a german merchent (unarmed)
But the mission screwed up, 3 merchents and and 3 U-class were spawned (stacked on top of each other)
Some took and damage and sunk themselves as a result)

not sure what Im doing wrong.....
On a side note: the 3D model of the U-class is beautifully crafted.
JU_88 is offline   Reply With Quote
Old 03-05-10, 05:10 PM   #10
Nisgeis
Ocean Warrior
 
Join Date: Jan 2008
Posts: 2,909
Downloads: 77
Uploads: 11
Default

I shelled a U Class near Scapa Flow and the cheeky git dived and then fired two torpedoes at me.
__________________
--------------------------------
This space left intentionally blank.
Nisgeis is offline   Reply With Quote
Old 03-05-10, 05:16 PM   #11
Kravixon
Swabbie
 
Join Date: Mar 2008
Posts: 9
Downloads: 56
Uploads: 0
Default

I came across a Brit sub of the U class in the mid-north Nord See. I came close on the surface to about 1 km and opened with the deck gun (no torpedos left and heavily damaged on the return trip). He dived after 3-4 impacts so I just motored on full speed away for fear of retaliation.
Kravixon is offline   Reply With Quote
Old 03-05-10, 05:25 PM   #12
piri_reis
Seasoned Skipper
 
Join Date: Aug 2005
Location: Istanbul, Turkiye
Posts: 715
Downloads: 115
Uploads: 0
Default

I mean look at the AI Sub Script !
Lots of tactics implemented already.
Run or attack based on time of day and enemy strength, torpedo/guns attack percentage, Get into firing position (there's your wolfpack!), etc.

Perhaps this script can be modified to keep shadowing a convoy and contact BDU/other boats with radio, with all this scripting I would bet it's possible!

Code:
strategy SubStrategies(Sub)
{
    strategies
    {
        Attack,
        Navigate
    }
}

# Attacks an enemy contact
strategy Attack(Sub)
{
    precond
    {
        Sub:CanFire()
    }
    strategies
    {
        ShipAttack,
        SubmarineAttack
    }
}

strategy ShipAttack(Sub)
{
    precond
    {
        !Sub:ContactIs(SUBMARINE)
    }
    strategies
    {
        TorpedoAttack,
        CannonAttack
    }
}

# how to attack a submarine
strategy SubmarineAttack(Sub)
{
    precond
    {
        Sub:ContactIs(SUBMARINE)
    }
    
    strategies
    {
        # cum functioneaza pentru submarine mai grele de 1000 de tone?
        exclusive
        {
            TorpedoAttack (8),
            CannonAttack (2)
        }
    }
}

strategy TorpedoAttack(Sub)
{
    precond
    {
        Sub:ContactIs(SUBMARINE) or (Sub:GetContactWeight() >= fLightWeight)
        and (!Sub:ContactIsMoving() or (Sub:FacingTargetTrajectory() and Sub:ContactIsMoving() ))
    }
    strategies
    {
        TorpedoDayAttack,
        TorpedoNightAttack
    }
}

strategy TorpedoDayAttack(Sub)
{
    precond 
    {
        Sub:IsDay()
    }
    action
    {  
        Sub:Dive(periscopeDepth, true);
        Sub:RaisePeriscope(2);
        Sub:FireTorpedoes();
    }
}

strategy TorpedoNightAttack(Sub)
{
    precond
    {
        !Sub:IsDay()
    }
    action
    {
        Sub:FireTorpedoes();
    }
}

strategy CannonAttack(Sub)
{
    precond
    {        
        (Sub:GetContactWeight() < fLightWeight  or Sub:ContactIs(SUBMARINE))
        and (!Sub:AreEnemiesPresent(ESCORT))
        and (!Sub:AreEnemiesPresent(BATTLESHIP))
        and (Sub:GetContactRelDist() < 3000.0)
    }
    action
    {
        Sub:SetThrottleRatio(1.0);
        Sub:Dive(0.0, true);
        Sub:MoveAroundCannonTarget(fRadius);
        Sub:FireCannons();
    }
}

strategy Navigate(Sub)
{    
    strategies
    {
        AdvancedNavigation,
        SubFollowWaypoint
    }
}

strategy AdvancedNavigation(Sub)
{
    precond
    {
        Sub:GetCrewRatingSub() > CREW_POOR
    }
    strategies
    {
        Hide, 
        HandleContact,    
        Check,
        Surface
    }
}
strategy Hide(Sub)
{
    # 0 e in loc de Sub:EnemyDangerous()
    # sau contact too close to attack
    precond
    {     Sub:ContactDetected() and (!Sub:CheckDepth(hideDepth)) 
            and (Sub:GetContactRelDist() <= (Sub:GetContactAvoidDist() * 0.98))
            and (!Sub:PersuingTarget())
        or (Sub:ContactIs(ESCORT) and ((Sub:IsDay() and (Sub:GetContactRelDist() < DAY_ESCORT_EVADE_DIST)) 
                or (!Sub:IsDay() and Sub:GetContactRelDist() < NIGHT_ESCORT_EVADE_DIST)) )
    }
    action
    {
        Sub:Dive(hideDepth, true);
        Sub:WaitAction(30.0); #wait 30 min
    }
}

# We check for contacts using the periscope.
# for this we need to go to periscope depth (after waiting underwater for 30 min)
# Once the periscope is raised, keep checking for 12 sec.
strategy Check(sub)
{
  precond
  {
    (!Sub:ContactDetected()) and (Sub:GetDepth() < periscopeDepth - 1) 
  }
  action
  {
    Sub:Dive(periscopeDepth, false);
    Sub:RaisePeriscope(periscope);
    Sub:WaitAction(5.0); # wait 12 seconds
  }
}


#We surface if we have no contact detected
strategy Surface(Sub)
{
    strategies
    {
        SurfaceCheck,
        SurfaceDamaged
    }
}

strategy SurfaceCheck(Sub)
{
  precond 
  { !Sub:ContactDetected() and Sub:CheckDepth(periscopeDepth)
    or (Sub:GetContactRelDist() >= Sub:GetContactAvoidDist())
  }
  action
  { 
    Sub:Dive(0.0, false);  #Surface the boat
  }
}

#Emergency surface if Damage > 50%
strategy SurfaceDamaged(Sub)
{
    precond
    {
        Sub:GetDamage() > 0.5
    }
    action
    {
        Sub:Dive(0.0, true); 
    }
}

# Strategies for aproaching and attacking an enemy contact
strategy HandleContact(Sub)
{
    precond 
    { 
        Sub:ContactDetected()
    }
    strategies
    {
        EvadeDetection,
        PositionToFire
    }
}

# Evades enemy visual detection (day and night time)
strategy EvadeDetection(Sub)
{
#the only difference between day and night evasion is the EVADE_DIST. 
    strategies
    {    
        EvadeDetectionDay, 
        EvadeDetectionNight,
        EvadeDefault
    }
}

# Evades from contact sight during day time
strategy EvadeDetectionDay(Sub)
{
    precond
    {
        Sub:IsDay()
    }
    strategies
    {
        EvadeEscortDay,        
    }
}

# Evades from contact sight at night
strategy EvadeDetectionNight(Sub)
{
    precond
    {
        !Sub:IsDay()
    }
    strategies
    {
        EvadeEscortNight,
    }    
}

# Evades escorts (night version)
strategy EvadeEscortNight(Sub)
{
    precond
    {
        Sub:ContactIs(ESCORT)
    }
    strategies
    {
        EvadeCloseEscortNight,
        EvadeFarEscortNight
    }
}

# Evades escort if not too far away during night time
strategy EvadeCloseEscortNight(Sub)
{
    precond
    {
        Sub:GetContactRelDist() < NIGHT_ESCORT_EVADE_DIST
    }
    action
    {
        Sub:Dive(-90.0, true);
        Sub:SetThrottleRatio(0.33);
        Sub:MoveOutsideDetectionArea(); #do try to attack contact after evade was done
    }
}

# Evades far escort during night time
strategy EvadeFarEscortNight(Sub)
{
    precond
    {
        Sub:GetContactRelDist() >= NIGHT_ESCORT_EVADE_DIST
        or (Sub:InSpotLight())
    }
    action
    {
        Sub:SetThrottleRatio(1.0);
        Sub:MoveOutsideDetectionArea(); #do try to attack contact after evade was done
    }
}

# Evades escorts (day version)
strategy EvadeEscortDay(Sub)
{
    precond { Sub:ContactIs(ESCORT)}
    strategies
    {
        EvadeCloseEscortDay,
        EvadeFarEscortDay,
        EvadeDefault
    }
}

# Evades an enemy escort if not too far away (day time)
strategy EvadeCloseEscortDay(Sub)
{
    precond    { Sub:GetContactRelDist() < DAY_ESCORT_EVADE_DIST }
    action
    {
        Sub:SetThrottle(0.33);
        Sub:MoveOutsideDetectionArea(); #do try to attack contact after evade was done
    }
}

# Evades far enemy escorts (day time)
strategy EvadeFarEscortDay(Sub)
{
    precond{ Sub:GetContactRelDist() >= DAY_ESCORT_EVADE_DIST }
    action
    {
        Sub:SetThrottleRatio(1.0);
        Sub:MoveOutsideDetectionArea();
    }
}

# Evade enemy contacts if they are not escorts
strategy EvadeDefault(Sub)
{
    precond 
    { 
        (!Sub:ContactIs(ESCORT)) and (!Sub:ContactIs(ESCORT)) and (Sub:GetContactRelDist() <= (Sub:GetContactAvoidDist() * 0.98) ) and 
        (!Sub:CanFire()) and (!Sub:PersuingTarget())
    }
    action
    {
        Sub:MoveOutsideDetectionArea();
    }
}

strategy PositionToFire(Sub)
{
    precond
    {
        Sub:PersuingTarget() and ( Sub:GetSubMaxSpeed() > Sub:GetContactSpeed() )
    }
    strategies
    {
        PositionToFireCannons,
        PositionToFireTorpedos
    }
}

# Positions the sub in a good firing position
strategy PositionToFireTorpedos(Sub)
{
    precond
    {
        !Sub:CanFire()
        and ( (Sub:GetContactWeight() >= fLightWeight) or Sub:ContactIs(SUBMARINE) )
    }
    action
    {
        Sub:SetThrottleRatio(1.0);
    }
    strategies
    {
        MoveNearDetectionArea,
        MoveIntoPosition,
        TurnToFaceTargetTrajectory,    
        ApproachStillTarget,
    }
}

strategy PositionToFireCannons(Sub)
{
    precond
    {
        Sub:GetContactWeight() < fLightWeight
        and Sub:GetContactRelDist() > 2500.0
    }
    action
    {
        Sub:ApproachStillTarget();    
    }
}

# Approaches the target's detection area before trying to get in front of it
strategy MoveNearDetectionArea(Sub)
{
    precond
    {
        (Sub:GetContactRelDist() >= (Sub:GetContactAvoidDist() * 1.10)) and 
        Sub:ContactIsMoving() and Sub:PersuingTarget()
    }
    action
    {
        Sub:MoveNearDetectionArea();
    }
}

# Tries to get in front of a moving ship and also keep away from it's
# visual detection area
strategy MoveIntoPosition(Sub)
{    
    precond
    {
        Sub:PersuingTarget() and Sub:ContactIsMoving() 
        and (!Sub:SubInFrontOfContact())
    }
    action
    {    
        Sub:MoveIntoPosition();
    }
}



# Turns the sub towards target trajectory so that the angle between the perpendicular 
# to the trajectory and the sub's heading vector is less than 10 degrees
strategy TurnToFaceTargetTrajectory(Sub)
{
    precond
    {
        Sub:ContactIsMoving() and Sub:SubInFrontOfContact() 
        and (!Sub:FacingTargetTrajectory()) and Sub:PersuingTarget()
    }
    action
    {
        Sub:TurnToFaceTargetTrajectory();
    }
}

# Approaches a target which has a speed less than 0.1
strategy ApproachStillTarget(Sub)
{
    precond
    {
        (!Sub:ContactIsMoving()) and (Sub:GetContactRelDist() >= 2000.0)
    }
    action
    {
        Sub:ApproachStillTarget();
    }
}

strategy SubFollowWaypoint(Sub)
{
    precond
    {
        Sub:CanFollowWaypoint() and !Sub:ContactDetected()
    }
    action
    {
        Sub:FollowWp();
    }
}
__________________

Lt.z.S. Barbaros Hayreddin, U-35, 2nd Flot/Kiel, Type VIIB
Oct.29.1939, 2nd Patrol Eastern English Waters
Running SH5/TWOS
piri_reis is offline   Reply With Quote
Old 03-06-10, 03:06 AM   #13
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,109
Downloads: 109
Uploads: 2


Default

At least the AI is there, and it is scripted openly
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 03-06-10, 05:21 AM   #14
JU_88
Silent Hunter
 
Join Date: Jan 2006
Location: UK
Posts: 3,811
Downloads: 11
Uploads: 0
Default

Quote:
Originally Posted by piri_reis View Post
I mean look at the AI Sub Script !
Lots of tactics implemented already.
Run or attack based on time of day and enemy strength, torpedo/guns attack percentage, Get into firing position (there's your wolfpack!), etc.

Perhaps this script can be modified to keep shadowing a convoy and contact BDU/other boats with radio, with all this scripting I would bet it's possible!

Code:
strategy SubStrategies(Sub)
{
    strategies
    {
        Attack,
        Navigate
    }
}
 
# Attacks an enemy contact
strategy Attack(Sub)
{
    precond
    {
        Sub:CanFire()
    }
    strategies
    {
        ShipAttack,
        SubmarineAttack
    }
}
 
strategy ShipAttack(Sub)
{
    precond
    {
        !Sub:ContactIs(SUBMARINE)
    }
    strategies
    {
        TorpedoAttack,
        CannonAttack
    }
}
 
# how to attack a submarine
strategy SubmarineAttack(Sub)
{
    precond
    {
        Sub:ContactIs(SUBMARINE)
    }
 
    strategies
    {
        # cum functioneaza pentru submarine mai grele de 1000 de tone?
        exclusive
        {
            TorpedoAttack (8),
            CannonAttack (2)
        }
    }
}
 
strategy TorpedoAttack(Sub)
{
    precond
    {
        Sub:ContactIs(SUBMARINE) or (Sub:GetContactWeight() >= fLightWeight)
        and (!Sub:ContactIsMoving() or (Sub:FacingTargetTrajectory() and Sub:ContactIsMoving() ))
    }
    strategies
    {
        TorpedoDayAttack,
        TorpedoNightAttack
    }
}
 
strategy TorpedoDayAttack(Sub)
{
    precond 
    {
        Sub:IsDay()
    }
    action
    {  
        Sub:Dive(periscopeDepth, true);
        Sub:RaisePeriscope(2);
        Sub:FireTorpedoes();
    }
}
 
strategy TorpedoNightAttack(Sub)
{
    precond
    {
        !Sub:IsDay()
    }
    action
    {
        Sub:FireTorpedoes();
    }
}
 
strategy CannonAttack(Sub)
{
    precond
    {        
        (Sub:GetContactWeight() < fLightWeight  or Sub:ContactIs(SUBMARINE))
        and (!Sub:AreEnemiesPresent(ESCORT))
        and (!Sub:AreEnemiesPresent(BATTLESHIP))
        and (Sub:GetContactRelDist() < 3000.0)
    }
    action
    {
        Sub:SetThrottleRatio(1.0);
        Sub:Dive(0.0, true);
        Sub:MoveAroundCannonTarget(fRadius);
        Sub:FireCannons();
    }
}
 
strategy Navigate(Sub)
{    
    strategies
    {
        AdvancedNavigation,
        SubFollowWaypoint
    }
}
 
strategy AdvancedNavigation(Sub)
{
    precond
    {
        Sub:GetCrewRatingSub() > CREW_POOR
    }
    strategies
    {
        Hide, 
        HandleContact,    
        Check,
        Surface
    }
}
strategy Hide(Sub)
{
    # 0 e in loc de Sub:EnemyDangerous()
    # sau contact too close to attack
    precond
    {     Sub:ContactDetected() and (!Sub:CheckDepth(hideDepth)) 
            and (Sub:GetContactRelDist() <= (Sub:GetContactAvoidDist() * 0.98))
            and (!Sub:PersuingTarget())
        or (Sub:ContactIs(ESCORT) and ((Sub:IsDay() and (Sub:GetContactRelDist() < DAY_ESCORT_EVADE_DIST)) 
                or (!Sub:IsDay() and Sub:GetContactRelDist() < NIGHT_ESCORT_EVADE_DIST)) )
    }
    action
    {
        Sub:Dive(hideDepth, true);
        Sub:WaitAction(30.0); #wait 30 min
    }
}
 
# We check for contacts using the periscope.
# for this we need to go to periscope depth (after waiting underwater for 30 min)
# Once the periscope is raised, keep checking for 12 sec.
strategy Check(sub)
{
  precond
  {
    (!Sub:ContactDetected()) and (Sub:GetDepth() < periscopeDepth - 1) 
  }
  action
  {
    Sub:Dive(periscopeDepth, false);
    Sub:RaisePeriscope(periscope);
    Sub:WaitAction(5.0); # wait 12 seconds
  }
}
 
 
#We surface if we have no contact detected
strategy Surface(Sub)
{
    strategies
    {
        SurfaceCheck,
        SurfaceDamaged
    }
}
 
strategy SurfaceCheck(Sub)
{
  precond 
  { !Sub:ContactDetected() and Sub:CheckDepth(periscopeDepth)
    or (Sub:GetContactRelDist() >= Sub:GetContactAvoidDist())
  }
  action
  { 
    Sub:Dive(0.0, false);  #Surface the boat
  }
}
 
#Emergency surface if Damage > 50%
strategy SurfaceDamaged(Sub)
{
    precond
    {
        Sub:GetDamage() > 0.5
    }
    action
    {
        Sub:Dive(0.0, true); 
    }
}
 
# Strategies for aproaching and attacking an enemy contact
strategy HandleContact(Sub)
{
    precond 
    { 
        Sub:ContactDetected()
    }
    strategies
    {
        EvadeDetection,
        PositionToFire
    }
}
 
# Evades enemy visual detection (day and night time)
strategy EvadeDetection(Sub)
{
#the only difference between day and night evasion is the EVADE_DIST. 
    strategies
    {    
        EvadeDetectionDay, 
        EvadeDetectionNight,
        EvadeDefault
    }
}
 
# Evades from contact sight during day time
strategy EvadeDetectionDay(Sub)
{
    precond
    {
        Sub:IsDay()
    }
    strategies
    {
        EvadeEscortDay,        
    }
}
 
# Evades from contact sight at night
strategy EvadeDetectionNight(Sub)
{
    precond
    {
        !Sub:IsDay()
    }
    strategies
    {
        EvadeEscortNight,
    }    
}
 
# Evades escorts (night version)
strategy EvadeEscortNight(Sub)
{
    precond
    {
        Sub:ContactIs(ESCORT)
    }
    strategies
    {
        EvadeCloseEscortNight,
        EvadeFarEscortNight
    }
}
 
# Evades escort if not too far away during night time
strategy EvadeCloseEscortNight(Sub)
{
    precond
    {
        Sub:GetContactRelDist() < NIGHT_ESCORT_EVADE_DIST
    }
    action
    {
        Sub:Dive(-90.0, true);
        Sub:SetThrottleRatio(0.33);
        Sub:MoveOutsideDetectionArea(); #do try to attack contact after evade was done
    }
}
 
# Evades far escort during night time
strategy EvadeFarEscortNight(Sub)
{
    precond
    {
        Sub:GetContactRelDist() >= NIGHT_ESCORT_EVADE_DIST
        or (Sub:InSpotLight())
    }
    action
    {
        Sub:SetThrottleRatio(1.0);
        Sub:MoveOutsideDetectionArea(); #do try to attack contact after evade was done
    }
}
 
# Evades escorts (day version)
strategy EvadeEscortDay(Sub)
{
    precond { Sub:ContactIs(ESCORT)}
    strategies
    {
        EvadeCloseEscortDay,
        EvadeFarEscortDay,
        EvadeDefault
    }
}
 
# Evades an enemy escort if not too far away (day time)
strategy EvadeCloseEscortDay(Sub)
{
    precond    { Sub:GetContactRelDist() < DAY_ESCORT_EVADE_DIST }
    action
    {
        Sub:SetThrottle(0.33);
        Sub:MoveOutsideDetectionArea(); #do try to attack contact after evade was done
    }
}
 
# Evades far enemy escorts (day time)
strategy EvadeFarEscortDay(Sub)
{
    precond{ Sub:GetContactRelDist() >= DAY_ESCORT_EVADE_DIST }
    action
    {
        Sub:SetThrottleRatio(1.0);
        Sub:MoveOutsideDetectionArea();
    }
}
 
# Evade enemy contacts if they are not escorts
strategy EvadeDefault(Sub)
{
    precond 
    { 
        (!Sub:ContactIs(ESCORT)) and (!Sub:ContactIs(ESCORT)) and (Sub:GetContactRelDist() <= (Sub:GetContactAvoidDist() * 0.98) ) and 
        (!Sub:CanFire()) and (!Sub:PersuingTarget())
    }
    action
    {
        Sub:MoveOutsideDetectionArea();
    }
}
 
strategy PositionToFire(Sub)
{
    precond
    {
        Sub:PersuingTarget() and ( Sub:GetSubMaxSpeed() > Sub:GetContactSpeed() )
    }
    strategies
    {
        PositionToFireCannons,
        PositionToFireTorpedos
    }
}
 
# Positions the sub in a good firing position
strategy PositionToFireTorpedos(Sub)
{
    precond
    {
        !Sub:CanFire()
        and ( (Sub:GetContactWeight() >= fLightWeight) or Sub:ContactIs(SUBMARINE) )
    }
    action
    {
        Sub:SetThrottleRatio(1.0);
    }
    strategies
    {
        MoveNearDetectionArea,
        MoveIntoPosition,
        TurnToFaceTargetTrajectory,    
        ApproachStillTarget,
    }
}
 
strategy PositionToFireCannons(Sub)
{
    precond
    {
        Sub:GetContactWeight() < fLightWeight
        and Sub:GetContactRelDist() > 2500.0
    }
    action
    {
        Sub:ApproachStillTarget();    
    }
}
 
# Approaches the target's detection area before trying to get in front of it
strategy MoveNearDetectionArea(Sub)
{
    precond
    {
        (Sub:GetContactRelDist() >= (Sub:GetContactAvoidDist() * 1.10)) and 
        Sub:ContactIsMoving() and Sub:PersuingTarget()
    }
    action
    {
        Sub:MoveNearDetectionArea();
    }
}
 
# Tries to get in front of a moving ship and also keep away from it's
# visual detection area
strategy MoveIntoPosition(Sub)
{    
    precond
    {
        Sub:PersuingTarget() and Sub:ContactIsMoving() 
        and (!Sub:SubInFrontOfContact())
    }
    action
    {    
        Sub:MoveIntoPosition();
    }
}
 
 
 
# Turns the sub towards target trajectory so that the angle between the perpendicular 
# to the trajectory and the sub's heading vector is less than 10 degrees
strategy TurnToFaceTargetTrajectory(Sub)
{
    precond
    {
        Sub:ContactIsMoving() and Sub:SubInFrontOfContact() 
        and (!Sub:FacingTargetTrajectory()) and Sub:PersuingTarget()
    }
    action
    {
        Sub:TurnToFaceTargetTrajectory();
    }
}
 
# Approaches a target which has a speed less than 0.1
strategy ApproachStillTarget(Sub)
{
    precond
    {
        (!Sub:ContactIsMoving()) and (Sub:GetContactRelDist() >= 2000.0)
    }
    action
    {
        Sub:ApproachStillTarget();
    }
}
 
strategy SubFollowWaypoint(Sub)
{
    precond
    {
        Sub:CanFollowWaypoint() and !Sub:ContactDetected()
    }
    action
    {
        Sub:FollowWp();
    }
}

Awesome...
Now i Just to finnish this mother off and get her in as an AI/player unit.

(The T-Class = British equivilent of the Type IX & Gato ... gotta love those 11 torpedo tubes )



JU_88 is offline   Reply With Quote
Old 03-06-10, 05:55 AM   #15
avee
Seaman
 
Join Date: Feb 2010
Posts: 42
Downloads: 28
Uploads: 0
Default

Hello to all subsimmers.
Good news to us - wolfpacks ARE in game. Don`t know yet how exactly they work, but they exist. You can find them in campaign files.
For example here`s a map of wolfpack operation in "Happy days" campaign.

There are also many single Uboats patrolling.
avee 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 09:12 PM.


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