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 01-06-21, 04:18 AM   #1
John Pancoast
Ocean Warrior
 
Join Date: Apr 2002
Location: Minnysoda
Posts: 3,162
Downloads: 488
Uploads: 4


Default SH3 Commander questions

In an effort to liven up the brain dead escort behavior and affect some other things I've started to add items to the randomization file.
Can't grasp a few instructions though. Looked at examples in the file, googlized a bunch. Still confused.

1. In the instructions at the top of the randomization.cfg file it states from the "ChooseFrom" section "Set ChooseFrom to equal the number of different sets of data, or a higher number if you want to simulate percentage chance" Percentage chance of what ?

2. Some of the entries will have a header string "X% randomization" along with the "higher number representing a percentage chance" from #1 above.
What does that mean ?
__________________
"Realistic" is not always GAME-GOOD." - Wave Skipper

Last edited by John Pancoast; 01-06-21 at 04:27 AM.
John Pancoast is offline   Reply With Quote
Old 01-06-21, 07:04 AM   #2
J0313
Grey Wolf
 
Join Date: Nov 2010
Location: Texas
Posts: 866
Downloads: 1755
Uploads: 0
Default

Quote:
Originally Posted by John Pancoast View Post
In an effort to liven up the brain dead escort behavior and affect some other things I've started to add items to the randomization file.
Can't grasp a few instructions though. Looked at examples in the file, googlized a bunch. Still confused.

1. In the instructions at the top of the randomization.cfg file it states from the "ChooseFrom" section "Set ChooseFrom to equal the number of different sets of data, or a higher number if you want to simulate percentage chance" Percentage chance of what ?

2. Some of the entries will have a header string "X% randomization" along with the "higher number representing a percentage chance" from #1 above.
What does that mean ?
I think Sailor Steve is the guy that needs to see your question. He knows alot about SH3 Commander. IIRC
J0313 is offline   Reply With Quote
Old 01-07-21, 04:50 PM   #3
LGN1
Ace of the Deep
 
Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
Default

Hi John,


SH3 Commander chooses with equal probability one number between 0 and the number of choose from. If the number is higher than the numbers you have given values to, then nothing is changed. With this you can adjust the probabilities for the different events.


Here's an example: You have a variable xABCD that has a value of 1 in the game. Now you would like to have that the variable stays equal 1 with a 50% chance, but with 25% probability changes to 2 and with 25% probability to 3.



In this case you set 'ChooseFrom=4' (because then every event has a 25% probability) and


0_xABCD=2
1_xABCD=3


Given this SH3 Commander changes the value to 2 if 0 is chosen, to 3 if 1 is chosen and does nothing if 2 and 3 are chosen.


You could achieve the same with:


0_xABCD=2
1_xABCD=3
2_xABCD=1
3_xABCD=1


I hope this is clear. If not please ask.


Best, LGN1
LGN1 is offline   Reply With Quote
Old 01-07-21, 05:44 PM   #4
John Pancoast
Ocean Warrior
 
Join Date: Apr 2002
Location: Minnysoda
Posts: 3,162
Downloads: 488
Uploads: 4


Default

Quote:
Originally Posted by LGN1 View Post
Hi John,


SH3 Commander chooses with equal probability one number between 0 and the number of choose from. If the number is higher than the numbers you have given values to, then nothing is changed. With this you can adjust the probabilities for the different events.


Here's an example: You have a variable xABCD that has a value of 1 in the game. Now you would like to have that the variable stays equal 1 with a 50% chance, but with 25% probability changes to 2 and with 25% probability to 3.



In this case you set 'ChooseFrom=4' (because then every event has a 25% probability) and


0_xABCD=2
1_xABCD=3


Given this SH3 Commander changes the value to 2 if 0 is chosen, to 3 if 1 is chosen and does nothing if 2 and 3 are chosen.


You could achieve the same with:


0_xABCD=2
1_xABCD=3
2_xABCD=1
3_xABCD=1


I hope this is clear. If not please ask.


Best, LGN1

Hi LGN1,
Really appreciate the reply; your knowledge will be a big help. Lots of questions.
I understand the examples you made but here's where I get confused. One of the malfunction options, just chosen at random.

