Log in

View Full Version : [needed] how do you make an AI submarine ?


keltos01
09-05-10, 06:34 AM
I'd like to add a sub as an AI one, so as not to be so lonely outthere, does anyone know how ?

keltos

Hitman
09-05-10, 06:46 AM
IIRC it's the same process as for creating any other AI ship, you are in fact creating a DD with the looks and armament of a submarine (Except the torpedoes). Clone a DD, modify all IDs and use the submarine model.

keltos01
09-05-10, 08:18 AM
never done that before !

Hitman
09-05-10, 08:45 AM
AFAIK it's done the same as what you did to clone the cachalot from the Perch, but with an AI unit.

EDIT:

Are you really keltos?

Who are you?

And what did you do with his body?

I should call the police! :stare:


j/j ..... :haha:

tater
09-05-10, 09:22 AM
Can't you just place any sub in the mission editor, and not check the "player sub" box?

That's what you'd do to place subs in port, for example.

keltos01
09-05-10, 10:34 AM
AFAIK it's done the same as what you did to clone the cachalot from the Perch, but with an AI unit.
done
EDIT:

Are you really keltos?
yes
Who are you?
keltos
And what did you do with his body?
deep sixed it why ?
I should call the police! :stare:
you have no proof ;) :O:

j/j ..... :haha:

ok that's done, it's now AI_L55, now to try if it works in a singlemission..

Thanks to Lou and Dagon for letting me use it :up:

Keltos

peabody
09-05-10, 12:26 PM
ok that's done, it's now AI_L55, now to try if it works in a singlemission..

Thanks to Lou and Dagon for letting me use it :up:

Keltos

You can do it Hitman's way but there is a much easier way to do it. I am assuming you are starting with a 'playable' sub? (actually it does not need to be a playable sub, the process is the same)

Clone the sub, same as you would any other sub, then in the .sim file make it a ship. It will follow waypoints and shoot guns at you. But to put men on deck the normal "DeckWatch" crew will not work. As you will note in the Sea folder, ships don't have upc/upcge files. So you would put P01 nodes (I think, it has been a while) to place men on it.

If you do as Hitman suggests it will work, but you have to deal with changing all the guns, men, 3D model for rudders and propellers etc, the 3D damage won't be right etc. It is just much harder to do.

Tater's way you can use it as eye candy in a port, but it won't go anywhere and will not shoot at you. So it depends what you want to do with it. In fact Tater's way you don't have to clone it since it will not conflict with another sub of the same kind. If you put one in with a speed it will move a short distance, but if you check, you will find the propellers are not turning, so it will eventually come to a stop.

So as I stated it depends what you want it for.

Peabody

Madox58
09-06-10, 08:35 PM
I'll agree to all the above except you don't need to name the nodes P0x
Any name for a node will do.
They are after all just placement nodes and care less about what you call them.
They are only used in the manor they are to make things easy to follow
when working on stuff at build time.

And to make another thing very clear?
AI Subs done as Ships in the sim file can be made to dive!
I never finished the final work on this as GWX priorities at that time,
demanded I put that work aside.

I am back into that work for several reasons now.
:03:

rein1705
09-06-10, 08:45 PM
all you smart people talking your smartness.... but i'll add that i would love to have a companion sub that might follow and work with you or accept recon orders or.... give you fuel and stores while on long missions would be great!:yeah:

peabody
09-06-10, 08:47 PM
I'll agree to all the above except you don't need to name the nodes P0x
Any name for a node will do.

:03:

I agree, just that is was easier to explain what I meant since they know what a "normal" P01 node is on a ship.

And I will be the first to admit you know 1.000 times more about this than I do.....Someday I will tell you something you don't know......I just don't feel like doing it today. :O:

Peabody

tater
09-06-10, 09:54 PM
Some of the nodes do seem to have specific, hard-coded functions. The K node, for example. Changing them is trivial inS3d so why not make it consistent

Ducimus
09-07-10, 03:22 PM
Skimmed through the thread, sounds like other have pretty much covered it. Though i'll add:

- It is VITAL that the AI subs do not use ANY of the same sensory nodes, equipment, etc that the player uses. AT ALL, EVER. Not even a TAR node. (you'll know this happen if you notice all the dial needles stuck in the 12 O'clock position in the interior. Possibly super large file sizes for save games too, like 500 MB saves)

- You'll need to redo damage zones so they sink correctly. Admittidly, i cheesed, and just changed one zone into a BB keel zone and ran it the length of the boat. Does the job, but certainly not elegant.

keltos01
09-08-10, 08:45 AM
And to make another thing very clear?
AI Subs done as Ships in the sim file can be made to dive!
:03:

How ??? pm me if you don't want this public knowledge

keltos

peabody
09-08-10, 01:48 PM
Skimmed through the thread, sounds like other have pretty much covered it. Though i'll add:

- It is VITAL that the AI subs do not use ANY of the same sensory nodes, equipment, etc that the player uses. AT ALL, EVER. Not even a TAR node. (you'll know this happen if you notice all the dial needles stuck in the 12 O'clock position in the interior. Possibly super large file sizes for save games too, like 500 MB saves)

