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 04-30-12, 09:34 AM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

I've noticed in other forums that people are misinterpreting the magnetic detonator fix. The magnetic detonator fix allows magnetic torpedoes to detonate on GR2 style ships AND dat style ships (dat style ships already worked because they have the required node attached to the root node). This magnetic detonator fix also fixes the problem of player's sub not incurring hull damage (decrease in hull %) from depth charges and bombs.

The GR2 style ships and some of the dat style ships are missing collision spheres everywhere but the center of the ship. This means magnetic detonators will only detonate near the middle of the ship. Furthermore the stock magnetic detonator range specified in the torpedoes .sim file is set to 2m so magnetic torpedo has to be very near center and very close to keel in order to detonate.

This should clear up any confusions.
TheDarkWraith is offline   Reply With Quote
Old 04-30-12, 09:55 AM   #2
Sartoris
Captain
 
Join Date: May 2011
Posts: 489
Downloads: 106
Uploads: 0
Default

Thank you soooo much, TDW!

If I modified the exe (used the hydrophone fix) with the previous version, then deactivated it, and am now using the new version of the patcher, do you think it could cause some damage to the game's files? Should I reinstall the game and then use the new version of the patcher or is it safe to patch with different versions?
Sartoris is offline   Reply With Quote
Old 04-30-12, 02:21 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Sartoris View Post
Thank you soooo much, TDW!

If I modified the exe (used the hydrophone fix) with the previous version, then deactivated it, and am now using the new version of the patcher, do you think it could cause some damage to the game's files? Should I reinstall the game and then use the new version of the patcher or is it safe to patch with different versions?
The patcher app does nothing but read the patch files and apply/deapply them. The version of the patcher app has no bearing on it's functionality or lack of. There is no need to reinstall. Different versions can apply/remove another versions patch without problems
TheDarkWraith is offline   Reply With Quote
Old 04-30-12, 10:37 AM   #4
col_Kurtz
XO
 
Join Date: Mar 2008
Posts: 424
Downloads: 341
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
I've noticed in other forums that people are misinterpreting the magnetic detonator fix. The magnetic detonator fix allows magnetic torpedoes to detonate on GR2 style ships AND dat style ships (dat style ships already worked because they have the required node attached to the root node). This magnetic detonator fix also fixes the problem of player's sub not incurring hull damage (decrease in hull %) from depth charges and bombs.

The GR2 style ships and some of the dat style ships are missing collision spheres everywhere but the center of the ship. This means magnetic detonators will only detonate near the middle of the ship. Furthermore the stock magnetic detonator range specified in the torpedoes .sim file is set to 2m so magnetic torpedo has to be very near center and very close to keel in order to detonate.

This should clear up any confusions.
Yes - noticed that.
In Historical mission with Cimmaron I sent three torps (11m depth - the tanker draft is 10,5m) So. I aimed and shot 1. at bow, 2. at bridge (under bridge - keel) and 3. rudder. Just for test. Results:
1st torp blow up under bow - good, the 2nd one blow up under the bridge - almost mid of the ship. And the 3rd passed under rudder. No worked. This is kind of lucky, maybe this is very close to realism too I mean another dude torpedo. I think it`s fair IMO
I played to December 1940 last time and I noticed only 3 or 4 dudes torps. This is strange am I right (300 000 Brt +)? I mean should be a bit more. I used only G7a torps.
The only thing I wish for this, it`s a set up torpedo a bit deeper (bigger tolerance ) - I don`t know is it possible - not sure about mechanism discribed by you above. It is really hard to set up by dragging the depth from 10.5 to 11m. 11.1m is to deep I`m affraid.

Anyway I appreciate your hard job and thank you so much,
Kurtz
__________________


DRM it`s a horror, horror... col. Kurtz Apocalypse Now
WinXP Pro SP3 2x1GB Geil 800Mhz DDR2, ATI 4850 Asus Top, E2160 1.80 Ghz overlocked to 2.79Ghz MoBo Asus P5b
col_Kurtz is offline   Reply With Quote
Old 04-30-12, 02:22 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by col_Kurtz View Post
The only thing I wish for this, it`s a set up torpedo a bit deeper (bigger tolerance ) - I don`t know is it possible - not sure about mechanism discribed by you above. It is really hard to set up by dragging the depth from 10.5 to 11m. 11.1m is to deep I`m affraid.

