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 01-21-11, 04:36 AM   #1
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default [REQ] AI submarine tutorial needed

I want to make AI submarines and insert them ingame, can anyone post a tutorial on how to do that in here please ?

I never fiddled with that side of the game...


thanks

keltos
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Old 01-21-11, 03:03 PM   #2
peabody
Admiral
 
Join Date: Jan 2008
Location: New York State, USA
Posts: 2,390
Downloads: 126
Uploads: 7
Default

Quote:
Originally Posted by keltos01 View Post
I want to make AI submarines and insert them ingame, can anyone post a tutorial on how to do that in here please ?

I never fiddled with that side of the game...


thanks

keltos
The short answer, clone it and make it a ship in the .sim file. That will make it a ship you can test. Then deal with the other changes after it works.
Peabody
__________________

System Spec: Gigabyte GA-965P-DS3, PentiumD Dual Core Presler 945 3.4Ghz, Gigabyte Geforce 7600GS, 2-1GB Corsair XMS2 800Mhz in Dual Channel, 2-WD 250 SATA 3Gb/s, Onboard Realtek HD 7.1 Audio, DVD ROM, DVD burner, Hiper 580 Watt Power supply, WinXP SP2.

peabody is offline   Reply With Quote
Old 01-21-11, 04:37 PM   #3
Ducimus
Rear Admiral
 
Ducimus's Avatar
 
Join Date: May 2005
Posts: 12,987
Downloads: 67
Uploads: 2


Default

Most importantly, you must remove all nodes and equpiment that is also used by the player. So you'll need to clone the equpiment remap the ID's and rename the nodes too. The game has issues with trying to instantiate nodes and equipment if its in use by both the AI and the player at the same time. You'll see weird things happen , like all dials in the control room stuck in the 12 O clock position. The kick in the jimmy is this wont happen all the time - shennaingans only manifest themselves when the game tries to render the AI sub. If the player doesn't get close enough to the AI sub for the game to render it, you'll never see the problem until way later.

Also, don't forget the smaller, lesser used nodes too. Like a TAR node for instance. That one kicked me in the crotch.

edit: (I find myself wondering if i renamed the CT and deck gun nodes or not now. I must have.... i think...... did i need to? I don't remember.)
Ducimus is offline   Reply With Quote
Old 01-21-11, 05:10 PM   #4
polyfiller
Weps
 
Join Date: Sep 2005
Posts: 359
Downloads: 43
Uploads: 0
Default

Actually you don't need to make it a ship .... if you do, when you spot / detect it, you get the wrong message i.e. "enemy warship spotted" or whatever.

I've made a whole collection of AI subs for TSWSM (for many different depths basically) and it's quite easy.

1) Clone an existing sub model and make sure you do the remap Id's thingy in S3D. When I say clone .... I mean clone and make sure the new unit is in /data/submarine.

2) You can delete all files in the cloned subs folder apart from the textures and the .dat .sim .val .eqp .sns .dsd and .zon. The other files (UPC etc) are only needed for human controllable sub.

3) Open the cloned subs .sim file and delete the nodes cmd_aihumansub and specialabilitiesctrl.

4) Open an AI ship file and copy a cmd_aiship node and past into the new cloned subs file or add the controller manually if you are that competent with S4d. Important - LEAVE the unit submarine definition in the .sim file.

5) replace the contents of the .cfg file in the submarines folder with something like this. i.e. strip out all the human playable content ... you only need this stuff really;

[Unit]
ClassName=AI_Uboat7c_7
UnitType=202
MaxSpeed=17.0
MaxSpeedSubmerged=7.6
Length=67.4
Width=5.3
Draft=7
Displacement=1500
RenownAwarded=200