- You'll need to redo damage zones so they sink correctly. Admittidly, i cheesed, and just changed one zone into a BB keel zone and ran it the length of the boat. Does the job, but certainly not elegant.

I did play with the zones on the two I made. They were sinking like helium balloons. And a minimum of two torpedoes to sink them. So that part I do understand.

I did NOT know about the sensory nodes, equipment etc. Now mine were the Porpoise and the Tambor, and Keltos used German subs to create the IJN subs. Do you know if this will encounter the same problems? I am not asking you to test it, only if you know the answer. I didn't notice any problems with dial in the sub not working. Possibly because we are using German "equipment" ??? I will check the file sized the next time I have them loaded in the game.
The other question is you say the "same Sensory nodes", does that mean we have to rename the node. for example change the H01 to F01 or we have to actually remove the Hydrophones from the sub, and use 'ship' equipment instead of 'sub' equipment?
There is so much I need to learn, thank you for the information. I NEVER would have figured that one out.
In fact if you are busy (you are always busy!!!) I can check your AI sub in TMO and see what you did and maybe figure out at least some of it.

Thanks again for the information.

Peabody

Ducimus
09-08-10, 03:10 PM
How ??? pm me if you don't want this public knowledge

keltos

I know you can make a submerged and surfaced version of the same submarine. Just set its draft to run below the surface. (sim and/or cfg file tweaks, i forget). You can also make "fake" torpeo's too. Clone a new gun, make it invisible. Take the node for this gun mount on the parent object and offset it so its above the surface. Tweak the gun's rotation and reload specs, and there you go. Someone thought this up way back in the day in SH3, i forget who. Anywho I should probably get off my lazy as and do this at some point.


I did NOT know about the sensory nodes, equipment etc. Now mine were the Porpoise and the Tambor, and Keltos used German subs to create the IJN subs. Do you know if this will encounter the same problems?

The problem comes when the game has to instantiate two player objects at the same time. (parent or child objects). If your using it, and the game has to start a new instance of it while it's in use, the game gets confused i guess. Now mind you, the game has to start the instance for the error to occur. Just having it in the campaign files isnt enough.

You can totally clone the player object in every detail, but the game won't have a tizzy, UNTIL IT TRIES TO RENDER IT. (usually within 30 KM or so.). Which makes tracking down this error really hard. Sometimes there was an AI sub around and you didn't know it. Lucky for you, others have already done hours of this: ( :damn: :damn: :damn: ) so you don't have to. :salute:


The other question is you say the "same Sensory nodes", does that mean we have to rename the node.

No, I meant if its an AI object, you should use AI sensors. If your watch crew is using something like "crewWatchVisual" and the AI is using "AI_visual", then use "AI_Visual". Same for radar and hydrophones, etc.

edit: Some nodes are player specific and never used by the AI. TAR node for example. I mention this specifically because it was giving me issues. I let this one node slip by not realizing the game was trying to insantiate two instances of this player specific node. (its for submarine coatings)

Madox58
09-08-10, 06:36 PM
How ??? pm me if you don't want this public knowledge

keltos


I tried to send you a PM.
Your message box is full.

Madox58
09-08-10, 07:10 PM
I agree, just that is was easier to explain what I meant since they know what a "normal" P01 node is on a ship.

And I will be the first to admit you know 1.000 times more about this than I do.....Someday I will tell you something you don't know......I just don't feel like doing it today. :O:

Peabody

Mate,
I did not intend to imply I know more then you.
And I highly doubt I know 1,000 time more then you about the files.
If you took it that way?
I'm sorry.
I actually have high regards for you and your work.
And I'm always open to being schooled on things!
I do not know it all.
And if I come off that way?
Just slap me down.
:up:

Regards

peabody
09-08-10, 08:50 PM
Mate,
I did not intend to imply I know more then you.
And I highly doubt I know 1,000 time more then you about the files.
If you took it that way?
I'm sorry.
I actually have high regards for you and your work.
And I'm always open to being schooled on things!
I do not know it all.
And if I come off that way?
Just slap me down.
:up:

Regards

Totally joking!!!! I did not take it "that way".

You do know more than I do. I was just making a failed attempt at humor.
Like the "tell you something but not today" I can't think of anything I could tell you. :hmmm:
That the part I don't like about forums...it's hard to tell when someone is joking or upset. No hard feeling what so ever. You did not come across as "implying you know more". I took it as challenging to me to figure it out.

Peabody

peabody
09-08-10, 08:56 PM
The problem comes when the game has to instantiate two player objects at the same time. (parent or child objects). If your using it, and the game has to start a new instance of it while it's in use, the game gets confused i guess. Now mind you, the game has to start the instance for the error to occur. Just having it in the campaign files isnt enough.

You can totally clone the player object in every detail, but the game won't have a tizzy, UNTIL IT TRIES TO RENDER IT. (usually within 30 KM or so.). Which makes tracking down this error really hard. Sometimes there was an AI sub around and you didn't know it. Lucky for you, others have already done hours of this: ( :damn: :damn: :damn: ) so you don't have to. :salute:



