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

Reply
 
Thread Tools Display Modes
Old 06-19-11, 08:28 AM   #1
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default [TEC] AI actions and variables

I cant get rid of the idea of "wolfpacks" and interaction with them. So what do experienced modders say, what we would need for this to achieve? I thought of the triggered actions ai surface-boats are fullfilling, to take it as a kind of matrix. using it lets us make the ai u-boats "sending" special variables, which let the radio message system of the game sending you a radiomessage.



Thought: lets take the ai attack script as an example for interacting ai-uboats. If the ai surface boat sights a uboat, it is attacking, so a routine is called through the ai script. maybe it is possible to add another action into this script, same way as you can add controllers via s3d to different files. if we discover, what variables are used to get radio messages received (the function of the "radio message system"), we should be able to get the ai script sending messages, right? or not right?



I thought, if we are able to let our ai-uboats sending a radio message when encountering a convoi (containing the coordinates), the game would be a lot more realistic!

But first we need fully functional ai-uboats. As privateer said, they had some problems, as they are just cloned "surface units".

Any ideas and thoughts on that are very welcome!!!

__________________


urfisch is offline   Reply With Quote
Old 06-19-11, 08:55 AM   #2
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@urfish: nice to see your initiative. do you know where the AI (scripts) are located?
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 06-19-11, 09:01 AM   #3
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

i think the *.sim and the *.val files are what is used for the ai-behavior. but i am not sure. this thread is dealing with ai scripts in sh5: http://www.subsim.com/radioroom/showthread.php?t=171973
__________________


urfisch is offline   Reply With Quote
Old 06-19-11, 09:33 AM   #4
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

aircraft hasn't got *.val files, so the AI won't be in *.val.

and in the *.sim files I only find a reference name like cmdr_AIAirplane but no script or a statesmachine description.

Digging through the *.act files using OllyDbg, I found cmdr_AIAirplane in Sh3Sim.act, so I fear it's hardcoded.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 06-19-11, 11:25 AM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Only SH5 gives you the ability to define the AI behavior using scripts. SH3/4 is hardcoded for the AI routines.
TheDarkWraith is offline   Reply With Quote
Old 06-19-11, 12:50 PM   #6
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@TDW: Thanks for approving my suspicion.

I see two possible ways to get halfway working wolfpacks:

1) Hitmans idea: Somehow modify the airbases to allow them to spawn AI Uboats, which would mean wolfpack support based on your contact report. Start from the AI/code of the airplane (Maybe clone the AI in the memory and duplicate it but modified??) and invert the heights to negative values, so that altitude is changed for depth. With some studying, we could probably make the "inverted airplanes" come at high speed to the convoy and submerge (Instead of making an air dive) to shoot, then surface (instead of climb) to head away at high speed.

2) LGN1's idea: Teleport an convoy consisting of 3-4 Sergbutos AI-Subs to the area where you sent the contact report. This could be done with an Assembler hack. Maybe possible.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 06-19-11, 03:32 PM   #7
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

interesting ideas. even the ai thing seems to be hardcoded. but hardcode must not be a limit any more...or am i wrong?



just provocating..i know its a hard thing.

if i can help, let me know.
__________________


urfisch is offline   Reply With Quote
Old 06-19-11, 03:34 PM   #8
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Only SH5 gives you the ability to define the AI behavior using scripts. SH3/4 is hardcoded for the AI routines.
i know this is a fact. but is it a handicap for us to get wolfpacks acting? maybe you can help with your knowledge, tdw. i am sure, you can!

__________________


urfisch is offline   Reply With Quote
Old 06-19-11, 07:48 PM   #9
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

It is totally possible to 'strip' some things from other versions .act files
and plant them in SH3.

I tested doing this by 'stripping' the Air_Torpedos from SH4.
And adding a new .act file in the SH3 folder.
Added the needed controller from SH4 and it worked somewhat.
I never finished working the bugs out of the whole process because that was not what I was after and it proved what I wanted to know at that time.

What I wanted to know was simple.
It is possible to create new controllers for SH3?
The answer is Yes to an extent that I don't know.
The Air_Torpedos are not coded into the SH3 exe so why did they work?
Because the exe does not control everything.
It calls the .act files for things like that.
.act files are only .dll files with a fancy extension!
.dll files can be stripped down or built from scratch.
Write an AI_Sub.dll, rename it AI_Sub.act and create the needed controller for the .sim?
  Reply With Quote
Old 06-20-11, 12:55 AM   #10
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

I think, at first, you must creat AI_sub class for AI_sub unit (and your *.exe must "understand" this unit)... and then cmdr_AISub (as a combination of existing old controllers and new controller)... lol
__________________
Alex ®


Moses said: "Don't create yourself an idol"...

Last edited by Anvart; 06-20-11 at 01:38 AM.
Anvart is offline   Reply With Quote
Old 06-20-11, 01:40 AM   #11
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@privateer:

Thanks. I was aware that *.act are simply .dll files, since I already changed Sh3Sim.act and EnvSim.act to change e.g. torpedo reload and weather. These files also have an regular ModuleEntryPoint (DLLMain) that is called by the system loader at game load time, what is a nice place to add some executable code.

I also programed a separate hsie.act which was loaded successfully in order to overwrite some executable code of sh3.exe (Dll code injetion).

My problem is to completely understand and re-engineer how the AI works that is coded (probably) in Sh3Sim.act. I can find there the Strings cmdr_AIship & cmdr_AIAirplane, which could indicate that the AI is stored there. I also found huge jump-tables which could contain the addresses for the appropriate AI-routines. It will take long time to understand how they work and to change them to have something like cmdr_AISubmarine.

Importing from SH4 is a good point. Does SH4 have AI-Submarines?
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 06-20-11 at 02:02 AM.
h.sie is offline   Reply With Quote
Old 06-20-11, 02:05 AM   #12
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@Anvart: My problem: Too few knowledge regarding "controllers".
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 06-20-11, 03:14 AM   #13
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by h.sie View Post
...
Does SH4 have AI-Submarines?
No.
Quote:
Originally Posted by h.sie View Post
@Anvart: My problem: Too few knowledge regarding "controllers".
What do you mean?
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 06-20-11, 02:02 PM   #14
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

Quote:
Originally Posted by Anvart View Post
What do you mean?
I meant: I have too few overall knowledge about all necessary sh3 modding diciplines (controlllers, dat files, statesmachines) what caused me to hesitate to start working on wolfpacks. That cannot be done with a simple binary hack consisting of 3-4 lines of assembler. This needs concentrated knowledge of more than one person - teamwork. I don't like teamwork.
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 06-20-11 at 03:42 PM.
h.sie is offline   Reply With Quote
Old 06-20-11, 02:10 PM   #15
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by h.sie View Post
I don't like teamwork.
There are others like me I prefer to work alone also. Always have and always will
TheDarkWraith 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 12:23 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.