SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [WIP] Realistic Hydrophone (https://www.subsim.com/radioroom/showthread.php?t=208473)

THE_MASK 10-21-13 01:17 AM

What is the documentation folder ? Is it part of the mod ?

plj 10-21-13 03:16 AM

http://www.subsim.com/radioroom/show...ostcount=10832

I just reproduced this .. and this is deffinately a bug in NewUI's code. How confident are you in your solution ? Are you not skipping multiple checks on range this way ?

gap 10-21-13 03:42 AM

Quote:

Originally Posted by plj (Post 2131168)
http://www.subsim.com/radioroom/show...ostcount=10832

I just reproduced this .. and this is deffinately a bug in NewUI's code.

In that case I beg pardon for not having trusted tscharlii when he first reported the bug :88)

Quote:

Originally Posted by plj (Post 2131168)
How confident are you in your solution ? Are you not skipping multiple checks on range this way ?

It seems that our tscharlii knows what he is doing. I know nothing on SH5 scripted routines and python, but if required I can give him an insight on sensors' controllers, to make sure he won't skip the information stored in them.

gap 10-21-13 06:05 AM

Quote:

Originally Posted by gap (Post 2131016)
Estimating rough ranges trough hydrophone was surely possible. Today I have read a British report on the interrogation of the survivors of a captured/destroyed u-boat, where the sonarman had (correctly) reported a range to the attackers of only 500 m, and the commander had discarded it based on his periscope visual (he was convinced that the pursuing ship was much bigger, thence his wrong range esitimation). Undortunately I didn't save the link, but I will try looking again for it tomorrow :up:

Found it! :up:

http://www.uboatarchive.net/U-111INT.htm

Quote:

Originally Posted by VI. SINKING OF "U 111"
In "U 111" the sounds of "Lady Shirley's" propellers were heard, and Kleinschmidt at first estimated that the British ship was about 5,000 metres (about 5,467 yards) distant.
The Junior Officer and the man at the listening gear were stated to have expressed surprise and to have queried Kleinschmidt's estimate, as they were of the opinion that their enemy was much closer.
A little later Kleinschmidt estimated that the British ship was 3,000 metres (about 3,280 yards) distant. The man at the hydrophones at once questioned this statement as he thought that the distance was about 500 metres (547 yards) only; but Kleinschmidt somewhat irritably repeated his estimate of 3,000 metres. It was emphatically stated that Kleinschmidt looked through the periscope just before making this statement; prisoners assumed that either something was wrong with the periscope or Kleinschmidt clung to his conviction that his adversary was a much larger ship at a much greater distance than was actually the case.
A few moments later the explosions of depth charges were heard.

You can get a lot of interesting clues from British Interrogation Reports. They are not always fully accurate, but on many topics they are the best (or the one) accessible source :know:

tscharlii 10-21-13 08:55 AM

Quote:

Originally Posted by sober (Post 2131146)
What is the documentation folder ? Is it part of the mod ?

I'm sure you know that. JSGME ignores the the Documentation folder and does not install its contents into the SH5 folder structure. Some parts of my mod (Sound playback and a function to set the Hydrophone Bearing) are implemented in CSharp and compiled into Tscharlii.dll. The documentation folder contains the source code of Tscharlii.dll and is there for informational purposes/interested folks only. It is not a required part of the mod.

tscharlii 10-21-13 10:50 PM

Alright, some theory crafting regarding hydrophone range and bearing accuracy based on different sources. Thank you, gap, for pointing me to them.

[1] http://www.cdvandt.org/GHG1996.pdf
[2] http://de.wikipedia.org/wiki/Gruppenhorchger%C3%A4t
[3] http://www.sengpielaudio.com/calculator-spl.htm
[4] http://www.sengpielaudio.com/calculator-levelchange.htm
[5] http://www.forum-marinearchiv.de/smf...?topic=4469.15

The following calculations are based on very little data and lots of assumptions and last but not least, I'm not sure whether I have applied the maths involved correctly.

I'll assume a GHG (group listening apparatus) hydrophone and a merchant at 12-13 knots as target contact, since [1] provides some data on this scenario, and this is a common encounter in sh5.

First: max range under optimal conditions, that is:
  • no noise
  • contact on a relative bearing of 90 degrees starport or 270 degrees port
[1] says: 20 to 25 nautical miles, that is 37km to 46.3km for single contacts
[2] says: 20km for single contacts

I'll go with something in the middle, which, as far as i know, happens to be the max range the game starts to make contact pickups by hydrophone possible:
At R = 30km under optimal conditions, we can barely hear the contact.

