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-14-21, 09:30 AM   #1
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default Some aircraft AI tests/questions

Some aircraft AI related tests and questions, in hope they might spark a discussion and lead to somewhat more dangerous planes

1. Aircraft vs flank speed:

I made a little test yesterday, posting the results here in case they might be of interest to other modders on Subsim. In short, I was trying to see how the bomb-armed planes will behave in different conditions. This was done in TWoS 2.2.23 with no other mods.

Starting conditions for this scenario: plane is flying a 500m, starting at 5km distance, directly at submarine from bearing 270. I relaunched this with submarine going at different speeds and that's the result:



I also did test with different aircraft types, and all have trouble with aligning for bomb run against target moving at flank speed, though faster planes (especially Mosquito, Dauntless and Fulmar) tended to do better, often hitting sub in second or third pass.

Level bomber AI does not get into this endless "dry run" loop, though it is far less accurate with its aiming. Still, lacking better options, I'd say a plane that drops bombs all over the place is more credible threat than plane that doesn't drop them at all, so switching worst offenders (like Catalina and Swordfish - both do the endless loop with standard AI and both occasionally hit target with level bomber AI) might be a good idea.

2. MAD ideas?

In SH4, setting visual sensors to negative MinSurface value allowed planes to see submerged U-Boat (this was used in OM for Magnetic Anomaly Detector). Unfortunately, it doesn't seem to work in SH5 - I used the same settings as OM and planes just flew over submerged boat without noticing.

I'm looking for a way to simulate MAD in SH5, but so far nothing seems to work (including sonar placed in sensor that is 200 meters under a plane so it can be below water surface). If anyone knows of a way that could work, I'd be happy to try it (one of planes I modeled should have MAD equipped).

EDIT: thanks to Jeff-Groves spotting and correcting my oversight, MAD sensor now is confirmed to work

3. Sinking torpedoes?

I ran the above scenario with torpedo armed Swordfish. It did a perfect torpedo run at low altitude and then dropped a torpedo... which sank to the bottom like a stone. What's the secret behind getting them to work like they did in TDW's screenshots in IRAI thread?

Last edited by kapuhy; 03-14-21 at 02:58 PM.
kapuhy is offline   Reply With Quote
Old 03-14-21, 10:02 AM   #2
LesBaker
Loader
 
Join Date: Jun 2014
Location: Netley Abbey, Southampton, United Kingdom
Posts: 90
Downloads: 521
Uploads: 5
Default

Hi Kapuhy,


Have you tried changing the hight for level bombing runs, for instance 250m insteated of 500?


Les
LesBaker is offline   Reply With Quote
Old 03-14-21, 10:07 AM   #3
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by LesBaker View Post
Hi Kapuhy,


Have you tried changing the hight for level bombing runs, for instance 250m insteated of 500?


Les
Yes (50m), and it didn't seem to affect accuracy as much as I expected.
kapuhy is offline   Reply With Quote
Old 03-14-21, 11:13 AM   #4
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

1. Aircraft vs flank speed

Setting dive bombers as level bombers will lead to unrealistic attack tactics. What if we fit them with some fast-aiming but short-ranged dummy gun, whose muzzle flash effect will spawn a bomb?

2. MAD ideas

Have you checked that visual sensor's detection angle does not prevent if from "seeing" directly below the plane?

3. Sinking torpedoes

Have you tried testing with Swordfish planes (and, indeed, with IRAI installed, no other mod overwriting its files)?

IF they use torpedoes affectively, I would try messing with various parameters (aircraft max speed, position of the torpedo bone, drag coefficients, min height, ect) until I find the one(s) which break their ability to use torpedoes in a prope manner.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-14-21, 12:07 PM   #5
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by gap View Post
Setting dive bombers as level bombers will lead to unrealistic attack tactics.
That's true, on the other hand "strafe & perform acrobatic stunts" is not a tactic I've heard of as well

Besides, looking at this movie for example:



is for planes like Liberator (maybe Catalina as well) attack profile used looks more like fast, low level horizontal approach (of course, these might be just shots staged for propaganda purposes and actual approach might have been more vertical).

Quote:
Originally Posted by gap View Post
What if we fit them with some fast-aiming but short-ranged dummy gun, whose muzzle flash effect will spawn a bomb?
I thought of this and it could be a viable solution (was experimenting with creating a retro-rocket launcher for MAD armed planes, and sure enough you can set a "gun" like this).

