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 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 05-05-12, 05:47 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Another constant that I'm not sure how or why it's value is what it is:

1016.047

This value is multiplied by the torpedoes impulse (which is usually a value of 2000). What are they converting the torpedoes impulse into?

Some little tidbits of info: game restricts min torpedo depth to 1m. Max torpedo depth allowed is 50m (everytime you adjust torpedo depth on the torpedo box a function is called to ensure the value is clamped to these values)

Another constant: 0.1056457

This constant gets multiplied by some huge number (looks to be related to distance from game origin but not exactly sure still)

Last edited by TheDarkWraith; 05-05-12 at 06:05 PM.
TheDarkWraith is offline   Reply With Quote
Old 05-05-12, 06:06 PM   #2
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,153
Downloads: 901
Uploads: 73


Default

Quote:
Originally Posted by TheDarkWraith View Post
Another constant that I'm not sure how or why it's value is what it is:

1016.047

This value is multiplied by the torpedoes impulse (which is usually a value of 2000). What are they converting the torpedoes impulse into?

Some little tidbits of info: game restricts min torpedo depth to 1m. Max torpedo depth allowed is 50m (everytime you adjust torpedo depth on the torpedo box a function is called to ensure the value is clamped to these values)
I just googled it 1016.047 .
Long Ton to Kilograms
Maybe something to do with realistic measurements checked in the game options .
http://www.google.com.au/url?sa=t&rc...07FsGP9LohTVsA
THE_MASK is offline   Reply With Quote
Old 05-05-12, 07:22 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
I just googled it 1016.047 .
Long Ton to Kilograms
Maybe something to do with realistic measurements checked in the game options .
http://www.google.com.au/url?sa=t&rc...07FsGP9LohTVsA
Interesting So this impulse value (converted to Kgs) seems to be used to determine if the object it hits 'moves' or not probably...I'll flag that for follow up.

Just found where when the torpedo is initialized it's initial speed is multiplied by some factor (probably the torpedo speed ability). My question is just how reliable was the torpedo speed? For instance, if they set the torpedo speed to 30knots did the torpedo actually run at 30knots or was there some known deviation that could take place? This would be the perfect place for me to inject some code to model this deviation (if any happened in real life)

Found another intersting constant: 9.5
IIRC 9.5 is the acceleration rate in m/s2 right?

The game takes the torpedo speed and divides it by this number (9.5) and stores the result in memory

Last edited by TheDarkWraith; 05-05-12 at 08:08 PM.
TheDarkWraith is offline   Reply With Quote
Old 05-06-12, 02:30 PM   #4
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

9.8 is the accepted rate of free fall depending on several factors.
Do an extreme HALO and that rate is higher until you start getting into thicker air.
Somewhere around 9.72 (but you need to be above 90,000 feet to hit that mark!)
Newton couldn't go high enuff to see that part of the calculations.


I don't see why one would use that measurement for a Torpedo which is not in free fall, but on a horizontal travel path.
Even useing that for a sink rate would be wrong considering it's in salt water which has a different sink rate.

Last edited by Madox58; 05-06-12 at 02:50 PM.
  Reply With Quote
Old 05-07-12, 03:14 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
9.8 is the accepted rate of free fall depending on several factors.
Do an extreme HALO and that rate is higher until you start getting into thicker air.
Somewhere around 9.72 (but you need to be above 90,000 feet to hit that mark!)
Newton couldn't go high enuff to see that part of the calculations.


I don't see why one would use that measurement for a Torpedo which is not in free fall, but on a horizontal travel path.
Even useing that for a sink rate would be wrong considering it's in salt water which has a different sink rate.
Some clarification:

There is a constant that is loaded, 95, which is then converted into game units (95 X 0.1 = 9.5)
The current torpedo ordered speed (2.265997 - TI fastest speed in game units) is divided by the constant above (9.5) to yield a result (0.2385260) that is stored away. This result looks like how far torpedo moves in game units every second
TheDarkWraith is offline   Reply With Quote
Old 05-07-12, 03:36 PM   #6
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Now that makes alot more sense.


Nice work!
  Reply With Quote
Old 05-12-12, 08:17 AM   #7
Rongel
Grey Wolf
 
Join Date: Jan 2009
Location: Finland
Posts: 857
Downloads: 174
Uploads: 0
Default

Hi!

I have serious issues getting the new fixes to work... I downloaded the 4 meters magnetic detonation .sim-file, but still the torpedoes explode only when basicly touching the ship's bottom (I aimed at the center of the ship).
And the dud fix makes my computer freeze when there is a dud. Can't figure out why this doesn't work, could it be somekind of language incombatability, I have the european (scandinavian) copy of the game.

Any other results? Do the duds work for others? Must... get... this working...
Rongel is offline   Reply With Quote
Old 05-06-12, 08:32 PM   #8
CaliEs
Loader
 
Join Date: Oct 2011
Posts: 89
Downloads: 27
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
My question is just how reliable was the torpedo speed? For instance, if they set the torpedo speed to 30knots did the torpedo actually run at 30knots or was there some known deviation that could take place?
Torpedo speed runs during the entire route of 13km constantly with 30ktn accept at the acceleration phase, which is short and negligible.
__________________
Dietrich von Carlewitz, 2nd Lt.
U-29
CaliEs is offline   Reply With Quote
Old 05-07-12, 11:11 AM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

The one mystery that has always eluded me since SH3 has finally been solved While deep into the debugger I finally nailed down the function that clones the torpedo when it's launched (akin to Torpedo newtorpedo = new Torpedo() in C# language). This function loads all the default values (same as contructor initializing variables) for the new torpedo. The default heading for new torpedo is 0, the default depth is 2, etc. Now I know why torpedo always spawns heading north (ordered heading is 0). More importantly I have the memory address of where this default value is located Now one could change this memory address before firing a torpedo to ensure torpedo is heading in the right direction say for torpedo PT boats or the likes...
TheDarkWraith is offline   Reply With Quote
Old 05-07-12, 01:56 PM   #10
bigboywooly
Rear Admiral
 
Join Date: Apr 2006
Location: Swindon, England
Posts: 10,147
Downloads: 38
Uploads: 0
Default

be ideal if the heading could be changed.
Destroyers,PT boats and AI uboats could benefit as well as aircraft.
Maybe make the heading the same as the unit carrying them
__________________


My mediafire page http://www.mediafire.com/?11eoq19bq9r41
bigboywooly is offline   Reply With Quote
Old 05-07-12, 03:08 PM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by bigboywooly View Post
be ideal if the heading could be changed.
Destroyers,PT boats and AI uboats could benefit as well as aircraft.
Maybe make the heading the same as the unit carrying them
That's exactly my thinking...I've bookmarked that memory address for further follow up. Right now I'm still deep into torpedo code trying to figure out how the game models the magnetic detonator.
TheDarkWraith is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 12:50 AM.


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