SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [TEC] Some aircraft AI tests/questions (https://www.subsim.com/radioroom/showthread.php?t=248833)

Jeff-Groves 08-10-22 02:19 PM

Mostly I'm playing with the Sub AI.

I'd like to get a Type 14 to raise up out of the depths and stop engines for a ReSupply.
:D
And before you say there is no Type 14?
Yes there is!

kapuhy 08-10-22 02:31 PM

As promised, my old attempt at making surface ships fire torpedoes:

https://drive.google.com/file/d/1Rg-...ew?usp=sharing

It was some time ago so I don't remember exactly what was changed, but I can see I added wpn_SubTorpedoSys to both ship and to torpedo launcher, and added torpedo strategy to the scripts. This didn't work anyway so...

Jeff-Groves 08-10-22 02:35 PM

Thanks Mate.

I'll look at your work and see if We can get it working.
:up:

If you have mission files for your Aircraft and this? that would save me some time also.
:up:

kapuhy 08-10-22 03:28 PM

Quote:

Originally Posted by Jeff-Groves (Post 2822455)
If you have mission files for your Aircraft and this? that would save me some time also.
:up:

Here, along with airplane and sub deck gun script (mind, the last one was just to prove the concept works, so I only modified one of existing attack patterns - it doesn't make sense as actual tactic):

https://drive.google.com/file/d/1EST...ew?usp=sharing

Edit: Surface torpedo script appears to be bugged (if its mission is run, the destroyer not only doesn't use any tubes but doesn't show up as using normal ship scripts...)

Jeff-Groves 08-10-22 03:53 PM

OK. I got the files. Thanks!
:up:

kapuhy 02-26-23 09:07 AM

Quote:

Originally Posted by gap (Post 2822253)
Else, Plane:Strafe is another of those commands that accept a numeric parameter, but all the instances I found of it go from -20 to 100. Could that be an angle relative to current aircraft heading? :doh:

A little late :) but I finally deciphered what the argument of Strafe function means today. It's altitude. Plane will attempt a strafing run keeping close to specified altitude.

At low or negative values this parameter doesn't seem to make any difference, probably because it is overridden by need to avoid impact with water.

Edit: Another complication I see in my testing is that if a plane has fixed machine guns, it will attempt to aim at target leading it to not keep ordered altitude. This might be connected with fighter planes crashing into sea way more often than heavier bombers.

propbeanie 02-26-23 10:08 AM

Most interesting find :hmmm: - I wonder what "height" the planes begin to get "jittery" and attempt to avoid collision with the water? In SH4, I attempted to have a grouping of torpedo bombers come down to wave top for their anticipated attack runs, and instead they continued to fly at least 200m up. In the game though, with a Betty TB that had spawned from one of the AirBases, while my sub was on the surface travelling (a different experiment), I observed the Betty TB approaching in the distance, most likely at its default 500m height, then "spiral" down, and instead of coming in from my 270 relative, where it had been approaching from, came in from my 235 and was no more than 50m off the water for its attack run, though it did drop too soon, and the torpedo was easily avoided... but if the game can have a plane do that, why can we not call for that behavior?? lol

kapuhy 02-26-23 01:51 PM

Quote:

Originally Posted by propbeanie (Post 2855166)
Most interesting find :hmmm: - I wonder what "height" the planes begin to get "jittery" and attempt to avoid collision with the water?

I'll be testing this, but I suspect it will turn out to be their respective minimum height as set in sim file. It would make sense, why else have minimum height set for a plane if you're not using it as a trigger for AvoidImpact action? If so, the jittery behaviour might be result of basically telling the plane "Strafe at around 15 to 20 meters but no lower than 50".

gap 03-10-23 11:42 AM

Quote:

Originally Posted by kapuhy (Post 2855164)
A little late :) but I finally deciphered what the argument of Strafe function means today. It's altitude. Plane will attempt a strafing run keeping close to specified altitude.

At low or negative values this parameter doesn't seem to make any difference, probably because it is overridden by need to avoid impact with water.

Cool, thank you for letting us know :up:

Quote:

Originally Posted by kapuhy (Post 2855164)
Edit: Another complication I see in my testing is that if a plane has fixed machine guns, it will attempt to aim at target leading it to not keep ordered altitude. This might be connected with fighter planes crashing into sea way more often than heavier bombers.

Good point. Fixed aircraft guns have a small elevation/training angle, in the order of few degrees (otherwise they would never fire). Maybe increasing their elevation angle and/or tweaking their firing arcs might alleviate the problem :hmm2:

Quote:

Originally Posted by propbeanie (Post 2855166)
Most interesting find :hmmm: - I wonder what "height" the planes begin to get "jittery" and attempt to avoid collision with the water? In SH4, I attempted to have a grouping of torpedo bombers come down to wave top for their anticipated attack runs, and instead they continued to fly at least 200m up. In the game though, with a Betty TB that had spawned from one of the AirBases, while my sub was on the surface travelling (a different experiment), I observed the Betty TB approaching in the distance, most likely at its default 500m height, then "spiral" down, and instead of coming in from my 270 relative, where it had been approaching from, came in from my 235 and was no more than 50m off the water for its attack run, though it did drop too soon, and the torpedo was easily avoided... but if the game can have a plane do that, why can we not call for that behavior?? lol

Quote:

Originally Posted by kapuhy (Post 2855212)
I'll be testing this, but I suspect it will turn out to be their respective minimum height as set in sim file. It would make sense, why else have minimum height set for a plane if you're not using it as a trigger for AvoidImpact action? If so, the jittery behaviour might be result of basically telling the plane "Strafe at around 15 to 20 meters but no lower than 50".

I agree with kapuhy, minimum height might be the main "culprit", but other unrelated AI routines might also interfere. Their existence can be easily tested by setting min. height to very low values


All times are GMT -5. The time now is 12:51 AM.

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.