[Mal1:data\Library\Cameras.dat]
;1940 10% randomization <---- I take it this is just a comment line ?
ApplyToPeriod=19400101|19411231
ChooseFrom=90 <---How does 90 equate with the 24 items below ? I can't figure it out with the 10% randomization.
RndMidPat=1

0_x2ECD=20 ;Attack Periscope Drops duration[4]
0_x2EE2=20 ;Attack Periscope Blur duration[3]
1_x2ECD=37
1_x2EE2=37
2_x2ECD=60
2_x2EE2=60
3_x2ECD=3600
3_x2EE2=3600

4_x2ECD=37
4_x2EE2=37
4_x2AFC=18 ;Obs Periscope Drops duration[4]
4_x2B11=18 ;Obs Periscope Blur durarion[3]

5_x2ECD=3600
5_x2EE2=3600
5_x2AFC=18
5_x2B11=18

6_x2ECD=20
6_x2EE2=20
6_x302F=1.5 ;Zoom
6_x304E=1.5 ;Zoom

7_x302F=1.5
7_x304E=1.5

8_x302F=6.0
8_x304E=6.0

And as long as I have your attention , I found this post of yours in my searches and have a question about it too.(and really like the idea/damage report idea vs. hex offsets).

https://www.subsim.com/radioroom/sho...d.php?t=158782

Using this example at random, why does the MnID have to also be used vs. only the Key part of a command ?:

;----------Bold decoy failure begin-----------------------------------
[0:data\Cfg\Commands_en.cfg]
;Bold decoy is not working
;Chance: 10%
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1

0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command
;No warning. You only know after trying.


[0:data\Cfg\Commands_de.cfg]
ApplyToPeriod=19390101|19450508
ChooseFrom=10
RndMidPat=1

0_Cmd200|MnID= ; Empty MnID
0_Cmd200|Key0= ; Empty command

Hope all is well,
John
__________________
"Realistic" is not always GAME-GOOD." - Wave Skipper

Last edited by John Pancoast; 01-07-21 at 05:54 PM.
John Pancoast is offline   Reply With Quote
Old 01-08-21, 05:18 PM   #5
LGN1
Ace of the Deep
 
Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
Default

Hi John,


yes, a semi-colon at the beginning of a line is for comments.


To understand your example you have to know that you can change more values in a file with one 'set'/'block'. A 'set'/'block' is indicated by the 0_.... 1_.... , ....


You can see the numbers 0_... to 8_... in your example. That means you have nine possible 'sets'/'blocks' which all change more than one variable (up to four variables). Nine (0,...,8) possible choices with ChooseFrom=90 means that every 'set'/'block'/event gets a 10% probability.


As you can see the file is quite powerful. Actually, the only thing that is missing is that you could change parameters in different files in a coordinated/correlated way. That would allow you, e.g., to change values in a *.dat file and change the menu....txt in order to have a message appearing.


I hope this is clear.


Concerning your MnID question: I don't remember exactly, but I guess that I wanted to also disable the button in the GUI so that the player cannot use the GUI to still trigger the order.


Best, LGN1
LGN1 is offline   Reply With Quote
Old 01-08-21, 06:11 PM   #6
John Pancoast
Ocean Warrior
 
Join Date: Apr 2002
Location: Minnysoda
Posts: 3,162
Downloads: 488
Uploads: 4


Default

Ah, makes perfect sense now ! My error was thinking in terms of individual lines vs. blocks.
One other: the numbers [4] and {3] in my example after the "Attack Periscope Drops duration", etc. What are they describing ?
Yes, I'm just realizing the powerful ability of the program's functions. Have changed a few minor things in the game already with it but this opens up all kinds of possibilities.
Been using TimeTraveler's old program for the hex offset information.

Also appreciate the information about your commands.cfg editing. Makes sense.

Best,
John
__________________
"Realistic" is not always GAME-GOOD." - Wave Skipper
John Pancoast is offline   Reply With Quote
Old 01-09-21, 12:46 AM   #7
FUBAR295
Krusty Krab
 
FUBAR295's Avatar
 
Join Date: Mar 2002
Location: Decks awash in the North Atlantic
Posts: 1,248
Downloads: 428
Uploads: 0
Default