No, I meant if its an AI object, you should use AI sensors. If your watch crew is using something like "crewWatchVisual" and the AI is using "AI_visual", then use "AI_Visual". Same for radar and hydrophones, etc.

edit: Some nodes are player specific and never used by the AI. TAR node for example. I mention this specifically because it was giving me issues. I let this one node slip by not realizing the game was trying to insantiate two instances of this player specific node. (its for submarine coatings)

Thanks, I think I get it now. And I thank you guys for "doing hours of this" so I don't have to.
I usually do hours of something and end up empty handed. I think it should work but for some reason it doesn't. Sometimes the light comes on but a lot of times it doesn't. (and it's only a 25watt light so it's not too bright.)

Peabody

Madox58
09-08-10, 09:39 PM
peabody,

I still doubt I know much more then you.
I just look at things a bit differently then many do.
People tend to get to serious and define things as a set standard.
Then they never push the bounds.
So if they believe a P0x is for placeing people?
They may never make the leap that most nodes are pretty much null.
(Yes, The K node is cargo placement but is interchangable)
And as Ducimus posted,
Watch the nodes when switching a Sub to an AI Unit with a Ship controller.
Also watch the zon file.
In GWX, We had to create new zones for AI Subs.
That was after massive testing.
ref created the base damage model for the AI Subs.
Testing showed a problem.
I re-tested and adjusted to solve the problem.
Team work!
:up:

tater
09-08-10, 10:27 PM
I tend to think in terms of compatibility as well. There are unused node names you could always use for random stuff. I like using the nodes as defined for others that may mod my mod :)

That way they just look and know what is at which point. A looong time ago I was using whatever node was handy to place guns, etc :)

keltos01
09-09-10, 02:43 AM
In GWX, We had to create new zones for AI Subs.
That was after massive testing.
ref created the base damage model for the AI Subs.
Testing showed a problem.
I re-tested and adjusted to solve the problem.
Team work!
:up:

would you have such a model for us to use ? with due credits of course !

keltos

tater
09-09-10, 08:20 AM
There are AI subs in TMO and RSRDC you could clone, then replace the hulls, etc.

tater
09-10-10, 09:42 AM
Hey, I have an interesting idea.

Yeah, AI subs can dive and even shoot some sort of fish (faked or not).

How do they behave as AI, however? Do they maneuver, or do they merely shoot at you, but follow waypoints?

One possible thing to try is to set them as some sort of escort. Ie unit type 0-4. If your campaign uses random escorts, pick one type that is unused, ideally.

Now you have an AI sub that will hunt you, even underwater.

peabody
09-10-10, 11:40 AM
Hey, I have an interesting idea.

Yeah, AI subs can dive and even shoot some sort of fish (faked or not).

How do they behave as AI, however? Do they maneuver, or do they merely shoot at you, but follow waypoints?

One possible thing to try is to set them as some sort of escort. Ie unit type 0-4. If your campaign uses random escorts, pick one type that is unused, ideally.

Now you have an AI sub that will hunt you, even underwater.

In my somewhat limited testing, they did shoot at me if I was surfaced. But they did not 'attack/hunt' me. In fact just the opposite, they would follow waypoints until we engaged and then they would evade me, usually turning away. They would definately evade torpedoes by turning or changing speed.
Peabody

keltos01
09-10-10, 12:29 PM
In my somewhat limited testing, they did shoot at me if I was surfaced. But they did not 'attack/hunt' me. In fact just the opposite, they would follow waypoints until we engaged and then they would evade me, usually turning away. They would definately evade torpedoes by turning or changing speed.
Peabody

they could be equipped with a torpedo launcher like the one from Battle for the baltic ?

keltos

tater
09-10-10, 02:09 PM
I have been rereading War in the Boats and his description of being shadowed by an IJN sub near Guadalcanal got me thinking. Ruhe makes the point that their task in pigboat 37 was "blockade" and that this was a stupid use of a sub since the IJN steered around where they knew a sub was. He suggests that such missions given to IJN subs was similarly ineffective.

Sort of OT, but since the IJN tried to cordon off areas to very poor effect, I dunno how you deal with this in a SH4 campaign. In Sh4, there is no dynamism AT ALL (contrary to sales pitches). So there is no way for USN traffic to be steered around cordons. As a result, an IJN player could easily do far, far better than RL. Assuming you want something closer to reality, it might be best to put really aggressive ASW patrols around US bases pretty far, so IJN subs cannot wait someplace close ashore where they'll be presented with zillions of targets.

Another thought I've always wanted to add... fratricide.

S-37 was unsure whether one sub spotted was IJN or S-41 from the neighboring patrol area. Getting fired on by a friendly was without question a very real possibility. It would be neat to add this somehow.

Madox58
09-10-10, 05:35 PM
would you have such a model for us to use ? with due credits of course !

keltos

GWX 3 has all the files and info.
Special zones were created for the AI Subs
and damage models adjusted to use them on each AI Sub.
I can send you the zone.cfg and one of the AI Subs files to look at if you wish.
Any permissions and such needs to go to Jimbuna,
if you wish to use the files in future mods.
I really don't see any problems in that area.