![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
Ocean Warrior
![]() Join Date: Jan 2008
Posts: 2,909
Downloads: 77
Uploads: 11
|
![]()
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. |
![]() |
![]() |
![]() |
#2 |
Swabbie
![]() Join Date: Mar 2008
Posts: 9
Downloads: 56
Uploads: 0
|
![]()
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.
|
![]() |
![]() |
![]() |
#3 |
Seasoned Skipper
![]() Join Date: Aug 2005
Location: Istanbul, Turkiye
Posts: 715
Downloads: 115
Uploads: 0
|
![]()
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 |
![]() |
![]() |
![]() |
#4 |
Pacific Aces Dev Team
|
![]()
At least the AI is there, and it is scripted openly
![]()
__________________
One day I will return to sea ... |
![]() |
![]() |
![]() |
#5 | |
Silent Hunter
![]() Join Date: Jan 2006
Location: UK
Posts: 3,803
Downloads: 11
Uploads: 0
|
![]() Quote:
![]() 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 ![]() ![]() ![]() |
|
![]() |
![]() |
![]() |
#6 |
Seaman
![]() Join Date: Feb 2010
Posts: 42
Downloads: 28
Uploads: 0
|
![]()
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. |
![]() |
![]() |
![]() |
#7 |
A-ganger
![]() Join Date: Mar 2005
Posts: 78
Downloads: 38
Uploads: 0
|
![]()
Woh!!! That's crazy awesome! I wonder if the send contact report could get one's attention.
|
![]() |
![]() |
![]() |
#8 |
Grey Wolf
![]() Join Date: Jul 2008
Location: Sweden
Posts: 831
Downloads: 101
Uploads: 0
|
![]()
the T class is truly a beautiful submarine.
__________________
![]() Liverpool is my relegion, Anfield is my church. True believers never walk alone. |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|