Anyway I appreciate your hard job and thank you so much,
Kurtz
I'll release a modifed torpedoes .sim file that increases the magnetic detonator range of the torpedoes to 4m here soon.
TheDarkWraith is offline   Reply With Quote
Old 04-30-12, 04:03 PM   #6
col_Kurtz
XO
 
Join Date: Mar 2008
Posts: 424
Downloads: 341
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
I'll release a modifed torpedoes .sim file that increases the magnetic detonator range of the torpedoes to 4m here soon.
Ayey
__________________


DRM it`s a horror, horror... col. Kurtz Apocalypse Now
WinXP Pro SP3 2x1GB Geil 800Mhz DDR2, ATI 4850 Asus Top, E2160 1.80 Ghz overlocked to 2.79Ghz MoBo Asus P5b
col_Kurtz is offline   Reply With Quote
Old 04-30-12, 05:20 PM   #7
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Torpedo magnetic detonators set to 4m download can be found at bottom of post #1
TheDarkWraith is offline   Reply With Quote
Old 04-30-12, 05:31 PM   #8
volodya61
Ocean Warrior
 
volodya61's Avatar
 
Join Date: Feb 2012
Location: Rostov-on-Don, local time GMT+4
Posts: 3,292
Downloads: 374
Uploads: 0


Default

Good news, thanks

EDIT: FX update 0.19 has the same files, overwrite them?

EDIT: FX update that's why I thought that the patch for fixing broken magnetic detonator doesn't work for dat-models

PS: And now everything work great
__________________
.
Where does human stupidity end?

.


El sueño de la razón produce monstruos © - and for some people awakening will be cruel

Last edited by volodya61; 04-30-12 at 07:40 PM.
volodya61 is offline   Reply With Quote
Old 04-30-12, 09:00 PM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Today I finally narrowed down the routine that checks the torpedo impact angle when it collides with an object. I have to say my first reaction to the code was a huge WTF? I'm still trying to digest and figure out what the hell they were thinking. There's a lot of multiplication of fractions into the result that I can't for the life of me figure out why. It should be a simple test of:

for all min and max angles defined:
if max angle < torp impact angle < min angle then get random value. If random value < dud % chance torp is dud

But no, they have this complicated mess of multiplications and taking the cos value of something I have to try and figure out what this mess means.

For testing I set the dud % chance to 100% in the torpedo sim file for every angles defined. That way I know for sure I should have a dud on impact. But stepping through the debugger I always see the code say no dud So for fun I changed the code so that every torpedo impact was a dud. This is interesting: instead of 'dying' and sinking to the bottom it kept bouncing on the side of the ship until it could get by and then just kept going. I got the message that torpedo was a dud also. Not quite sure what to make of that

Maybe you all can help me figure this out:

So game says collision imminent! Code jumps to routine that checks for impact. Impact detected. Now it checks torpedo impact angle:

first thing it does is appears to store the torpedo impact angle on the floating point stack (-0.9527535438537597656 in this case)
next it stores 0.0174532923847436905 on the floating point stack (does this constant mean anything to anyone?)
then it loads the max angle allowed to the floating point stack (90.0 in this case)
then it multiplies these two values together (0.0174532923847436905 X 90.0). Why? Is this trying to convert to radians?
the result of that multiplication is 1.5707963146269321440 (looks like a radian value)
then it takes the COS of that value
result of that is 1.2167964475064260060E-08
then it swaps the torpedo impact angle ST2 (-0.9527535438537597656) with the result ST0 (1.2167964475064260060E-08) so that the torpedo impact angle is at top of floating point stack (result resides in ST2, torpedo impact angle in ST0)
then a floating point compare is performed of ST2 (1.2167964475064260060E-08) against the stack top ST0 (-0.9527535438537597656) and stores the results in the Integer FLAGS (EFLAGS) register
then ST2 is popped from the floating point stack
then if result of compare is below (CF=1 of EFLAGS register) then it increments a counter and loads pointers to the next set of angles. I see a problem here: the other angle of the set is never checked. The only time the second angle (which would be the min angle) is checked is if the floating compare is above (CF=0). Then if the result of that second angle is not below (CF=0) then jump to calculate dud % chance else torp explodes.

As you can see this will always jump to torpedo impact! Something is wacky here and I'm just not seeing it...

It needs to be coded so that it's checking the min and max angles before jumping to next set of angles. This way if the torp angle falls within the min and max angles then the dud % chance can be calculated. With the code as it is it never even checks the dud % chance thus we never get any duds

Last edited by TheDarkWraith; 04-30-12 at 09:52 PM.
TheDarkWraith is offline   Reply With Quote
Old 05-01-12, 05:04 PM   #10
col_Kurtz
XO
 
Join Date: Mar 2008
Posts: 424
Downloads: 341
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Torpedo magnetic detonators set to 4m download can be found at bottom of post #1
Tested Historical mission with unfortunate Cimmaron. Depth max - 12meters 3 times in a row. I broke she in a half again Superb!
At first time each of three torps blowed up. Next time, two times blowed up. And the last test two times again All with external view.

Thanks a lot TDW!
__________________


DRM it`s a horror, horror... col. Kurtz Apocalypse Now
WinXP Pro SP3 2x1GB Geil 800Mhz DDR2, ATI 4850 Asus Top, E2160 1.80 Ghz overlocked to 2.79Ghz MoBo Asus P5b
col_Kurtz is offline   Reply With Quote
Old 04-30-12, 10:46 AM   #11
volodya61
Ocean Warrior
 