2. MAD ideas

Quote:
Originally Posted by gap View Post
Have you checked that visual sensor's detection angle does not prevent if from "seeing" directly below the plane?
Yes. But I have another suspect as to why it didn't work:

Quote:
Originally Posted by gap View Post
Have you tried testing with Swordfish planes (and, indeed, with IRAI installed, no other mod overwriting its files)?
Speaking of IRAI files - in Airplane.aix, there's this fragment:

strategy PlaneNavigate(Plane)
{
precond
{
(Plane:HasTorpedoes() or Plane:HasBombs() or Plane:HasCannons()) and Ship:GetContactDepth() > -8.5
}
strategies
{
BombCourse,
TorpedoCourse,
CannonCourse,
AirToAirCombat
}
}


If I understand correctly, it sets conditions for a plane that must be met in order for it to navigate (fly towards?) detected target:

a) plane must have means to attack (bombs, torpedoes, guns)
b) contact must be at no more than 8.5 meters depth

I wonder what would happen if we set this to 20.0 for example... but to test this, I would have to know how to make edits to .aix file affect the game (just changing it doesn't seem to do anything - maybe it is overwritten by something or requires rerunning file patcher to work?)
kapuhy is offline   Reply With Quote
Old 03-14-21, 12:26 PM   #6
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,299
Downloads: 130
Uploads: 0


Default

There are 3 instances of -8.5 in that file.
You might try changing them all.


Found 3 occurrences of '-8.5'.
Line 335 4h " Ship:GetContactDepth() > -8.5 and (Plane:HasTorpedoes() or Plane:HasBombs() or Plane:HasCannons())"
Line 409 4h " (Plane:HasTorpedoes() or Plane:HasBombs() or Plane:HasCannons()) and Ship:GetContactDepth() > -8.5"
Line 766 4h " !Plane:HasCommander() and Plane:HasWaypoints() and ( ( !Ship:ContactPresenceIs(PRESENCE_SENSORS, 0) or ( Ship:ContactPresenceIs(PRESENCE_SENSORS, 0) and Ship:GetContactDepth() <= -8.5 ) ) or ( !Plane:HasBombs() and !Plane:HasTorpedoes() and !Plane:HasCannons() ) )"



010 is excellent for finding this stuff.
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-14-21, 12:45 PM   #7
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by kapuhy View Post
That's true, on the other hand "strafe & perform acrobatic stunts" is not a tactic I've heard of as well
Just lol

The Ubi guys must have drawn their virtual pilots from the Orlik Aerobatic Team

Quote:
Originally Posted by kapuhy View Post
Besides, looking at this movie for example:

[...]

is for planes like Liberator (maybe Catalina as well) attack profile used looks more like fast, low level horizontal approach (of course, these might be just shots staged for propaganda purposes and actual approach might have been more vertical).
In my previous post I was talking in general but I don't think aircraft of the size and structure of a Liberator or a Catalina could safely perform a dive bombing attack. Looking at this list I would say that, with very few exceptions, all the dedicated dive bombers of WWII were more similar to a fighter or heavy fighter than to a medium or heavy bomber

Quote:
Originally Posted by kapuhy View Post
I thought of this and it could be a viable solution (was experimenting with creating a retro-rocket launcher for MAD armed planes, and sure enough you can set a "gun" like this).
Oh, cool we had the same idea! By the way we already have retro bomb models in game. If you look at historic pictures, they were very similar or identical to Squid projectiles.

Quote:
Originally Posted by kapuhy View Post

Speaking of IRAI files - in Airplane.aix, there's this fragment:

strategy PlaneNavigate(Plane)
{
precond
{
(Plane:HasTorpedoes() or Plane:HasBombs() or Plane:HasCannons()) and Ship:GetContactDepth() > -8.5
}
strategies
{
BombCourse,
TorpedoCourse,
CannonCourse,
AirToAirCombat
}
}


If I understand correctly, it sets conditions for a plane that must be met in order for it to navigate (fly towards?) detected target:

a) plane must have means to attack (bombs, torpedoes, guns)
b) contact must be at no more than 8.5 meters depth

