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

Reply
 
Thread Tools Display Modes
Old 05-14-08, 04:15 PM   #1
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default [TEC] changing 40mm/37mm to deck gun for AI?

In my ongoing quest for improved surface action in SH4, I'm wondering if it is possible to have the AI treat 1 AA gun on a sub as a deck gun so that more than two guns can be firing on a surface target simultaneously. (This is assuming that having the AI utilize an AA gun for both surface and air targets is impossible).

Here is my rationale for such a change: I've personally found that having the AI fire on air targets is not important to me at all. I almost always dive, and if I happen to be caught with my pants down, I'd rather man at least one gun myself. However, I find myself continually annoyed that when I initiate a gun action, there are all these automatic weapons going unused.

The ideal solution would be to chose one AA gun to be recognized as a second deck gun. On boats with only a single AA gun + deck gun, the AI would use both against surface targets and you could man the AA gun to turn it against aircraft if needed (or boats with 1 gun could be left as is if you always manned the AA gun during a surface engagement). On boats with 2 AA guns, whichever gun you prefer to use against aircraft would be the second deck gun. When engaged in a surface action, you could could man the pure AA gun and have 3 guns firing against a surface target simultaneously (e.g. AI engages designated target with 4" gun and 40mm Bofors, you engage with 20mm/second Bofors).

Potential barriers:
-although you can take control of multiple AA gun positions, on boats with 2 deck guns, you cannot take control of the second deck gun. Would this happen if the sim treated an AA gun as a deck gun?
-can the AI aim an AA gun at a surface target, or is AI aiming hardcoded to the deck gun sight, i.e. would your Bofors have to exchange the open sight for an optical sight?
-Fleet Boats with 2 5" deck guns might not be able to utilize such a change.
-if you had to give up aiming the deck gun yourself (which I believe is far too easy anyways, and should be left to the AI), could anything be done about the AI's woeful inability to handle any targeting order other than to fire at the waterline?
-you might have to have crew manning both deck guns and AA guns when engaging an aircraft if you wanted the gun to load when you weren't manning the position.
-could an AA gun maintain its position on the sub and still be used by the AI against surface targets?
__________________
-AKD
akdavis is offline   Reply With Quote
Old 05-14-08, 05:59 PM   #2
Snaptrap
Eternal Patrol
 
Join Date: Oct 2007
Location: Alberta, Canada
Posts: 224
Downloads: 0
Uploads: 0
Default

Why not replace the AA guns with deck guns and just throw rocks at the planes when they attack?

Honestly, I don't see why this couldn't be done, but my guess would be tedious work and ultimately pointless. What I did with my mod was apply the late war conning towers to all the subs, and for most of them, they come with two deck and aa guns. This method would be easiest with a few simple lines to edit for each file.
Snaptrap is offline   Reply With Quote
Old 05-14-08, 09:55 PM   #3
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default

That's cool, but I like history and don't think it pointless. Of course, I could give all the subs nuke torpedoes and stop worrying about topside ordance altogether.
__________________
-AKD
akdavis is offline   Reply With Quote
Old 05-15-08, 06:41 AM   #4
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Try changing the weapon type from AAgun to Cannon in the weapon sim file, at least in sh3 as long as it has AP/HE and AA shells it opens fire on both surface and air targets.

Ref
__________________
ref is offline   Reply With Quote
Old 05-15-08, 07:54 AM   #5
Snaptrap
Eternal Patrol
 
Join Date: Oct 2007
Location: Alberta, Canada
Posts: 224
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by akdavis
That's cool, but I like history and don't think it pointless. Of course, I could give all the subs nuke torpedoes and stop worrying about topside ordance altogether.
I understand. I used nuke torps once and I think they take too much of the challenge element from the game.
Snaptrap is offline   Reply With Quote
Old 05-15-08, 08:07 AM   #6
Snaptrap
Eternal Patrol
 
Join Date: Oct 2007
Location: Alberta, Canada
Posts: 224
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by ref
Try changing the weapon type from AAgun to Cannon in the weapon sim file, at least in sh3 as long as it has AP/HE and AA shells it opens fire on both surface and air targets.

Ref
Any shell type can be used for this. The important thing is that the Crew AI understands that the gun can be used on either surface or air targets. I was going to do this once but left it out because the shells used in the AA guns were at maximum strength and only used to quickly dispatch annoying aircraft. It would've ended up doing the same for everything else too.
Snaptrap is offline   Reply With Quote
Old 05-15-08, 09:37 AM   #7
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Snaptrap
Quote:
Originally Posted by ref
Try changing the weapon type from AAgun to Cannon in the weapon sim file, at least in sh3 as long as it has AP/HE and AA shells it opens fire on both surface and air targets.

Ref
Any shell type can be used for this. The important thing is that the Crew AI understands that the gun can be used on either surface or air targets. I was going to do this once but left it out because the shells used in the AA guns were at maximum strength and only used to quickly dispatch annoying aircraft. It would've ended up doing the same for everything else too.
A human player can shoot any type of shell, the AI will only shoot if they have the correct type of shell for the different kind of targets, also if the weapon controller is set to AAgun they'll only shoot to airplanes, if it's set to to cannon they'll shoot at both kind of targets only if they have the correct ammo.

Ref
__________________
ref is offline   Reply With Quote
Old 05-15-08, 09:42 AM   #8
Snaptrap
Eternal Patrol
 
Join Date: Oct 2007
Location: Alberta, Canada
Posts: 224
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by ref
A human player can shoot any type of shell, the AI will only shoot if they have the correct type of shell for the different kind of targets, also if the weapon controller is set to AAgun they'll only shoot to airplanes, if it's set to to cannon they'll shoot at both kind of targets only if they have the correct ammo.

Ref
That's interesting because I have no AA shells at all in my mod and the AI does just fine. Perhaps some other modification causing them to act that way even without AA shells.
Snaptrap is offline   Reply With Quote
Old 05-15-08, 09:42 AM   #9
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by ref
Quote:
Originally Posted by Snaptrap
Quote:
Originally Posted by ref
Try changing the weapon type from AAgun to Cannon in the weapon sim file, at least in sh3 as long as it has AP/HE and AA shells it opens fire on both surface and air targets.

Ref
Any shell type can be used for this. The important thing is that the Crew AI understands that the gun can be used on either surface or air targets. I was going to do this once but left it out because the shells used in the AA guns were at maximum strength and only used to quickly dispatch annoying aircraft. It would've ended up doing the same for everything else too.
A human player can shoot any type of shell, the AI will only shoot if they have the correct type of shell for the different kind of targets, also if the weapon controller is set to AAgun they'll only shoot to airplanes, if it's set to to cannon they'll shoot at both kind of targets only if they have the correct ammo.

Ref
Sounds like a good place to start. Main problem will be adding AA ammo and squaring that with real ammo types. Can AA ammo be added to a gun in the sim file as well?
__________________
-AKD
akdavis is offline   Reply With Quote
Old 05-15-08, 09:58 AM   #10
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by akdavis
Quote:
Originally Posted by ref
Quote:
Originally Posted by Snaptrap
Quote:
Originally Posted by ref
Try changing the weapon type from AAgun to Cannon in the weapon sim file, at least in sh3 as long as it has AP/HE and AA shells it opens fire on both surface and air targets.

Ref
Any shell type can be used for this. The important thing is that the Crew AI understands that the gun can be used on either surface or air targets. I was going to do this once but left it out because the shells used in the AA guns were at maximum strength and only used to quickly dispatch annoying aircraft. It would've ended up doing the same for everything else too.
A human player can shoot any type of shell, the AI will only shoot if they have the correct type of shell for the different kind of targets, also if the weapon controller is set to AAgun they'll only shoot to airplanes, if it's set to to cannon they'll shoot at both kind of targets only if they have the correct ammo.

Ref
Sounds like a good place to start. Main problem will be adding AA ammo and squaring that with real ammo types. Can AA ammo be added to a gun in the sim file as well?
Yes, open the sim file with s3d, and look into the wpn_Cannon controller in the ammo_storage section, you'll also need to look in the shells dat file for the Id numbers of the ammo.

Ref
__________________
ref is offline   Reply With Quote
Old 05-15-08, 11:24 PM   #11
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default

Well, partial success. Changing the id to cannon did in fact allow them to engage surface targets, but now they won't engage air targets. Added AA ammo to all guns as indicated above. And the positions sometimes go wonky and won't allow manual control anymore, only panning view around independent of the gun mount.

If I knew I could consistently man the 40mm/37mm myself, I'd just change those, but without being sure I can turn it against aircraft, that might not be a good idea.
__________________
-AKD
akdavis is offline   Reply With Quote
Old 05-16-08, 12:29 AM   #12
Snaptrap
Eternal Patrol
 
Join Date: Oct 2007
Location: Alberta, Canada
Posts: 224
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by akdavis
Well, partial success. Changing the id to cannon did in fact allow them to engage surface targets, but now they won't engage air targets. Added AA ammo to all guns as indicated above. And the positions sometimes go wonky and won't allow manual control anymore, only panning view around independent of the gun mount.

If I knew I could consistently man the 40mm/37mm myself, I'd just change those, but without being sure I can turn it against aircraft, that might not be a good idea.
That's because it's not the proper method. The actual steps to get the result you're looking for is more of a pain to explain than it is to do. At the moment I'm busy updating my mod, but I can hel you out when I'm done.

You don't need AA shells either because some of the AA guns don't come with AA shells and they still attack air targets. An anti-aircraft shell is just a type of shell, and is not an indication of what it's specifically designed for. The AI will use any round that is selected/highlighted.
Snaptrap is offline   Reply With Quote
Old 05-16-08, 12:52 AM   #13
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default

I should have said that I changed the weapon type to cannon, not the ID, if that caused any confusion. Any help would be appreciated, as I see that changing only the weapon type has all sorts of weird side effects.
__________________
-AKD
akdavis is offline   Reply With Quote
Old 05-16-08, 04:29 PM   #14
Snaptrap
Eternal Patrol
 
Join Date: Oct 2007
Location: Alberta, Canada
Posts: 224
Downloads: 0
Uploads: 0
Default

After looking through the files, I've concluded that the game won't accept more than one controller type per object. I've done things like adding another controller to a weapon with a secondary function and it won't take. Only one of the controllers are accepted at a time.

I imagine this can be done, but when trying the most simple possibilities, I'm guessing it's more work than it's worth. You're probably better off manning the gun yourself.

May I ask why you want this anyway?
Snaptrap is offline   Reply With Quote
Old 05-21-08, 12:47 PM   #15
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Snaptrap
After looking through the files, I've concluded that the game won't accept more than one controller type per object. I've done things like adding another controller to a weapon with a secondary function and it won't take. Only one of the controllers are accepted at a time.

I imagine this can be done, but when trying the most simple possibilities, I'm guessing it's more work than it's worth. You're probably better off manning the gun yourself.

May I ask why you want this anyway?
Oops, missed your answer here. Thanks for looking into it further.

Why: in the case of US submarines in the Pacific, the primary use of small arms and AA cannon on board the sub was not defense against aircraft, but in attacking in attacking boats and ships. I can't even bring to mind a single account of a 40mm being used on a sub with effect against a Japanese plane (no doubt there is one, however). But there are countless accounts of the 12.7mm/20mm/40mm weapons being used in conjunction with the deck gun (or sometimes alone if seas were to rough to man the deck gun) against Japanese shipping, especially coastal craft.

With U-boats, the AA guns were certainly far more important for defense against aircraft, but nonetheless, it was standard procedure to employ both the deck gun and the 37mm gun against a target during a surface (20mm weapons were to be used only with discretion).

But as it stands in SH, your AI gunners will not use any weapon other than the deck gun against an enemy ship. You can of course man an AA gun and use it against a surface target while the AI uses the deck gun, but if you have multiple AA guns, this still leaves some weapons totally unused in an engagement, plus you have to spend your time at the AA gun instead of captaining the ship from the bridge as is both proper and more realistic.

Now this doesn't really have a huge impact in the stock game, as the deck gun is so overpowered that you really need not worry about additional firepower. But if you play with a realism mod like Real Fleet Boat, the deck gun is toned way down, with long reloads and greatly reduced damage. Having all available weapons firing on a target under these circumstances can be decisive (and would be even more so with some improvements to damage models).

And all other considerations aside, it is just really awesome to observe from the bridge of your sub while all your weapons are being used at once against an enemy ship.
__________________
-AKD
akdavis is offline   Reply With Quote
Reply


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:14 PM.


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