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)
-   -   Volunteers needed, to test experimental AI tweaks (https://www.subsim.com/radioroom/showthread.php?t=254648)

kapuhy 01-31-23 03:49 PM

Volunteers needed, to test experimental AI tweaks
 
Hi guys! In short, I'm looking for volunteer(s) who are currently playing SH5 campaign (with or without TWoS, the only thing required would be that you have JGSME mod manager set up), who would be willing to test changes I've made to TDW's version of Airplane.aix script in order to make planes in game more dangerous.


If you're interested, here's a little more detailed explanation:

Plane AI in SH5 is governed by Airplane.aix file located in data/Scripts/AI folder. Vanilla version was (like most of the game) very buggy and modders have been trying to improve it, most notably TheDarkWraith in his IRAI mod (this is the version used by TWoS megamod among others). Unfortunately TDW never finished working on it, and plane AI still has many problems leading to aircraft not attacking a U-Boat when they should or crashing into ocean. This was discussed at length and tested in a thread I've started some time ago, and based on findings from this thread I did some changes to TDW's version of Airplane.aix aiming to make planes more of a threat to the player.


Unfortunately, my free time is very limited these days and I cannot do any sort of extensive testing, especially testing in campaign (all my own tests were done in specially prepared single missions to have a controlled environment where I can make various script changes and compare results. Campaign doen't work that way - planes fly in various groups, weather conditions, approach from different directions, plus there are various tactics emploed by player to evade the attack - all this has an impact on how well AI will work). This is why I'm looking for someone who is currently playing a campaign to test changes and provide feedback.

How would this work? Here, you'll find a mod that replaces Airplane.aix with new script:

https://www.subsim.com/radioroom/dow...o=file&id=6291

Copy it to your mods folder (or TWOS_Parts folder if you use TWoS). It can be enabled or disabled through JGSME at any time during your campaign, even mid-patrol, and will work both for vanilla game and for TWoS. After enabling it, when you are attacked by an aircraft, please post here the results:

- What type of plane (if you had time to check or use external cam)
- How did you respond to the attack (dive, fight it with AA, etc)
- What was the result (did the plane drop any bombs? Did it crash into ocean or did it do some other weird maneuver?)

I hope to pinpoint planes and situation that lead to least satisfying results, and use this to improve their behaviour by further tweaking either the script or plane parameters.

Final note on credits: as noted above, I was working on version of the script created by TheDarkWraith and included in TWoS megamod, so most of the script is TDW's work, I just changed parts that led to buggy behaviour (specific info on changes made is in comments within script file).

Muckenberg 01-31-23 05:33 PM

Hello, I will keep you updated. I just started Happy Times.:Kaleun_Salute:

kapuhy 01-31-23 05:36 PM

Quote:

Originally Posted by Muckenberg (Post 2850594)
Hello, I will keep you updated. I just started Happy Times.:Kaleun_Salute:

Thanks :salute:

propbeanie 01-31-23 07:47 PM

I am quite busy right now kapuhy, but if I can finish up a few things and get back to having fun actually playing the game, I'll do some reports. But it will be at least several weeks before I can. :salute:

GrenSo 02-01-23 03:06 AM

Maybe I will have time on this weekend. But without guarantee.

kapuhy 02-01-23 04:42 AM

Thanks guys :up:

Anyways, from my own testing in single missions so far, this current version seems to improve the following:

- planes more willing to drop bombs (still a lot of "dry runs" but there should be a bomb dropped on player within 1-5 minutes of plane getting in range though efficiency varies from plane to plane)
- way faster turning back for another attack, which also means they keep you in range of their machine guns for better suppression
- planes attempt to drop bomb on place where U-Boat has just dived, and while they almost always miss it's still better than immediately breaking off the moment your periscope hides under water

Downsides:
- weird maneuvers that sometimes lead to stalling (especially with level bombers)
- accuracy in bomb drops is poor.

propbeanie 02-01-23 11:04 AM

My guess is that there is still too much SH3/4 AI still in SH5 for the scripting to influence too much of their behavior. It will be interesting to test. Do you have the planes set to Elite (CrewRating=4)? That is almost a necessity in ASW planes, and improves their "maneuvering". Those dry runs, of not dropping occur in SH4 irritatingly all of the time, especially when the player sub dives prior to visual contact. Strange thing is, on the 2nd pass from the plane, they will drop their bombs almost precisely where the submarine dove, almost like they dropped a dye marker on their first pass - which would be cool to model in - but that "accuracy" there is uncanny and unrealistic. Surely, the radar equipped plane was able to gather course and speed data inbound, and could more accurately anticipate where the sub would be? If the airplane makes visual contact, it almost always drops bombs on the first pass, and strafes the water and/or (surely) diving boat. The plane's turning tighter and maintaining contact with the sub in SH5 is something that would be nice to have in SH4, where they often fly 12-15 nm beyond before coming back for a 2nd and 3rd pass... Cool stuff, kapuhy! :salute:

kapuhy 02-01-23 03:14 PM

Quote:

Originally Posted by propbeanie (Post 2850732)
Do you have the planes set to Elite (CrewRating=4)? That is almost a necessity in ASW planes, and improves their "maneuvering".

Hmm, I've done my testing on Veteran which is default rating. Now, I just repeated test on Elite with weird results - default unchanged AI did drop bombs with Catalina, though it missed by a lot, while changed AI achieved a direct hit but took more time to drop a bomb. Will have to make further tests on Elite rating I guess.

Edit: Wait I take that back. I mistakenly set "Poor" crew rating instead of Elite. Which makes it weirder still: "Poor" default AI (by default I mean unchanged IRAI script in this case) does drop bombs on moving target, and in first pass to boot! It doesn't hit, sure. But actual "Elite" AI, just like "Veteran", does not drop a bomb at all making endless dry runs...:06:

Quote:

Originally Posted by propbeanie (Post 2850732)
If the airplane makes visual contact, it almost always drops bombs on the first pass, and strafes the water and/or (surely) diving boat.

Not the case in SH5. Dropping bombs on first pass is a rarity except for level bombers (who do drop bombs but miss by an entire zipcode).

Edit: case in point - look at the video embedded in this post: https://www.subsim.com/radioroom/sho...08&postcount=1

propbeanie 02-02-23 07:07 AM

Most interesting... SH4 does similar, but will almost always drop on the first pass when the boat stays on the surface, and usually on the 2nd if it doesn't on the first. In real life, the dive bombers used their machine gun tracers to help them "aim" their airplanes for the bomb drops, so if you're seeing bullet splashes across the boat, you would assume they would drop right on you... they must have crippled the AI for the scripting, or maybe WITH the script... I'll have to look at that for my curiosity... lol

kapuhy 02-02-23 08:17 AM

Quote:

Originally Posted by propbeanie (Post 2850873)
they must have crippled the AI for the scripting, or maybe WITH the script... I'll have to look at that for my curiosity... lol

Script is simple. There are two boolean functions (syntax looks like Javascript, kind of):

Plane:HasBombs()
Plane:CanFireBombs()

These are conditions for action Plane:FireBombs();

So if both are true, plane should execute action.

Except - I have checked approaches with AI Debugger (very useful SH5 tool allowing you to check values of all functions of all scripts in any given moment of time), that there is a moment during approach when both conditions are true and the plane still doesn't execute the action.

There must be something within Plane:FireBombs() function that prevents it from doing what it is supposed to be doing, but what? I don't have access to that code itselt, just the script that uses it. So, my solution was simply to maximize time plane spends over target (by switching from normal bomb approach to "circle target and strafe it repeatedly" behaviour), increasing probability that Plane:FireBombs() will be triggered at some point.

Muckenberg 02-02-23 12:20 PM

Hello, I would like to ask you if you would provide me with your missions that you created for testing. I could test different situations of the pomorka's behavior, flak fire, evasive maneuvers, submerged, etc. I would give you the test results for comparison here on Subsim.
I really don't know when I will come across a plane in the campaign, but I will try to sail as close to England as possible.

kapuhy 02-02-23 12:44 PM

Quote:

Originally Posted by Muckenberg (Post 2850949)
Hello, I would like to ask you if you would provide me with your missions that you created for testing. I could test different situations of the pomorka's behavior, flak fire, evasive maneuvers, submerged, etc. I would give you the test results for comparison here on Subsim.

Sure, but it's just a simple template (with one U-Boat, one plane and neutral ship I put for reference so that I know how far I want to put plane from the boat). I am changing it in editor for every test (switching/adding planes, changing weather, direction of attack, starting depth and speed of U-Boat and so on).

Do you know how to use Mission Editor in SH5? If so, here's a mission template - install it like other mods and tweak to your liking.

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

If you don't know how to edit missions, I'll write instructions for you.

Muckenberg 02-02-23 01:36 PM

Unfortunately, I don't know how to work with the mission editor. if you made a guide, you would be very kind. Thank you very much. :Kaleun_Salute:

kapuhy 02-03-23 04:47 PM

Quote:

Originally Posted by Muckenberg (Post 2850958)
Unfortunately, I don't know how to work with the mission editor. if you made a guide, you would be very kind. Thank you very much. :Kaleun_Salute:

Ok, I should have time on Sunday to make a guide and post it.

Pascal 02-03-23 07:02 PM

I've just started a new campaign - it's necessary to dive back into the game from time to time...
So, June 20, 1940 midway through the North Sea - 2 planes are circling, watching, then one of them dives, drops 2 bombs!
Everyone is wounded and 55% of the hull is left
Conclusion : obviously, this is a change from previous experiences where planes were diving in the water, or passing by as tourists ...

Lesson well learned, if plane in sight, I dive !


All times are GMT -5. The time now is 06:28 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.