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 11-07-11, 04:24 PM   #1
makman94
Hellas
 
Join Date: Jul 2008
Posts: 2,325
Downloads: 182
Uploads: 7


Default Sensors

continue the discussion about (visual) sensors (from thread: Sh3.exe and Asdic in shallow waters)...

Hitman said:
Quote:
Originally Posted by Hitman View Post
....The vampire vision bug was more or less solved; it was the periscope sensor, seeing through its casing (Remember sensors in SH3 are not hampered by objects) what cause that effect....
that was just a guess that were posted somewhere but never prooved . in game is not happening anything like that. just set at your periscope visual in sensors.dat a value at max range=1km and you will see that nothing is changing ! target continue to be spoted at 13-14 or even 15 km at deep night.

don't confuse the environments with all these . own crew sensors are not 'following' correctly the environment becuase the light factor at sensors.cfg seems to be broken (sensors for ai though seems to 'react' better at light factor in sim.cfg ) . so ,if we get the advantage to can set the own crew visuals during night then it is a piece of cake to create an as much dark environment we want to be in full 'harmony' with the setted by us values at own crew visuals.(thats why i never made totally darked the MEP, becuase no matter what the own crew would always spot ships far away).

one question that still is very interesting is this : why in one specific single mission where the parameters are always the same (positions of ships,amount of darkness,sea state , time...etc) the detection range is ...random ? what makes the own crew spot the target other times to 15km and other times to 4km (in same mission with repeated tests) ?
__________________
Knowledge is the only thing that nobody can ever take from you...



Mediafire page:http://www.mediafire.com/folder/da50.../Makman94_Mods

Last edited by makman94; 11-07-11 at 04:47 PM.
makman94 is offline   Reply With Quote
Old 11-07-11, 04:30 PM   #2
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Quote:
Originally Posted by makman94 View Post
continue the discussion about (visual) sensors (from thread: Sh3.exe and Asdic in shallow waters)...

Hitman said:


that was just a guess that were posted somewhere but never prooved . in game is not happening anything like that. just set at your periscope visual in sensors.dat a value at max range=1km and you will see that nothing is changing ! target continue to be spoted at 13-14 or even 15 km at deep night.

don't confuse the environments with all these . own crew sensors are not 'following' correctly the environment becuase the light factor at sensors.dat seems to be broken (sensors for ai though seems to 'react' better at light factor in sim.cfg ) . so ,if we get the advantage to can set the own crew visuals during night then it is a piece of cake to create an as much dark environment we want to be in full 'harmony' with the setted by us values at own crew visuals.

one question that still is very interesting is this : why in one specific single mission where the parameters are always the same (positions of ships,amount of darkness,sea state , time...etc) the detection range is ...random ? what makes the own crew spot the target other times to 15km and other times to 4km (in same mission) ?
Which mission are you referring to is it all missions where the target is in the same place? Want to see if I can figure out OllyDebug using the Info Stiebler sent me to track down the U-Boat Visual Sensor.
If I could just figure out where the Sensor Variable is being stored I might be able to do something with it.
reaper7 is offline   Reply With Quote
Old 11-07-11, 04:41 PM   #3
makman94
Hellas
 
Join Date: Jul 2008
Posts: 2,325
Downloads: 182
Uploads: 7


Default

Quote:
Originally Posted by reaper7 View Post
Which mission are you referring to is it all missions where the target is in the same place? Want to see if I can figure out OllyDebug using the Info Stiebler sent me to track down the U-Boat Visual Sensor.
If I could just figure out where the Sensor Variable is being stored I might be able to do something with it.
i guess John that everyone can create set up situations at single missions to test sensors . anyway,here is one mission i made for testing purposes :
http://speedy.sh/246jT/test-mission-DetectRange.rar
target is showing the less hull to us at this mission and it is deep night .
run many times the mission and you will see the random detection ranges
__________________
Knowledge is the only thing that nobody can ever take from you...



