SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH4 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=219)
-   -   [REL] AI launched torpedoes (https://www.subsim.com/radioroom/showthread.php?t=154068)

DarkFish 07-22-09 10:27 AM

[REL] AI launched torpedoes
 
UPDATED VERSION - NOW ABLE TO HIT MOVING TARGETS

Thought I'd better make it a new thread.
As the title suggests I've solved the problem of getting AI ships to fire torpedoes. The files available for DL are only the files needed to manually install them on ships, ships won't have them without some manual tweaking.

I've made a small vid showing an AI elco PT boat attacking a stationary Japanese merchant with 3 torpedoes:


http://i525.photobucket.com/albums/c...th_torpavs.jpg

Known bugs/issues:
- Torpedoes are relatively ineffective, about 4% hit rate @4000m distance.
- the torpedoes occasionally dive (much) too deep/too shallow, sometimes recovering after a certain distance.

and before anyone's gonna ask, no, the merchant is not to the north of the elco. WaterInteraction is great, but not so great for torpedoes:03:

DL Link: http://www.gamefront.com/files/21085853/AI_torps_rar

Installation:
- install manually or using JSGME, no files will be overwritten.
- Now for all ships you want to have torpedoes add a main armament node in its .dat file (in the .dat file - Data\Sea\Shipname\Shipname.dat, open using S3D - you'll find nodes called cfg#M01_NPT_Boat_A, cfg#M02_NPT_Boat_A etc. If the last one is for example called cfg#M04_NPT_Boat_A you must add a new one called cfg#M05_NPT_Boat_A)
- Make sure this node is placed well clear of the ship. Launching torpedoes from a node too close to the hull will lead to torpedoes scattering all over the place. Also rotate it into the direction you want torpedoes fired in as the torpedo launcher will only fire within 45 degrees to either side of this direction. I recommend an X-coordinate offset of at the very least 0,5 game units. If you see torpedoes heading for space it means the node is too close to the ship.
- now finally in the ships .eqp file add:
Quote:

[Equipment 6] ;one more than the previous
NodeName=M01 ;name of the node, if in the .dat file the node is called cfg#M05_NPT_Boat_A this should be 'M05'
LinkName=torpspawngun
StartDate=19380101
EndDate=19451231

Carotio 07-22-09 11:21 AM

Thanks for your effort and will to share. :yeah:

denis_469 07-22-09 12:50 PM

Thank you!

Hitman 07-22-09 01:12 PM

WOW ... and I mean WOW :o

Did you really do it? Amazing! :up:

Can you further explain how it works? I know what Racerboy and Sergbuto did to make the Ai torpedoes, but how does your mod work? Does the game really know it is launching torpedoes, or is it tricked to believe it is shooting shells or other things?

DarkFish 07-22-09 02:05 PM

Quote:

Originally Posted by Hitman (Post 1138604)
Can you further explain how it works? I know what Racerboy and Sergbuto did to make the Ai torpedoes, but how does your mod work? Does the game really know it is launching torpedoes, or is it tricked to believe it is shooting shells or other things?

It's a modified cannon shooting a dummy shell.
The trick is that I used the gunpowder cloud effect (the nice fire/smoke you see coming out of the barrel right after you shoot) to spawn a torpedo. This torpedo then heads into the direction the barrel pointed at. Unfortunately also the barrels elevation angle is copied by the torpedo. This is what causes the occasional deep/shallow running. Luckily within certain boundaries the torpedo can correct this, so I've set the max elevation angle of the gun to only 1 degree.

This mod certainly isn't perfect but it's a lot better than nothing.

keltos01 07-22-09 02:34 PM

WAOW !

Awesome, and I don't use that word often

[edit] with appropriate credits given, do you allow us to use it in the Japanese Campaign mod ?

keltos

DarkFish 07-23-09 06:04 AM

Quote:

Originally Posted by keltos01 (Post 1138691)
with appropriate credits given, do you allow us to use it in the Japanese Campaign mod ?

keltos

yes sure, feel free to use this:up:

The Fishlord 07-23-09 09:29 AM

Neat! I've always wanted this, midget subs in particular seemed useless without this. Now maybe approaching Japanese home waters on the surface near a port will be a little more dangerous...I hope this gets integrated into TMO 1.8 somehow.

Any chance of you releasing a pack of torpedo-armed ships?

keltos01 07-23-09 09:59 AM

Quote:

Originally Posted by DarkFish (Post 1138964)
yes sure, feel free to use this:up:

thanks a bunch ! :salute:

keltos

ivank 07-24-09 06:46 PM

No you didn't! Yes you did!! Great one!

DarkFish 07-25-09 01:10 PM

Quote:

Originally Posted by The Fishlord (Post 1139014)
Any chance of you releasing a pack of torpedo-armed ships?

not ATM. I'm too busy modding other things now. But I'm sure TSWSM will include some.
If someone else wants to add torpedoes to ships/subs, please go ahead, feel free to release them.

Nameless Bob 07-25-09 07:17 PM

stoopid question
 
I have very little knowledge about how things are modded so I'm definately a noobie but I can't help but wonder, would this method be able to spawn something else like an AI aircraft?If so it would sure be a quick and dirty way to get playable carriers to launch airplanes.:hmmm:

Sheer genius on the torpedo spawn method.:salute:

iambecomelife 07-26-09 02:27 PM

Great job! Can we adjust the torpedo speed, so that maybe the torpedoes will be useful against faster targets? I don't mind if they're ahistorically fast if it helps improve accuracy a little.

keltos01 08-03-09 05:58 PM

any more work done in the past 10 days ?

keltos

peabody 08-03-09 09:05 PM

Quote:

Originally Posted by DarkFish (Post 1138520)
Thought I'd better make it a new thread.
As the title suggests I've solved the problem of getting AI ships to fire torpedoes.

Known bugs/issues:
- All torpedoes are launched straight to the target and thus are only effective against stationary/slow moving targets.

Fantastic idea. Very clever.

Just a suggestion on the issue of stationary/slow moving targets. You have the Particle generator/object linked to the MK14. What about making one of the torpedos acoustic. (I know the cutie is already, but it is slow and underpowered for this use.) Wouldn't that solve the problem of accurate aiming for faster ships? You would still have to be "in the ballpark" or the acoustic wouldn't pick up the target. And then you could create missions with surface AI ships assisting an attack. Of couse I would put a rather small limit on the available ammo or it would keep shooting until everything is sunk.

Thanks for the great work.

Peabody


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