At 90 (or 270) degrees the sound hits the hydrophones perpendicularily, i.e. the full sound pressure stimulates the hydrohpone membranes. If we deviate from that bearing, the sound waves come in aslant, and only a portion of the sound pressure is effective on the hydrophone. That portion is proportional to the cosine of the deviation from 90/270 degrees:

maxrange = R * cos(alpha), with alpha = deviation from 90/270 degrees

On to bearing accuracy: The GHG features 4 settings for the high pass filter[1]:
  • off: no filtering, complete received sound usable, bearing accuracy 8 degrees (I understand this as +-4 degrees)
  • 1kHz: frequencies below 1kHz are filtered out, uses frequencies from 1kHz - 7kHz, yields a bearing accuracy of 4 degrees
  • 3Khz: frequencies from 3-7kHz used, yields a bearing accuracy of 1.5 degrees
  • 6kHz: frequencies from 6-7kHz used, yields a bearing accuracy of < 1 degree
The maxrange depending on bearing, that we calulated above, applies to the "off" setting. As soon as we start filtering frequencies to achieve better bearing accuracy, the sound gets softer and we need to be closer to the contact, so we can still hear it. But how much closer?
[1] says: the merchant at 12-13 knots produces a maximum sonic spectrum at 100Hz, and only 10% at 4Khz, which we can hear using the 3Khz setting. Fortunately, filtering out 90% of a sound does not mean, that the sound pressure usable at the hydrophone drops by 90%. [3] has some explanations and calculators about this topic. I assume, the sounds at different frequencies produced by the engines are equally loud. If we add up 10 equally loud sound sources with different fequencies, the sound level increases by 10dB. Conversely, the sound level of those 10% at 4kHz is 10dB less than the sound level of the whole, unfiltered sound. This level change is called "Delta L". The formula is not quite as simple as it looks like from this particular example (see [3], Adding levels of equal loud sound sources).

What does a 10dB decrease of the sound level mean regarding the usable sound pressure at the hydrophones? According to [4], the sound pressure factor y = 10^(Delta L / 20): For -10dB, this is around 0.316.

Sound pressure is reciprocally proportinal to distance.
So, at a bearing of 90 degrees, under optimal conditions, we can barely hear our contact at 30km and determine its bearing +-4 degrees. If we wanted to use the 3KHz setting and determine its bearing +-0.75 degrees, we need to be closer than 30km * 0.316 = 9.48km.

Time for some more assumptions regarding the other hydrophone high pass filter settings, that are not covered by [1]:
Given that 10% are above 4kHz, let's assume 33% (i.e. one third) of the sound emissions of a merchant at 12-13 knots are above 1Khz, and 3% (i.e. 1/33rd) are above 6kHz.

This leads to the following sound pressure factors:
Code:

cutoff-frequency        None        1kHz        3kHz        6kHz
Portion of the sound    100%        33%        10%        3%
Decrease of sound level 0dB        -4.77dB    -10dB      -15.18dB
Sound pressure factor  1          0.577      0.316      0.174
bearing accuracy        +-4        +-2        +-0.75      +-0.5

Let's combine the two results (reduced maxrange depending on the bearing as well as on the selected high pass filter) and visualize them.
We have four functions, one for each high pass filter setting. The x-axis is the bearing deviation from 90/270 degrees. The y-axis shows the maximum range in km at which we can hear the contact using a specific high pass filter setting.
Code:

Blue(off)  : f(alpha) = 30km * 1    * cos(alpha)
Red(1kHz)  : f(alpha) = 30km * 0.577 * cos(alpha)
Green(3kHz): f(alpha) = 30km * 0.316 * cos(alpha)
Gray(6kHz) : f(alpha) = 30km * 0.174 * cos(alpha)

http://www.deguero.de/jel/hydrophonemaxranges.png

These results correspond to [5], which (I think) cites from E.Rössler, Die Sonaranlagen der deutschen U-Boote. In a GHG-Test performed in February 1943, the type IX sub U-194 was not able to detect a contact in a distance of 4km on a bearing between 348 and 10 degrees. This test report also has some data on the GHG range while the sub is moving at different speeds.

Feedback is very welcome. Maybe I should have used sound intensity instead of sound pressure? Maybe assumptions are just plain wrong? Otherwise I'm planning to base the mod on this model.

plj 10-22-13 02:38 AM

Quote:

Originally Posted by tscharlii (Post 2131718)
starport

That's starboard ;) We're not playing X3 here :p

I cant comment on the rest, tho it sounds very cool!