Mediafire page:http://www.mediafire.com/folder/da50.../Makman94_Mods
makman94 is offline   Reply With Quote
Old 11-07-11, 05:26 PM   #4
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Thanks Mate, helps to be on the same mission for testing purposes

As per my post here in stieblers thread:
Quote:
Originally Posted by reaper7 View Post
Hi Stiebler got your PM and thanks for the info - hope I can figure my way around OllyDebug and find the relevant info .

Was at work today and had a thought that may be of Interest to you to add to your Asdic code.
It would be possible to make the sub harder to spot by ASDIC's when stopped and on the bottom by making MS = 80 or some relevant amount.

This would be great to add to the Defensive tactics when trying to escape destroyers when the sea floor is above crush depth.
Just bottom out and hide.
I already have the Variable for subspeed and could find the variable for depth under keel. So if both variable = 0 then MS = 80 .

So to add to your Original Figures
Depth > 150m: MS = 100 (m2, metres squared).
Depth >100m: MS = 150
Depth >50m: MS = 200
Depth < 50m: MS = 300.
DepthUnderKeel=0 Speed=0 MS=80

If your Interested in adding this to the code I'll send you the OllyDebug Code and memory locations.
Sorry for making more suggestions, just excited by your discovery
I have found the Variable for Sea-Depth and its a Static Address too Compared to usual DMA address with Pointers.

SH3Collisions.act+20550

Found the Variable for Depth under keel too but this only updates when the command is Issued, so may not be of use.

"sh3.exe"+001546C4 and 1 pointer offset 1C

Still using the Current Depth and the SeaDepth would suffice to know if the Sub in on the bottom. If Depth<=SeaDepth then apply Sensor adjustment.

Appears the SeaDepth Figure is Bang on if it read 111M then the seabed is 111M unlike the Depth under Keel command which applies an error to the Depth.
So therefore the sub can never dive deeper then the seaDepth value. so then if Subdepth=Seadepth, U-boat is on the seafloor.

Last edited by reaper7; 11-07-11 at 05:39 PM.
reaper7 is offline   Reply With Quote
Old 11-08-11, 04:01 AM   #5
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

Regarding vampire nights

Using GWX 16km environment, I also was amazed how far my crew and I could see in dark night (sometimes > 10km), while the enemy is completely blind and cannot see me in 200m distance.

While "hacking" the visual sensors for my type VIIF wolfs, I made some discoveries regarding visual sensors: Assume there are the player sub P and two escorts A and B. Every second, every sensor of every ship looks at the other ships. The arrow -> means "looks at".

P->A
P->B

A->P
A->B

B->P
B->A

But: In the code I cannot see, which sensor currently is looking, since the sensor's name (e.g. AI_Visual) is stored elsewhere. Same discovery that Stiebler did with his ASDIC. I can only identify a sensor by its range value, e.g. 30000m for GWX AI-Visual.

At the beginning of every "look-process", first, the distance between the sensor and the current target object is used to calculate a certain variable, which directly affects detection probability, maybe it IS the detection probability. After that, other factors like light, fog and so on modify this variable. Not examined in detail.

Multiplying this variable with a factor 10 will raise detection probability accordingly. Factor 0,1 will lower detection probability.

It would be easy to adjust / modify this factor according to the sun position (day, night, afternoon).

2 problems remain:

1) ATM this modification can only be done for all sensors in common. I cannot differ between different sensors in a smart way - except for the "dirty solution" by identifying them by their range (which unfortunately differs between supermods). AND: While Uboat crew sensors must be made more blind during night, AI-sensors ARE already blind and should be made to see better. So it is necessary to differ between AI-Sensors and Crew sensors. Only dirty solution possible ATM (indentify by range).

2) Even if we can modify sensors in a smart way, the objects are still rendered to be visible for the player in the dark night. This would cause a dysbalance between the crew ability to see and the players ability - which currently is very well balanced, at least in my sh3-installation. I don't know how to change the rendering so that the objects also are made less visible during the night.
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 11-08-11 at 09:37 AM.
h.sie is offline   Reply With Quote
Old 11-08-11, 12:41 PM   #6
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,728
Downloads: 132
Uploads: 0
Default

