![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
03-01-14, 12:19 AM
|
#1 |
|
Black Magic
![]() |
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. |
|
|
03-01-14, 11:23 AM
|
#2 | |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
(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?
|
|
|
|
03-02-14, 11:09 AM
|
#3 |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
@ 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.
|
|
|
03-02-14, 02:31 PM
|
#4 | |
|
Black Magic
![]() |
Quote:
|
|
|
|
03-02-14, 02:33 PM
|
#5 |
|
Black Magic
![]() |
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
|
|
|
03-02-14, 02:40 PM
|
#6 |
|
Sea Lord
![]() Join Date: Jun 2008
Location: Noch dabei
Posts: 1,732
Downloads: 618
Uploads: 0
|
You are Black Magic
|
|
|
03-02-14, 02:49 PM
|
#7 | |
|
Ace of the deep .
|
Quote:
|
|
|
|
03-02-14, 02:58 PM
|
#8 |
|
Black Magic
![]() |
|
|
|
03-02-14, 07:07 PM
|
#9 | |
|
Ace of the deep .
|
Quote:
High priority contact True or False ?
|
|
|
|
03-02-14, 07:14 PM
|
#10 | |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
|
|
|
|
03-02-14, 10:29 PM
|
#11 | |
|
Black Magic
![]() |
Quote:
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. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