volodya61's Avatar
 
Join Date: Feb 2012
Location: Rostov-on-Don, local time GMT+4
Posts: 3,292
Downloads: 374
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
I've noticed in other forums that people are misinterpreting the magnetic detonator fix. The magnetic detonator fix allows magnetic torpedoes to detonate on GR2 style ships AND dat style ships (dat style ships already worked because they have the required node attached to the root node). This magnetic detonator fix also fixes the problem of player's sub not incurring hull damage (decrease in hull %) from depth charges and bombs.

This should clear up any confusions.
Thanks for the explanation.
__________________
.
Where does human stupidity end?

.


El sueño de la razón produce monstruos © - and for some people awakening will be cruel
volodya61 is offline   Reply With Quote
Old 04-30-12, 02:32 PM   #12
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by volodya61 View Post
Thanks for the explanation.
I see your explanation on sukhoi is incorrect. There are two patch files required for the CO2 bug fix. You need to open TDW_SH5_Patches.s5p and apply Patch 5 (both changes). Then you also need to open TDW_SHSim_Patch.s5p and apply Patch 1 (all 3 changes). Then the CO2 bug will be fixed
TheDarkWraith is offline   Reply With Quote
Old 04-30-12, 03:24 PM   #13
volodya61
Ocean Warrior
 
volodya61's Avatar
 
Join Date: Feb 2012
Location: Rostov-on-Don, local time GMT+4
Posts: 3,292
Downloads: 374
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
I see your explanation on sukhoi is incorrect. There are two patch files required for the CO2 bug fix. You need to open TDW_SH5_Patches.s5p and apply Patch 5 (both changes). Then you also need to open TDW_SHSim_Patch.s5p and apply Patch 1 (all 3 changes). Then the CO2 bug will be fixed
Thanks again TDW, but explanation describes changes to both files: sh5.exe and SHSim.act

Look at screen, please:

__________________
.
Where does human stupidity end?

.


El sueño de la razón produce monstruos © - and for some people awakening will be cruel
volodya61 is offline   Reply With Quote
Old 04-30-12, 03:54 PM   #14
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by volodya61 View Post
Thanks again TDW, but explanation describes changes to both files: sh5.exe and SHSim.act

Look at screen, please:
ah ok! My Russian is non-existent. Google translate is the only way I can read your language
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 03:03 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.