Quote:
Originally Posted by makman94 View Post
....

one question that still is very interesting is this : why in one specific single mission where the parameters are always the same (positions of ships,amount of darkness,sea state , time...etc) the detection range is ...random ? what makes the own crew spot the target other times to 15km and other times to 4km (in same mission with repeated tests) ?
One of the factors that leave to this behaviour is (in sensors.dat) the max range and precise range. If you make them the same this behaviour is much less noticiable. But itsn't the unique culprite. Also the settings on sensors.cfg give to the whole sensitivity a random behaviour. The major the numbers (sensors.cfg) then more (and random) time to the crew detects something. Some years ago I made a complete revamp of the sensors in a mod "Stay Alert crew" to try to make the crew more alert and quicky on their detection to be in par on what you can see at day/night (obviously in the end was an heroic work to make day/night works well). I don't need to say that the mod never worked as intend for the multiples sh3 installtions out there...

Edited: I made a very good readme that time about how the sensors settings works. Take a look.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve

Last edited by Rubini; 11-08-11 at 03:45 PM.
Rubini is offline   Reply With Quote
Old 11-08-11, 12:57 PM   #7
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Quote:
Originally Posted by h.sie View Post
In the code I cannot see, which sensor currently is looking, since the sensor's name (e.g. AI_Visual) is stored elsewhere. Same discovery that Stiebler did with his ASDIC. I can only identify a sensor by its range value, e.g. 30000m for GWX AI-Visual.

Where can you see this Range value for each Sensor within Ollydebug.
I would like to see if I can find anything relating to them.

More eyes looking, you never know.
reaper7 is offline   Reply With Quote
Old 11-08-11, 01:38 PM   #8
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@makman: detection ranges indeed are random, since - every second - a detection probability is calculated (from distance, weather etc.) and random numbers are used in order to determine whether object is detected or not. this luckily leads to random detection ranges, otherwise the game would be boring.

@reaper: Set a break at Sh3Sim.act+017012, but use the unpatched one.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-08-11, 02:53 PM   #9
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,728
Downloads: 132
Uploads: 0
Default

Quote:
Originally Posted by h.sie View Post
Regarding vampire nights

Using GWX 16km environment, I also was amazed how far my crew and I could see in dark night (sometimes > 10km), while the enemy is completely blind and cannot see me in 200m distance.

While "hacking" the visual sensors for my type VIIF wolfs, I made some discoveries regarding visual sensors: Assume there are the player sub P and two escorts A and B. Every second, every sensor of every ship looks at the other ships. The arrow -> means "looks at".

P->A
P->B

A->P
A->B

B->P
B->A

But: In the code I cannot see, which sensor currently is looking, since the sensor's name (e.g. AI_Visual) is stored elsewhere. Same discovery that Stiebler did with his ASDIC. I can only identify a sensor by its range value, e.g. 30000m for GWX AI-Visual.

At the beginning of every "look-process", first, the distance between the sensor and the current target object is used to calculate a certain variable, which directly affects detection probability, maybe it IS the detection probability. After that, other factors like light, fog and so on modify this variable. Not examined in detail.

Multiplying this variable with a factor 10 will raise detection probability accordingly. Factor 0,1 will lower detection probability.

It would be easy to adjust / modify this factor according to the sun position (day, night, afternoon).

2 problems remain:

1) ATM this modification can only be done for all sensors in common. I cannot differ between different sensors in a smart way - except for the "dirty solution" by identifying them by their range (which unfortunately differs between supermods). AND: While Uboat crew sensors must be made more blind during night, AI-sensors ARE already blind and should be made to see better. So it is necessary to differ between AI-Sensors and Crew sensors. Only dirty solution possible ATM (indentify by range).

