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

Reply
 
Thread Tools Display Modes
Old 03-01-14, 12:19 AM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Working on a new patch to the SHSim.act file that would decrease the attacker's sonar signal strength returned if the attackee is moving slow enough and is close enough to the bottom.

Right now I'm in the discovery phase of the development. I've defined the following variables:
- speed above which signal strength is not reduced at all - 2.0 knots (UpperSpeed)
- speed below which signal strength can be reduced - 1.0 knots (LowerSpeed)
- depth above which signal strength is not reduced at all - 25m (UpperDepth)
- depth below which signal strength can be reduced - max depth for location - let's say it's 40m for this example (LowerDepth)
- minimum signal strength reduction - 20%
- maximum signal strength reduction - 60%

This means if attackee's speed is > 2 knots or depth is between 0-25m then signal strength is not reduced at all. Depth % is 0.0 and Speed % is 0.0

If attackee's speed or depth is between the Upper and Lower limits then:
- find difference between depth Lower and Upper limits - i.e. 40m - 25m = 15m
- subtract attackee's current depth from Lower limit - i.e. 40m - 32m = 8m
- calculate (depth difference - 8m / limits difference - 15m) and subtract this from 1.0 thus getting % of limit range used. Thus the closer you are to LowerDepth the higher the % - this is Depth % (0.53333)
- find difference between speed Upper and Lower Limits - i.e. 2.0 - 1.0 = 1.0 knots
- subtract attackee's current speed from Upper limit - i.e. 2.0 - 1.3 = 0.7 knots
- calculate (speed difference - 0.7 / limits difference - 1.0) thus getting % of limit range used. Thus the closer you are to LowerSpeed the higher the % - this is Speed % (0.7)

If attackee's speed is <= 1.0 knots and depth >= 40m then Speed % and depth % will be 1.0

- calculate difference between max and min signal strength reduction (0.60 - 0.20 = 0.40) - this is DeltaSignalStrengthRed
- get a random number in range 0.0 - 1.0 - let's say random number is 0.39
- multiply random number (0.39) by DeltaSignalStrengthRed (0.4) and add min signal strength reduction to it (0.20) thus getting the signal strength reduction - 0.356
- multiply result above (0.356) by Depth % (0.53333) - new result is 0.18987
- multiply result above (0.18987) by Speed % (0.7) - new result is 0.13291

Signal signal reduction for attacker's sonar is 13.291% for this example

What do you all think about these values? Look good or need different values?

Last edited by TheDarkWraith; 03-01-14 at 12:44 AM.
TheDarkWraith is offline   Reply With Quote
Old 03-01-14, 11:23 AM   #2
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Working on a new patch to the SHSim.act file that would decrease the attacker's sonar signal strength returned if the attackee is moving slow enough and is close enough to the bottom.

...

What do you all think about these values? Look good or need different values?
Your algorithm looks unexceptionable
(though apparently not lesser complicate than the one I had proposed yesterday for the magnetic loop patch )
I have no idea about the constant variables to be applied in the patch though. What about making them user configurable?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-02-14, 11:09 AM   #3
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

@ TDW

talking again about the optimal values to be set in your sonar patch, maybe you can get some clues from the comments to this other mod by Stiebler (for SH3). He used a different approach though: rather than varying minimum signal strenght, he varied the minimum surface factor of the sonar sensor.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-02-14, 02:31 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
@ TDW

talking again about the optimal values to be set in your sonar patch, maybe you can get some clues from the comments to this other mod by Stiebler (for SH3). He used a different approach though: rather than varying minimum signal strenght, he varied the minimum surface factor of the sonar sensor.
That's a poor approach varying the minimum surface thing. If that test fails then no contact is detected. My way at least gets some kind of signal strength returned thus enabling a chance for contact to be detected.
TheDarkWraith is offline   Reply With Quote
Old 03-02-14, 02:33 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Stumbled upon how the game decides which contact of a list of contacts detected by a unit is selected as the contact detected. Each unit has a priority number assigned to them. When the game iterates over all the contacts detected the unit with the highest priority value is the contact detected. Always wondered how the game decided this
TheDarkWraith is offline   Reply With Quote
Old 03-02-14, 02:40 PM   #6
Silent Steel
Sea Lord
 
Join Date: Jun 2008
Location: Noch dabei
Posts: 1,732
Downloads: 618
Uploads: 0
Default

You are Black Magic
Silent Steel is offline   Reply With Quote
Old 03-02-14, 02:49 PM   #7
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,153
Downloads: 901
Uploads: 73


Default

Quote:
Originally Posted by TheDarkWraith View Post
Stumbled upon how the game decides which contact of a list of contacts detected by a unit is selected as the contact detected. Each unit has a priority number assigned to them. When the game iterates over all the contacts detected the unit with the highest priority value is the contact detected. Always wondered how the game decided this
This IS an awesome find .
THE_MASK is offline   Reply With Quote
Old 03-02-14, 02:58 PM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
This IS an awesome find .
Yes it is. I always wanted the AI subs to target merchants instead of warships first
TheDarkWraith is offline   Reply With Quote
Old 03-02-14, 07:07 PM   #9
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,153
Downloads: 901
Uploads: 73


Default

Quote:
Originally Posted by TheDarkWraith View Post
Stumbled upon how the game decides which contact of a list of contacts detected by a unit is selected as the contact detected. Each unit has a priority number assigned to them. When the game iterates over all the contacts detected the unit with the highest priority value is the contact detected. Always wondered how the game decided this
Is this related in the mission editor 2 .
High priority contact True or False ?
THE_MASK is offline   Reply With Quote
Old 03-02-14, 07:14 PM   #10
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by sober View Post
Is this related in the mission editor 2 .
High priority contact True or False ?
Good question and well spotted
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-02-14, 10:29 PM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
Is this related in the mission editor 2 .
High priority contact True or False ?
Nope, completely different. That deals with how the unit is seen on the map.

The priorities I'm talking about are hard-coded in the SH5.exe. I'm not going to attempt to redo them but instead just insert some code to see if unit is AI sub and if so then merchants are priority over everything else.
TheDarkWraith 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 01:01 AM.


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