gap 10-22-13 04:41 AM

tscharlii,
your graph, the calculations it is based on, and the few arbitrary assumptions you had to make, look perfectly plausible.

I have just a little amendment regarding SH5's "physical world horizon": IIRC, it is in a radius of ca. 40km from the player, not 30 as you are assuming. But this little mistake doesn't invalidate the rest of your reasoning. I wish to point you now to some of the parameters affecting hydrophone's efficiency in stock game. This is to make sure that you will take them into the due account; should you be already aware about the information below, please ignore it.

Configurable global parameters (data\Cfg\Sensors.cfg). They affect all the player's hydrophones (AI units' sensor parameters are found in data\Cfg\Sim.cfg, and are much more simplified):

Quote:

Hydrophone range factor: how much target's range affects its detection by hydrophone

Hydrophone fog factor: how much fog affects hydrophone detection

Hydrophone light factor: how much darkness affects hydrophone detection

Hydrophone waves factor: how much rough seas affect hydrophone detection

Hydrophone speed factor: how much own speed affects hydrophone detection

Hydrophone enemy speed: how much enemie's speed affects its detection by hydrophone

Hydrophone aspect: how much a low profile offered by the enemy affects its detection by hydrophone

Hydrophone noise factor: how much surrounding noises affect hydrophone detection

Hydrophone sensor height factor: how much a low sensor height affects hydrophone detection

Hydrophone already tracking modifier: this is a bonus, making the hydrophone operator not to loose a contact which was already detected

Hydrophone decay time: this is the duration of the bonus, in seconds from the last detection

Hydrophone uses crew efficiency: (boolean) whether hydrophone detection will be affected by crew efficency or not
Numerical factor must be ≥ 0 and can be bigger than 1 (i.e. they are not percent values), even though most stock settings are comprised between 0 and 1. It is my understanding that the higher the settings, the worst is hydrophone's detection under the conditions described for each parameter. Indeed, some of the parameters (fog, light, aspect) are non-relevant for hydrophone detection and they are set to 0 in stock game: they are probably there for symmetry with other sensors. The meaning of other parameters which are also set to 0 in vanilla game is a bit obscure (namely: enemy speed, sensor height), and needs to be investigated, but again I suspect that they are designed to work for other sensors.

Individual hydrophone parameters (SensorData controller). They affect individually each player hydrophone or any other sensor which can be fitted aboard playable u-boats (another controller, obj_Sensor, is used for AI sensor, and as before its parameters are much more simplified):

Quote:

SensorType: valid types are: 0 - visual, 1 - Radar, 2 - Sonar, 3 - Hydrophone, 4 - RadarWarning, 5 - RadioDF

PreciseRange: this is the range in meters within which sensor detection won't be affected by target's range

MaxRange: sensor's maximum detection range in meters. To my understanding, between PreciseRange and MaxRange target's detection chance is interpolated linearly.

MinHeight: min target depth/altitude in meters, for it to be detected

MaxHeight: max target depth/altitude in meters, for it to be detected

MinSensorHeight: min sensor working depth/altitude in meters

MaxSensorHeight: max sensor working depth/altitude in meters

Surface: Standard detectable surface at MaxRange (in square meters)

RPMDetLevel: Detection level as percentage of Maximum RPM (between 0 and 1). This is a bit tricky as it make a warship (with higher max RPM output) lesser detectable than a merchant travelling more or less at the same speed.

SweepPeriod: this is how long (in seconds) will take a 360 deg (bearing) sweep of the sensor.

SweepArc: I think this is the width (in degrees) that the sensor will be able to scan at each given moment; I ignore if it cam also affect sensors' bearing accuracy, but I doubt it.

ProbInsideArc: detection probability inside each SweepArc (between 0-1)

Revolving: (boolean) this is whether the sensor 3d model will revolve around its y axis during a sweep

SkipSweep: (boolean) whether the operator will skip invalid sector during sensor's sweep (see below)

Bearing (min, max): this let us to set valid bearing intervals (in degrees) within which sensor detection is possible. More than one interval can be set.

Elevation (min, max):this let us to set valid elevation intervals (in degrees) within which sensor detection is possible. More than one interval can be set.
That's all. As you can see, our current chances to customize hydrophones and other sensors are pretty much limited. In my opinion, the main limits are:

- inability to customize global parameters for each sensor.
- inability to customize sensors' accuracy (we should explore the SweepArc parameter though)
- inability to set different detection ranges and/or detection probabilities as a function of sensor's and targets' altitude/depth and of target's bearing.