6) Now setup a new roster file in the \data\roster\country\submarine like this, but modify the appropriate values (name, folder etc.

[UnitClass]
ClassName=AI_Uboat7c_7
UnitType=202;102
AppearanceDate=19391130
DisappearanceDate=19451227
DisplayName=U Boat

[Texture 1]
TextureName=data/Submarine/AI_Uboat7c_7/AI_Uboat7c_7_T01.tga
LightmapTextureName=data/Submarine/AI_Uboat7c_7/AI_Uboat7c_7_O01.tga
NormalmapTextureName=data/Submarine/AI_Uboat7c_7/AI_Uboat7c_7_N01.tga
StartDate=19380101
EndDate=19451231
Frequency=1

[Unit 1]
Name=U239
DOC=19391130
DOD=19411122

Note how the classname match in the etnires at the top of the roster cfg file and the submarine.cfg file. Also I tend to use folders which match the classname. Also not the unit type is 202 (anything 2xx is a submarine). This is what causes the game to say "submarine spotted" and also makes the game look in the data\submarine and data\roster\countryname\submarine folders for the relevant files.

I wrote this from memory so may have forgotten something.

Give it a try and let me know.

If you want to make the Ai submarine more agressive, you will need to make it a ship (different from above) ..... but if so, let me know and I'll reply with instructions.

Good luck.
polyfiller is offline   Reply With Quote
Old 01-21-11, 05:13 PM   #5
polyfiller
Weps
 
Join Date: Sep 2005
Posts: 359
Downloads: 43
Uploads: 0
Default

Damn .... almost forgot..... let me know if the sub you want AI controlled is to be cloned from a sub which uses a unitpart. conning tower, or if the conning tower is included in the core .dat.

This makes a bit of a difference, dependant on if you have any surfaced used weapons you want it to use. If so, you have to iopen the conning tower object and paste it into the main subs .dat and do a littel re-naming of A01 nodes etc to allow guns to be mounted.

Also forgot to add, set the sub up to work on the surface and if you want it submerged, do that later once everything is as required and just change the surfaced draft in the .sim to the depth you want it to have.
polyfiller is offline   Reply With Quote
Old 01-25-11, 10:45 AM   #6
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

got it working somehow

but no tower ? my tower is in the Objects\Turm_AIClass600

keltos
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Old 01-25-11, 11:07 AM   #7
polyfiller
Weps
 
Join Date: Sep 2005
Posts: 359
Downloads: 43
Uploads: 0
Default

Add the tower to the main submarine .dat file and don't forget to add the textures it uses also. You will then need to rename the A01 A02 nodes etc ... the ones in the human playable version don't allow equipment to be mounted for an AI ship.
polyfiller is offline   Reply With Quote
Old 01-25-11, 12:32 PM   #8
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

so a separate tower as for the playable subs doesn't work right ?

also : how do I include it in a campaign (wdad not to mention it) ?

thanks

keltos
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Old 01-25-11, 02:22 PM   #9
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

I used Lurker's PTvirtualtorpedo on board my Adua AI sub..

gosh that hurt !

did you ever take a look at it polyfiller ?


it's in Library\guns_torp.dat and .sim

linked to shell_torp.dat which is a 21 inch shell and has the zon value of a torpedo with hitpoints from 120 -180 ap 100 radius 7-10


I would like to see the torpedo.. maybe we can add its model somehow ?


we don't see the torp coming but the explosion is tremendous !


sank me with 2 hits...

keltos
__________________
"Honorable Builder of Sinking Ships"


Last edited by keltos01; 01-25-11 at 02:34 PM.
keltos01 is offline   Reply With Quote
Old 01-25-11, 08:40 PM   #10
peabody
Admiral
 
Join Date: Jan 2008
Location: New York State, USA
Posts: 2,390
Downloads: 126
Uploads: 7
Default

Quote:
Originally Posted by polyfiller View Post
Actually you don't need to make it a ship .... if you do, when you spot / detect it, you get the wrong message i.e. "enemy warship spotted" or whatever.

I've made a whole collection of AI subs for TSWSM (for many different depths basically) and it's quite easy.



4) Open an AI ship file and copy a cmd_aiship node and past into the new cloned subs file or add the controller manually if you are that competent with S4d. Important - LEAVE the unit submarine definition in the .sim file.
I agree you can make an AI unit that the game will still show as a submarine, but as you show in step 4 you are creating an AI Ship. So it is simply a difference in wording. There is no cmd_aisub available, so you must make it an cmd_aiship or it will not work.
So I agree the game will see it as a sub, but to make it work as AI you must make it a ship. So it is the same as a 'Destroyer" is an aiship, a sub that works as AI is also an 'aiship'.
That is what I meant by making it a ship.

