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 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-20-21, 01:44 PM   #61
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by gap View Post
- is the min_height parameter in cmdr_AIAirplane controller doing anything?
To my utmost surprise, yes it does (I'm surprised because with previous behaviour, SetCourseBombs, it seemed inconsequential)

Setting it high (like really high, 200 m or more) prevents even B-18, the worst offender so far, from crashing into ocean. It still flies like pilot just downed a case of beer by himself, but it does so at higher altitude.

Now, all that's needed is:

- make planes fly more stable
- make them, if possible, drop bombs on first pass (now, even with Strafe behaviour, they usually make several circles and turns before they find a good position to drop bombs)

First I hope can be achieved with fine-tuning wings/rudders drag and engine parameters. For second, no clue now but perhaps something will click if we keep changing all values...
kapuhy is offline   Reply With Quote
Old 03-20-21, 05:37 PM   #62
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,300
Downloads: 130
Uploads: 0


Default

Depending on distance to target?
There is a AI Command.
StrafingTooClose

There's A LOT of Commands TDW didn't use.
NeedToDescend
LaunchTorpedoesStrafe
MoveAroundCannonTarget

Etc.
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-21-21, 01:47 AM   #63
Muckenberg
Planesman
 
Join Date: Dec 2014
Location: Czech Republic
Posts: 193
Downloads: 527
Uploads: 0
Default

Quote:
Originally Posted by gap View Post
As far as the strafe strategy will only be used in certain circumstances, I think we can live with the involved oddities. Some of them are not even so impossible; for one thing, I am sure I have read reports of ASW aircraft killing themselves with their own bombs dropped at too a low altitude.


Good day
So I know one confirmed case. It's an attack by Skua aircraft from Ark Royal on the U-30. Here the bombs bounced off the surface and exploded in front of the planes.
Muckenberg is offline   Reply With Quote
Old 03-21-21, 05:51 AM   #64
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
Depending on distance to target?
There is a AI Command.
StrafingTooClose
This one is used by "avoid impact with water" routine, so I think (might be wrong though) "TooClose" in this case refers to distance to water, not target.

For distance to target, GetContactRelDistOnWater works fine.

Quote:
Originally Posted by Jeff-Groves View Post
There's A LOT of Commands TDW didn't use.
NeedToDescend
LaunchTorpedoesStrafe
MoveAroundCannonTarget

Etc.
True, and it's my intention to test them all to determine how will units react to them, then report results here so that either myself or other modders can improve plane AI as much as possible.

-----
If any players who are currently playing a campaign using TWoS are reading this thread - Coastal Commma... wait, uhm, BdU Training Division would find it very helpful if you share your experiences with planes in game currently: how dangerous do you consider them to be, what are your usual reaction/tactic in dealing with them, what types of planes are most common in your game (my tests are very "clinical" and may not reflect real combat engagements).
kapuhy is offline   Reply With Quote
Old 03-21-21, 02:35 PM   #65
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Umm... guys?

So, this is a little side effect of meddling with AI scripts today. It is in no way related to aircraft behaviour, but I hope you'll like it anyway:

kapuhy is offline   Reply With Quote
Old 03-21-21, 02:42 PM   #66
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,300
Downloads: 130
Uploads: 0


Default

Is that AI Subs firing deck guns?
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-21-21, 02:49 PM   #67
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
Is that AI Subs firing deck guns?
Yes.

I added Ship:CanFireCannons as additional condition to hitherto non-functional surface attack strategy and AI subs started firing both AA and deck guns.
kapuhy is offline   Reply With Quote
Old 03-21-21, 02:56 PM   #68
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,300
Downloads: 130
Uploads: 0


Default

Now you need to add crew to those Guns!
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-21-21, 02:58 PM   #69
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,300
Downloads: 130
Uploads: 0


Default

Here's the complete list of AI commands.
I didn't take time to make it all pretty.

GetContactWeight
GetDepth....Dive....
CheckDepth..GetD
amage...InSpotLi
ght.GetCrewRatin
gSub....ContactD
etected.WaitActi
on..PeriscopeRai
sed.RaisePerisco
pe..GetContactAv
oidDist.GetConta
ctRelDist...GetS
ubMaxSpeed..GetC
ontactSpeed.CanF
ollowWaypoint...
ContactIsMoving.
SubInFrontOfCont
act.PersuingTarg
et..CanFire.Faci
ngTargetTrajecto
ry..FireTorpedoe
s...FireCannons.
ContactIs...AreE
nemiesPresent...
SetThrottleRatio
....IsDay...Turn
ToFaceTargetTraj
ectory..MoveOuts
ideDetectionArea
....MoveIntoPosi
tion....MoveNear
DetectionArea...
ApproachStillTar
get.MoveAroundCa
nnonTarget..SetT
hrottle.FollowWp
....CanFireTorpe
does....HasBombs
....HasTorpedoes
....CanFireBombs
....NeedToDescen
d...StrafingTooC
lose....FiredTor
pedo....LaunchTo
rpedoesStrafe...
ShouldPrepareToL
aunch...MoveToFi
reTorpedo...HasW
aypoints....HasC
annons..CanFireC
annons..HasGroup
....HasCommander
....HasSameConta
ctAsCommander...
FireBombs...SetC
ourseBombs..Stra
fe..AvoidWaterIm
pact....SetOnTar
get.ShouldSetOnT
arget...SetCours
eWaypoint...Floc
k...GetContactRe
lDistOnWater....
GetRole.IsType..
IsCommander.SetT
actic...EndCurre
ntTactic....CanC
ontinueCurrentTa
ctic....GetShips
DestroyedRecentl
yInGroup....Idle
ThisShip....AddR
ole.IsRoleInCurr
entTactic...SetL
ineFormation....
AssignRole..GetC
urrentTacticID..
GetCurrentTactic
MinShips....Wait
ForFormation....
GetShipCountInGr
oup.Random..Cont
actIsInsideGroup
Area....SetGotoF
orwardDist..SetG
otoDestRelToCont
act.SetGotoDestR
elToContactKeepF
ormationOrientat
ion.SetGotoDestR
elToGroupCenterA
longGroupHeading
....SetGotoDestR
elToGroupCenter.
StartFiringDCs..
StopFiringDCs...
EnableStarshells
....ShipWaitActi
on..GetMyWeight.
TimeEventHappen.
GetContactLostTi
me..CanFireDCRac
ks..CanFireHHogs
....CanFireDCThr
owers...TorpedoD
etected.CanFireS
tarShells...GetC
ontactDepth.GetC
ontactBearing...
ContactPresenceI
s...GetCurrentSp
eed.GetCurrentSp
eedKnots....Fire
DCRacks.FireDCTh
rowers..FireHHog
s...FireStarShel
ls..AvoidTorpedo
es..FollowWaypoi
nts.Spiral..Pine
appleFlares.Goto
....TurnToHeadin
g...TurnFormatio
nToHeading..GetC
urrentHeading...
GetCurrentFormat
ionHeading..GetF
ormationContactB
earing..GotoActi
on..SetRamDestin
ation...SetSenso
rFactor.IsNeutra
l...IsDocked....
HasContacts.GetC
rewRating...Chan
geStatusIcon....
IsAlone.
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-21-21, 03:57 PM   #70
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
Here's the complete list of AI commands.
I didn't take time to make it all pretty.
Thanks In fact I already noted most of these down after doing, as you've suggested before, a string search in ShSim.act with 010 Editor.
kapuhy is offline   Reply With Quote
Old 03-22-21, 01:49 AM   #71
GrenSo
Grey Wolf
 
Join Date: Apr 2019
Location: Germany
Posts: 828
Downloads: 578
Uploads: 8


Default

Quote:
Originally Posted by kapuhy View Post
Umm... guys?

So, this is a little side effect of meddling with AI scripts today. It is in no way related to aircraft behaviour, but I hope you'll like it anyway:




Nice.

I didn't see any AI sub firing anything. No matter if German or allied subs they have only been driving past and do nothing else.
__________________
Best regards,
GrenSo


“Mankind must put an end to war, or war will put an end to mankind.” - J.F.K.
GrenSo is offline   Reply With Quote
Old 03-23-21, 05:48 PM   #72
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Ok, little update on subs (see, I'm now derailing my own thread )

- They can fire at other subs as well if ordered, so no easy sinking British and Polish U-class subs with deck gun anymore. They will defend themselves

- I can't get them to fire AA at planes, sadly (even though they do fire AA guns at other ships). In this case, script debugger shows CanFireCannons condition as false even is targeted plane is clearly within field of fire. Maybe if I find parts of script that order surface ships to attack planes I could learn something from them... if we could get this to work, we could have functional UFlak escorts in game.

Edit: And if placed right next to surface vessel, surface ship has CanFireCannons=true and sub has CanFireCannons=false when enemy aircraft appears, while bothe have CanFireCannons=true when enemy ship appears. Seems like they really don't want to fight planes.

Last edited by kapuhy; 03-24-21 at 06:16 AM.
kapuhy is offline   Reply With Quote
Old 03-24-21, 11:43 AM   #73
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,300
Downloads: 130
Uploads: 0


Default

TDW included an AI Cannon for Subs but there is no AI AA gun for Subs.
Check the files.
Do a copy of the 20mm and follow what he did for the Deck gun.
Then check the Subs eqp files and adjust.

You have 010 so COMPARE the AI deck gun to the stock Deck gun!
Notice names are changed so ID's will change!
Adjust the SIM with Goblin (Or S3D if you have the SH5 files for it) to match ID's.

Should you want the CRC in the new edited GR2 file to be correct?
I have a script for 010 that will do that.
__________________
I don't do Stupid. So don't ask.

Last edited by Jeff-Groves; 03-24-21 at 01:46 PM.
Jeff-Groves is offline   Reply With Quote
Old 03-24-21, 03:21 PM   #74
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,300
Downloads: 130
Uploads: 0


Default

One thing that still bothers me.
How exactly are ID's being generated?
Sergbuto posted about it years ago but I still have not figured out how it's done!

Finding the key to THAT would make editing files SO MUCH faster!
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-24-21, 03:48 PM   #75
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
TDW included an AI Cannon for Subs but there is no AI AA gun for Subs.
Check the files.
Do a copy of the 20mm and follow what he did for the Deck gun.
Then check the Subs eqp files and adjust.

You have 010 so COMPARE the AI deck gun to the stock Deck gun!
Notice names are changed so ID's will change!
Adjust the SIM with Goblin (Or S3D if you have the SH5 files for it) to match ID's.

Should you want the CRC in the new edited GR2 file to be correct?
I have a script for 010 that will do that.
I just tried this, but unfortunately it didn't work. There's a chance I bungled up something and I'll double-check it later, but for now I feel lack of AI AA gun for subs is not the cause for this problem. Why? Because for surface targets, ANY gun works - AI 88, normal 88, I can even mount a Bismarck turret and my Surcouf-VIIc will happily engage any surface target:



It will also fire at surface targets with its AA gun (and with any gun I tell it to mount on AA station), but refuse to use anything against planes.

So, no progress with AA for now. On the bright side, thanks to you I learned how to compare files with 010 today, something I feel will come in handy more than once
kapuhy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 06:12 PM.


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