Thank you both for a interesting thread. This has inspired me to work on a message project I was thinking about. Some of what is here will be very useful.

Good hunting,
FUBAR295
__________________
Good judgment comes from experience. Unfortunately, the experience usually comes from bad judgment.


FUBAR295 is offline   Reply With Quote
Old 01-09-21, 04:44 PM   #8
LGN1
Ace of the Deep
 
Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
Default

Hi John,


I don't know why the numbers are there. But since they are part of a comment, they have no effect. Maybe these are the stock values (3 and 4 seconds) so that one has a reference


One word of caution: Finding the correct hex value is not always easy and since S3D adds a comment to the beginning of a file, hex offsets are often different between stock and modified files! I recommend to have a test file with all probabilities equal 100% and then activate the 'no-launch' option in SH3 Commander. This allows you to quickly test your work by opening the modified file with S3D (after SH3 Commander has modified it) and check whether the value has indeed been changed. Using this method I have found quite a few wrong hex offsets...


Best, LGN1
LGN1 is offline   Reply With Quote
Old 01-09-21, 04:57 PM   #9
John Pancoast
Ocean Warrior
 
Join Date: Apr 2002
Location: Minnysoda
Posts: 3,162
Downloads: 488
Uploads: 4


Default

Quote:
Originally Posted by LGN1 View Post
Hi John,


I don't know why the numbers are there. But since they are part of a comment, they have no effect. Maybe these are the stock values (3 and 4 seconds) so that one has a reference


One word of caution: Finding the correct hex value is not always easy and since S3D adds a comment to the beginning of a file, hex offsets are often different between stock and modified files! I recommend to have a test file with all probabilities equal 100% and then activate the 'no-launch' option in SH3 Commander. This allows you to quickly test your work by opening the modified file with S3D (after SH3 Commander has modified it) and check whether the value has indeed been changed. Using this method I have found quite a few wrong hex offsets...


Best, LGN1
Hi LGN1,
Good idea, thanks ! Makes your command file idea even more appealing. Really appreciate your help.

John
__________________
"Realistic" is not always GAME-GOOD." - Wave Skipper
John Pancoast is offline   Reply With Quote
Old 01-12-21, 01:41 PM   #10
John Pancoast
Ocean Warrior
 
Join Date: Apr 2002
Location: Minnysoda
Posts: 3,162
Downloads: 488
Uploads: 4


Default

Hi LGN1;
I know how to find the hex offset info. in TimeTraveler's mini-tweaker but where do you get that same info. in S3D ?

Best,
John
__________________
"Realistic" is not always GAME-GOOD." - Wave Skipper
John Pancoast is offline   Reply With Quote
Old 01-12-21, 05:13 PM   #11
LGN1
Ace of the Deep
 
Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
Default

Hi John,


I don't know whether you can get this information from S3D.


I use a hex editor in combination with, e.g., the information from TimeTraveler, to find the location in the stock files. Then I look for the same hex pattern around the stock location in the modified file and extract the new hex offset. If this offset is wrong (I check with S3D whether the value has been changed correctly), I try different hex offsets 'left' and 'right' of my first guess. Usually, I find it +/-1 offset.


No rocket-science or deep understanding required, just compare patterns and make smart guesses


Best, LGN1
LGN1 is offline   Reply With Quote
Old 01-12-21, 05:30 PM   #12
John Pancoast
Ocean Warrior
 
Join Date: Apr 2002
Location: Minnysoda
Posts: 3,162
Downloads: 488
Uploads: 4


Default

Quote:
Originally Posted by LGN1 View Post
Hi John,


I don't know whether you can get this information from S3D.


I use a hex editor in combination with, e.g., the information from TimeTraveler, to find the location in the stock files. Then I look for the same hex pattern around the stock location in the modified file and extract the new hex offset. If this offset is wrong (I check with S3D whether the value has been changed correctly), I try different hex offsets 'left' and 'right' of my first guess. Usually, I find it +/-1 offset.


No rocket-science or deep understanding required, just compare patterns and make smart guesses


Best, LGN1
Got it, thanks ! I figured I was as usual missing something staring me in the face so thats a relief.
__________________
"Realistic" is not always GAME-GOOD." - Wave Skipper
John Pancoast is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 09:26 AM.


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