2) Even if we can modify sensors in a smart way, the objects are still rendered to be visible for the player in the dark night. This would cause a dysbalance between the crew ability to see and the players ability - which currently is very well balanced, at least in my sh3-installation. I don't know how to change the rendering so that the objects also are made less visible during the night.
Hi h.sie,

Some comments:

1. the rendering issue (your monitor, your files at a once): Hitmann already said correctly that the rendering max distance at night (mainly) is also a matter of adjust on your monitor color/contrast/brightness and also dependent on what environment colors you are using. Almost all supermods try to delivery something already adjusted - but trust me, isn't equall for all because the monitor differences. So, we never will have something working very well for all users.

2. the type of environment 8k or 16km etc (scene.dat, env folder files): this is again making a fubar on the matter. Different fog distance settings, different waves size, different env colors, different sky textures - all this can produce different detections distances and different rendering points.

3. finally the sensors (sensors.dat, sensors.cfg , sim.cfg and AI_sensors.dat) : again we have a lot of different mods and different personal adjust here producing again different detections distances.

By the exposed above we can see that we don't need to delivery a real and total solution for all. What we need to delivery is a working&plausive night uboat crew visual detection. I mean, something that works as the AI_sensors.

We can't forget that the player sensors have two values (the precise range and the max range). To our intention we must use the max range settings.

I will suggest (if possible) to make the mod with two range options (that you could then easily detect on the code - needs to be exclusive non?), lets say: 8650 or 16250. This will be the trigger to the mod find the correct values just for player visual sensors and then make the cut based on the light of the environment.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini is offline   Reply With Quote
Old 11-08-11, 03:01 PM   #10
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,728
Downloads: 132
Uploads: 0
Default

Continuing from above...

Then the problems about the moment that the object is rendered and the moment when the crew detects it ( a bit random as we talk above) can be then adjusted on the scene.dat (no hardfix needed) to each mod that wants to use the fix. At first I can't see another solution.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve

Last edited by Rubini; 11-08-11 at 03:47 PM.
Rubini is offline   Reply With Quote
Old 11-08-11, 03:40 PM   #11
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,728
Downloads: 132
Uploads: 0
Default

Excuse me by the followed posts. Hopes that this also could add knowing to the matter.

Yesterday at night I tried this:

1. Made a new settings on my Sensors.dat (16km now) changing my Visual sensor max range from 16000 to 7000 (The precise was also changed from 10000 to 5000). Mounted the file as a Night_sensor_mod.

2. Then, when the night comes I enabled the mod with JSGME in patrol (save/exit patrol/enabled the mod/reload patrol) and continues. All my visual contacts were now very proof and plausive, max detection more or less at 6800m max and I barely also could see the ships on the night horizon at same time (this was for nofog parcial clouds weather). I used 7000 because this is the distance at night that I can start to see things on my Sh3 settings/my monitor for this weather settings.

The idea here is just to try/test how the fix must work. Just cutting the max range setting based on the light of the environment. The fix must do this automatically without the need to save/exit/reload and in a more smooth way as the light goes and comes on the environment. The adjust on scene.dat is easily to be done later (if needed) by each player that want to use the fix (or the big mods can provide it) to match the night max distance visual sensor and the eye detectable rendering max distance.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini is offline   Reply With Quote
Old 11-08-11, 03:52 PM   #12
MCHALO12
Gunner
 
Join Date: May 2010
Posts: 94
Downloads: 43
Uploads: 0
Default

Hi friends,

I have been working on sensors for the last months and tried to find a realistic solution for the visual sensor of the enemy: surfaced night attacks must be possible, so the detection range at night should be between 1000 and 500 meters in standard conditions (medium waves, light clouds). On the other hand, the daylight detection range should be quite hight (8 to 14 kilometers in good conditions). I edited the files sensors.dat, AI_sensors.dat, sim.cfg and sensors.cfg. After about 200 ingame test with different values, I still haven't found the perfect solution: The sensors of the enemy ships and airplanes now work as intended, but now I am facing problems with my crew....

