Previous discussions;
https://www.subsim.com/radioroom/sho...d.php?t=240550
https://www.subsim.com/radioroom/sho...d.php?t=210786
In the stock game, the visual in the sensors/dat file is used by all enemy ships, the listings for generic radar and sonar are not used by any of them. Instead they use different radar and sonar models based on the .sns file for each ship.
In the sensors.dat file the max range is given, and the circle displayed on the map is actually the average range, not the max range. "Average" works out to about 0.58 converting from meters to yards, so if the max range listed in the sensors.dat for any given detection system is 10,000 meters, the ring will have a radius of 5800 yards. That means you can still be detected outside that ring, rule of thumb is a bit less than twice the radius of the ring for safety. They might not detect you inside the ring for a while, depends on the skill level of the crew and how much rum the lookouts drank.
Further complication, in the notes under "Sensitivity" it says "The sensity of the sensor. At (Sensitivity * MaxRange) distance we have a double detection time. If 0, then the value from sim.cfg file is taken."
Look in the \Cfg folder for sim.cfg, plain text file;
[Visual]
Detection time=0.5 ;[s] min detection time.
Sensitivity=0.1 ;(0..1) min detection threshold double detection time.
Fog factor=1.0 ;[>=0]
Light factor=2.5 ;[>=0]
Waves factor=4.0 ;[>=0]
Enemy surface factor=50 ;[m2]
Enemy speed factor=25 ;[kt]
Thermal Layer Signal Attenuation=1.0
The light factor is what changes the sensitivity when it's dark outside, some of the other data is still open to debate - there's no thermal layer factor if you're running on the surface, so why that was included is a mystery.
Experimenting with the light factor I found that increasing the number also affects daytime detection range, dunno why.