Peabody
__________________

System Spec: Gigabyte GA-965P-DS3, PentiumD Dual Core Presler 945 3.4Ghz, Gigabyte Geforce 7600GS, 2-1GB Corsair XMS2 800Mhz in Dual Channel, 2-WD 250 SATA 3Gb/s, Onboard Realtek HD 7.1 Audio, DVD ROM, DVD burner, Hiper 580 Watt Power supply, WinXP SP2.

peabody is offline   Reply With Quote
Old 01-26-11, 03:41 AM   #11
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

Here goes the first workable version :




3d model by JU_88 and Ref of GWX 3.0 for SHIII

Italian 600 Class Adua submarine (AI)



my only problem is the single mission I ship with the mod : everytime I try it it's night, even though I changed the starttime with the editor and saved the mission. I don't have a clue here, peabody help !



here is the workable version of my AI Adua submarine for WDAD :

http://www.mediafire.com/file/44py5w...Adua%20v1.1.7z



as she uses Lurker's PTvirtualtorpedo from WDAD instead of a DG she only works with WDAD, beware of incoming torpedoes !

also : I had set another submerged sub around but even when you spot the periscope at 1000 y you can't lock... sank it with asdic angle and range

hope you like it

keltos
__________________
"Honorable Builder of Sinking Ships"

keltos01 is offline   Reply With Quote
Old 01-26-11, 03:35 PM   #12
peabody
Admiral
 
Join Date: Jan 2008
Location: New York State, USA
Posts: 2,390
Downloads: 126
Uploads: 7
Default

Quote:
Originally Posted by keltos01 View Post

my only problem is the single mission I ship with the mod : everytime I try it it's night, even though I changed the starttime with the editor and saved the mission. I don't have a clue here, peabody help !
keltos
I don't have WDAD installed at the moment to check this, but I don't quite understand the problem.

You have two missions installed, I assume you are talking about the "Italian Sub" mission? If so, it is set to start at night.

[Mission]
MissionType=0
MissionDataType=0
MultiMissionType=0
Year=1944
Month=11
Day=17
Hour=21
Minute=30

Even your mission briefing states: "It is 2130 on November 17th 1944", that is night. (9:30 PM)

So you say it always starts at night, it is set to start at night, so I don't understand the problem, unless you meant it always starts in the daytime.

If you want it to start in the daytime, you need to change the time in the "Mission/Parameters" menu not in the sub's start time.

Peabody
__________________

System Spec: Gigabyte GA-965P-DS3, PentiumD Dual Core Presler 945 3.4Ghz, Gigabyte Geforce 7600GS, 2-1GB Corsair XMS2 800Mhz in Dual Channel, 2-WD 250 SATA 3Gb/s, Onboard Realtek HD 7.1 Audio, DVD ROM, DVD burner, Hiper 580 Watt Power supply, WinXP SP2.


Last edited by peabody; 01-26-11 at 03:54 PM.
peabody is offline   Reply With Quote
Old 01-26-11, 05:00 PM   #13
keltos01
Silent Hunter
 
Join Date: Feb 2008
Location: Milan Italy
Posts: 4,999
Downloads: 114
Uploads: 18
Default

thanks peabody !!

keltos
__________________
"Honorable Builder of Sinking Ships"

keltos01 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 03:56 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.