I wonder what would happen if we set this to 20.0 for example... but to test this, I would have to know how to make edits to .aix file affect the game (just changing it doesn't seem to do anything - maybe it is overwritten by something or requires rerunning file patcher to work?)
I don't think so. Aix files are plain ascii files, not hardcoded patch is required to "enable" their tweaks (IRAI itself is a proof of that). As sar as I can say, the code they contain is Python or a Python-like language. It is possible that some other script overrides the line that you are editing, but any tweak you do should immediately take effect (after reloading the game indeed).
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 03-14-21 at 12:54 PM.
gap is offline   Reply With Quote
Old 03-14-21, 12:59 PM   #8
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,299
Downloads: 130
Uploads: 0


Default

That file is the only one that contains -8.5 in the scripts folder of IRAI
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-14-21, 01:05 PM   #9
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
There are 3 instances of -8.5 in that file.
You might try changing them all.
Thanks Jeff! I got so fixated on my find that I forgot to check rest of the file...

Ok, after a quick test: changing all instances solves issue Tonci87 was writing about in TWoS thread - Catalina now continues its attack and drops bombs at a place where U-Boat has disappeared under water. I'll recheck the MAD sensor later and report.
kapuhy is offline   Reply With Quote
Old 03-14-21, 01:09 PM   #10
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,299
Downloads: 130
Uploads: 0


Default

Pretty smart for a Village Idiot ain't I?
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-14-21, 01:25 PM   #11
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by kapuhy View Post
Ok, after a quick test: changing all instances solves issue Tonci87 was writing about in TWoS thread - Catalina now continues its attack and drops bombs at a place where U-Boat has disappeared under water. I'll recheck the MAD sensor later and report.


Now we must check history books and websites for information on which depth was considered viable for an aiir attack with bombs or depth charges against a submerged submarine. I am sure I have read this information somewhere

Quote:
Originally Posted by Jeff-Groves View Post
Pretty smart for a Village Idiot ain't I?
...and a professional cunning linguist too, let's not forget that
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-14-21, 01:51 PM   #12
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by gap View Post
Now we must check history books and websites for information on which depth was considered viable for an aiir attack with bombs or depth charges against a submerged submarine. I am sure I have read this information somewhere
...and browse IRAI thread as well as maybe ask SH5 modders active at the time to find why this 8.5 depth was set, so as not to reintroduce an old issue by solving this one.

Speaking of which, in IRAI thread there was talk of problem with planes constantly strafing surface where the boat has dived, perhaps this might be the reason?

Quote:
Originally Posted by Jeff-Groves View Post
Pretty smart for a Village Idiot ain't I?
kapuhy is offline   Reply With Quote
Old 03-14-21, 02:15 PM   #13
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,299
Downloads: 130
Uploads: 0


Default

You have a link to the specific pages?
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 03-14-21, 02:16 PM   #14
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by kapuhy View Post
...and browse IRAI thread as well as maybe ask SH5 modders active at the time to find why this 8.5 depth was set, so as not to reintroduce an old issue by solving this one.
I was one of them. I don't remember any particular issue related with submarine depth and air raids, but I suppose not many will like being bombed by a Catalina when they think they are safe under 15 or 20 meters of water.

Early in campaign they might still be safe, but after your tweak and after the introduction of air depth charges in campaign, things might change. I have a collection of realistic allied depth bomb models on my hard disc. All my work, so no permission is going to be required for importing them in game. Over the years I have also gathered information on them (year/mont of introduction, blast radii, depth of detonation, etc). Should we join forces for a SH5 Aerial ASW mod?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-14-21, 02:20 PM   #15
Muckenberg
Planesman
 
Join Date: Dec 2014
Location: Czech Republic
Posts: 193
Downloads: 527
Uploads: 0
Default

Quote:
Originally Posted by gap View Post


Now we must check history books and websites for information on which depth was considered viable for an aiir attack with bombs or depth charges against a submerged submarine. I am sure I have read this information somewhere

The Admiralty introduced a minimum depth of fifty feet (fifteen meters) for deep charges to protect surface vessels dropping charges from explosion. Beginning in the summer of 1941, the Coast Command introduced fifty feet of bombs dropped from aircraft until a hydrostatic detonator was deployed to a depth of twenty-five feet.

I will look for more information.
Muckenberg 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 02:03 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.