TheBeast and XRundel have deviced a brilliant method to partially obviate some of the above limits: for their Repaired Equipment Mod, they have used more than one SensorData controller for each hydrophone, each set with different sensor depths and max detection ranges. This workaround is not exempt from flaws though: each controller must be placed in a precise order for the hydrophone not getting mute for the player below a certain depth; I and Volodya discovered it a while ago. Yet, after our fix the human player is not affected by detection range limits at varying depths, and he can always listen as far as the maximum set MaxRange. Moreover, detection ranges for the AI operator don't vary following a curve, but they "jump" from a level to the next one. A smooth depth/range curve could be simulated by using many conveniently set SensorData controllers, but I am afraid tha doing it could determine lagging or even worst problem.

This is really all for now. Keep up your brillian work :up:

Quote:

Originally Posted by plj (Post 2131762)
That's starboard ;) We're not playing X3 here :p

I cant comment on the rest, tho it sounds very cool!

:rotfl2:

tscharlii 10-22-13 07:15 AM

Quote:

Originally Posted by plj (Post 2131762)
That's starboard ;) We're not playing X3 here :p

Yeah, thanks, i'd have continued typing (and speaking) it the wrong way. English is not my mothertongue. X3 is a nice game though, and I also play Starcraft II, which has starports as well. That probably puts me on the dark side of the force.

Quote:

Originally Posted by gap (Post 2131783)
Individual hydrophone parameters (SensorData controller).

I guess you are talking about /data/Objects/Sensors/UBoot_Sensors.sim
What's the best way to have a look at the contents of this file? When I try to open it using the GoblinEditorApp.exe it just gives me a lot of "Lost Controllers" entries. That can't be right.
Currently I'm looking at it using a hex editor.

tscharlii 10-22-13 07:28 AM

Ahh, n/m, I think I figured it out. Load UBoot_Sensors.GR2, Merge UBoot_Sensors.sim, and then:
Project Tree: SensorData @ GHG9 -> Existing Behaviours -> Render -> SensorData

gap 10-22-13 07:38 AM

Quote:

Originally Posted by tscharlii (Post 2131852)
Yeah, thanks, i'd have continued typing (and speaking) it the wrong way. English is not my mothertongue. X3 is a nice game though, and I also play Starcraft II, which has starports as well. That probably puts me on the dark side of the force.

"It takes strength to resist the dark side. Only the weak embrace it!"

Obi-Wan Kenobi

:yep:

Quote:

Originally Posted by tscharlii (Post 2131852)
I guess you are talking about /data/Objects/Sensors/UBoot_Sensors.sim
What's the best way to have a look at the contents of this file? When I try to open it using the GoblinEditorApp.exe it just gives me a lot of "Lost Controllers" entries. That can't be right.
Currently I'm looking at it using a hex editor.

Open UBoot_Sensors.GR2 first, and merge then UBoot_Sensors.sim :up:

vdr1981 10-22-13 08:50 AM

I'm reading this thread and it looks like this is going to be one very god mod.:up:
Please, keep up the good work, with any language included, German, English, Or Japanese if you like...:D

Anyone with scripting knowledge is precious for subsim:yep:...Don't get surprised if I make few mod requests for you ,after you finished with realistic hydrophones...:D

Husksubsky 10-23-13 01:54 PM

Thx for the great Mod. I use Sobers list and I have a small issue. I get updates, but I never got sweeping around target area. The test object was very close(a german destroyer) and I couldn t lock on to it either with hydrophone follow selected target either so something is messing. when you say TDW s hyd fix you mean the patch right?

hmmm "Hydrophone follow nearest contact" supposed to be TDW s. I don t see it exactly like that anywhere what am I missing here?

plj 10-23-13 02:49 PM

Quote:

Originally Posted by Husksubsky (Post 2132577)
Thx for the great Mod. I use Sobers list and I have a small issue. I get updates, but I never got sweeping around target area. The test object was very close(a german destroyer) and I couldn t lock on to it either with hydrophone follow selected target either so something is messing. when you say TDW s hyd fix you mean the patch right?

hmmm "Hydrophone follow nearest contact" supposed to be TDW s. I don t see it exactly like that anywhere what am I missing here?

You mean this ?

Husksubsky 10-23-13 03:02 PM

Quote:

Originally Posted by plj (Post 2132603)
You mean this ?

My knight in shiny armor:salute:
hey! what happened to my face lol

well now hydrophone follow selected target works but it still sweeps 360 degrees.


All times are GMT -5. The time now is 12:19 PM.

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