But first, some of the relationships which are important: the values in sim.cfg seem to affect the AI ships AND the crew of your submarine: a higher "light factor" in sim.cfg makes the enemies see less far in darkness, but so will your crew. In order to compensate this, the "visual light factor" in the sensors.cfg has to be set to a HIGHER value, which will make your crew see better again.
Furthermore, a higher "light factor" in sim.cfg does not only make the enemy see less far at night, it also affects the detection range at daytime (gets a little smaler). To compensate this, "maxrange" and "precise range" in sensors.dat has to be enlarged. With these three values in right balance (which requires really lots of tests) the detection range of the enemy ships can be adjusted. BUT: The sensors are also affected by the competence of the units, which means that many more test have to be done. AND: the "worst case" has to be considered, too: enemy destroyers should also detect you in really bad conditions (wind 15 m/s, heavy fog, clouds). This is where - in my opinion - GWX fails: a veteran destroyer will not visually detect you in the described conditions, no matter how close you get.

Somebody wrote the "visual light factor" in sensors.cfg was broken. I don't know if it is really broken, but it does act weird sometimes... Currently I am trying to make my crew see better again and be more reliable: at the moment, the detection range differs way to much.

As a conclusion, I think the sensor values can not be "set right" for every situation (weather, time of day, competence level,...), but a reasonable compromise has to be found wich again will be different for every type of player. As long as h.sie does not manage to rewrite the code of the sensors (is anything impossible for this brilliant guy? ), I think everybody has to find his own "perfect solution" or use one of the already existing. I doubt that giving one solution in the next "Realism fix" while still using the stock mechanics would make the bigger part of the players happy: some people want to have an easy game, other want hardcore realism (like me). Perhaps the better idea would be to rewrite the sensors' code (if possible) in a more traceable way, so that everybody could set their own values?

Best regards, MCHALO12.
__________________

Last edited by MCHALO12; 11-08-11 at 04:07 PM.
MCHALO12 is offline   Reply With Quote
Old 11-08-11, 06:25 PM   #13
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,728
Downloads: 132
Uploads: 0
Default

@MCHALO!: take a look here:
http://www.subsim.com/radioroom/show...ght=workaround

How sensors works and its limitations is already knowing since some years. Sim.cfg and AI_Sensors.dat are for AI and Sensors.cfg and Sensors.dat are for your crew.

What is in discussion here is not to revamp the whole sensors mess. But just give to the Visual Crew sensor a better behaviour based on the light of the environment.

Only this fix will be enough to we have a much better and realistic behaviour of the entire game, belive me.

Anyhow any approach or discussion on the matter is always produtive; take a look on the readme of the link(mod) above...there you have all the sensors settings explained.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve

Last edited by Rubini; 11-08-11 at 07:31 PM.
Rubini is offline   Reply With Quote
Old 11-09-11, 02:09 AM   #14
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@Rubini & MAkman:

What I can offer in the next time:

I my posts above I've talked about a variable that directly affects detection probability and thus could be used to change visible sensors ability during the night. Instead of making it dependent from sun position by hardcode patch, I can make it e.g. dependent from one of the TDC dials. So you can manipulate and scale it as you like, and find out the best settings for different environment (light) conditions. Then, at the end, your settings can be hardcoded.

What I can't offer:

Doing the environent tests mentioned above by myself.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-09-11, 07:49 AM   #15
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,728
Downloads: 132
Uploads: 0
Default

Hi h.sie,

Any offer is welcome.

I can make all tests, I'm very interested on this fix, no problems. (I guess that makman can do it also)

Until now I understood that we have two approachs. Correct me if I'm wrong:

1. Your proposal, the variable that affects detection probability. But can you make it specific just for player crew visual sensor?

2. that approach by the max range setting value (the same approach that stiebler is doing on asdic). We can use a know and exclusive value to make things more easy. Let's say 16250, I will then modify my sensors.dat visual max range to 16250 to match your modification on the code and we can start test.

Can you explain the good and bad of each approach? Is one of them more easy to be done than the other?
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini 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 04:34 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.