![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
03-19-14, 11:16 AM
|
#1 |
|
Nub
![]() Join Date: Apr 2012
Posts: 2
Downloads: 8
Uploads: 0
|
Hey guys! Yes I havn't had to post anything because you are all so smart and so helpful that when I have an issue it is usually already resolved
...![]() This worked like a charm! I got a free norton trial with my pc-build.... removed it and voila! What a great new hydrophone! Thanks so much for the help guys! Much appreciated! These mods/patches are incredible! |
|
|
03-19-14, 12:15 PM
|
#2 | |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
|
|
|
|
03-23-14, 09:30 PM
|
#3 |
|
Black Magic
![]() |
Let's talk about our crew's ability to see visual targets. I've been looking over the game code for this and figured out how the game determines when our crew 'sees' a visual contact.
As you may or may not know the crew's ability to see is because of the AI_Visual sensor attached to the submarine. If we look at the data\Cfg\Sensors.cfg file we see no parameter for minimum signal strength as is found in \data\Cfg\Sim.cfg. The game does some lengthy computations using all the values in data\Cfg\Sensors.cfg's Visual parameters to come up with a derived minimum signal strength. The last thing the game does is check to see if it's nighttime. Nighttime is an on/off thing - it's either nighttime or it's not. This does not model real life! The game has a hard coded value of 0.283 as the value for determining it's nighttime. If the current light amount value is < 0.283 then it's nighttime otherwise it's daytime. The game has a memory address that stores the current light amount value. This value is in the range 0.0-1.0 with 1.0 being all available light is available (very bright daylight). Now here's where things get interesting. I've made some single missions where visually it's nighttime but the game thinks it's still daytime. The current light amount value was 0.385 with 0.283 being the value that the game uses for nighttime. If it is nighttime then the game takes the derived minimum signal strength and multiplies it by 3. Then the signal strength of the visual sensor is compared to the minimum signal strength. If greater than then the contact is spotted. You can now see why the crew is able to spot contacts at far away distances at supposedly nighttime. I'm deriving a fix for this. What I have come up with so far is defining a value that defines start of nighttime. I have this value currently at 0.5. When the game checks to see if it's nighttime for the visual sensor and it reports back that it is daytime (but visually it appears to be nighttime) I have some new code doing the following: - if game reports back it's daytime: -- compare game's nighttime value (0.283) to start of nighttime value (0.5) - I do this comparison because it's possible someone may screw up and assign the start of nighttime value <= 0.283 since it's a variable in the patch file -- if greater than or equal then jump to end of function -- if less than then subtract game's nighttime value (0.283) from start of nighttime (0.5) - result is 0.217 -- take current light value (say it's 0.385) and subtract game's nighttime value (0.283) - result is 0.102 -- divide 0.102 by 0.217 - result is 0.47 -- subtract 0.47 from 1.0 - result is 0.53 -- multiply 0.53 by game's nighttime multiplier for player's crew (3.0) - result is 1.59 -- multiply 1.59 by derived minimum signal strength (let's say it's 0.1) - result is 0.159 - this is the new minimum signal strength What this does is instead of making nighttime either an on/off state it makes it a progressive one. This is how it is in real life - as it gets darker out your ability to see objects diminishes. I might have to change the nighttime multiplier also. This will be another variable in the patch file if I do. I'm thinking it's going to have to be raised to either 3.5 or 4 from it's current value of 3. I'm also making another patch that will let the searchlights turn on at dusk. Currently the searchlights only turn on if the game says it's nighttime out (< 0.283 for light value). I'm going to raise this value to 0.40 which should have the searchlights turning on at start of dusk. |
|
|
03-24-14, 12:15 AM
|
#4 |
|
Ace of the deep .
|
I really cannot think of anything to type other than WOW .
|
|
|
03-24-14, 11:13 AM
|
#5 |
|
Sea Lord
![]() Join Date: Mar 2007
Posts: 1,897
Downloads: 172
Uploads: 0
|
__________________
What we do in life echoes in Eternity |
|
|
03-24-14, 06:03 AM
|
#6 | |
|
Samurai Navy
![]() |
Quote:
|
|
|
|
03-24-14, 06:40 AM
|
#7 |
|
Captain
![]() Join Date: May 2011
Posts: 489
Downloads: 106
Uploads: 0
|
Amazing as always, TDW!
|
|
|
03-24-14, 07:09 AM
|
#8 |
|
Engineer
![]() Join Date: Apr 2005
Posts: 209
Downloads: 86
Uploads: 0
|
Just a small request Dark.. could you date stamp your changelog on the first post whenever you release a new version?
I never know when an update has released and because the number of fixes is growing quite vast I easily forget what I have and haven't got patched. |
|
|
03-24-14, 08:32 AM
|
#9 | |
|
Ocean Warrior
![]() |
Quote:
__________________
. Where does human stupidity end? . ![]() ![]() El sueño de la razón produce monstruos © - and for some people awakening will be cruel |
|
|
|
03-24-14, 09:10 AM
|
#10 | |||
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
-- take current light value (1) and subtract game's nighttime value (0.283) - result is 0.717 -- divide 0.717 by 0.217 (start of night time less game's night time value) - result is 3.304 -- subtract 3.304 from 1.0 - result is -2.304 -- multiply -2.304 by game's nighttime multiplier for player's crew (3.0) - result is -6.912 -- multiply -6.912 by derived minimum signal strength (0.1, from your example) - result is -0.691 - this would be the new minimum signal strength. Do negative numbers make any sense here? Maybe you should add a routine checking if current light value isn't greater than or equal to start of night time ![]() Quote:
Quote:
Last edited by gap; 03-24-14 at 09:20 AM. |
|||
|
|
03-24-14, 09:45 AM
|
#11 | |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
Let's say that current light value is 0.49 -- take current light value (0.49) and subtract game's nighttime value (0.283) - result is 0.207 -- divide 0.207 by 0.217 - result is 0.954 -- subtract 0.954 from 1.0 - result is 0.046 -- multiply 0.046 by game's nighttime multiplier for player's crew (3.0) - result is 0.138 (makes no sense, we should make sure that this number is always greater than or equal to 1) -- multiply 0.138 by derived minimum signal strength (0.1, from your example) - result is 0.014 - this would be the new minimum signal strength (which is obviously smaller than day-time derived minimum signal strength, whereas it should be bigger).
|
|
|
|
03-24-14, 11:42 AM
|
#12 | |
|
Black Magic
![]() |
Quote:
|
|
|
|
03-24-14, 01:29 PM
|
#13 |
|
Black Magic
![]() |
I added code so that the same thing was done to units other than the player's unit. Thus units other than the player's unit will have their ability to detect contacts visually impaired as available sunlight fades away
|
|
|
03-24-14, 02:42 PM
|
#14 | |
|
Planesman
![]() Join Date: Jan 2010
Location: Italy
Posts: 195
Downloads: 333
Uploads: 0
|
Quote:
|
|
|
|
03-24-14, 03:57 PM
|
#15 | ||||
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
![]() Quote:
![]() If I got you correctly stock game applies no nighttime multiplier when current light value is greater than 0.283, and a constant multiplier (3), when current light value is equal or lesser than 0.283. What we want, is a "variable by light multiplier" to be applied when current light value is comprised between start of nighttime (0.5 in your example) and game's nighttime (0.283). The above multiplier should range in value between 1 and nighttime multiplier. If you agree with the above, the new algorythm should look like this: -- compare game's nighttime value (0.283) to start of nighttime value (0.5) -- if greater than or equal then jump to end of function (prevents unmanaged errors due to wrong start of nighttime user settings) -- check current light value -- if equal or greater than start of nighttime go to end of function (no multiplier is applied, as per stock code); -- if equal or lesser than game's nighttime value go to end of function (the full nighttime multiplier is applied, i.e. either the stock 3 value, or the new value patched by you); -- subtract game's nighttime value (0.283) from start of nighttime (0.5) - result is 0.217 -- take current light value (say it's 0.385, as per your example) and subtract game's nighttime value (0.283) - result is 0.102 -- divide 0.102 by 0.217 - result is 0.47 -- subtract 0.47 from 1.0 - result is 0.53 -- calculate the reciprocal of nighttime multiplier (3.0) - result is 0.33 -- subtract 0.33 from 1.0 - result is 0.77 -- multiply 0.77 by 0.53 - result is 0.35 -- add 0.33 to 0.35 - result is 0.69 -- multiply 0.69 by game's nighttime multiplier for player's crew (3.0) - result is 2.06 -- multiply 2.06 by derived minimum signal strength (let's say it's 0.1) - result is 0.206 - this would be the new minimum signal strength the part in bold ensures that the variable by light signal strenght multiplier is always within the range 1 - game's nighttime multiplier. The multiplier will increase linearly between the above extremes Quote:
Quote:
|
||||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
