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 12-17-10, 12:20 PM   #1
PL_Andrev
Grey Wolf
 
Join Date: Feb 2009
Posts: 995
Downloads: 91
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
And yes track angle does change when you change torpedo speed, AOB, or target speed.
t_torp - time when torpedo is hit to target
v_ship - target speed
r_ship - last calculated distance to target
AoB - AoB
t_angle - track angle

'calculate all angles in triangle (uboat-target-hit.point)
aux.angle = 180-AoB- (90-t_angle)

'law of sine to calculate intervals (ways) of ship/torpedo
s_ship = r_ship * sin(aux.angle) / sin(90-t_angle)
s_torp = r_ship * sin(AoB) / sin(90-t_angle)

'to hit torp.time = ship.time
t_torp = s_ship / v_ship

When you change the torpedo speed the track angle is changed, so v_speed value is included at t_angle.
__________________

PL_Andrev is offline   Reply With Quote
Old 12-17-10, 03:38 PM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Antar View Post
t_torp - time when torpedo is hit to target
v_ship - target speed
r_ship - last calculated distance to target
AoB - AoB
t_angle - track angle

'calculate all angles in triangle (uboat-target-hit.point)
aux.angle = 180-AoB- (90-t_angle)

'law of sine to calculate intervals (ways) of ship/torpedo
s_ship = r_ship * sin(aux.angle) / sin(90-t_angle)
s_torp = r_ship * sin(AoB) / sin(90-t_angle)

'to hit torp.time = ship.time
t_torp = s_ship / v_ship

When you change the torpedo speed the track angle is changed, so v_speed value is included at t_angle.
I see one problem with this - what happens when target speed is 0 (division by 0 not allowed)

Plus I think this is overcomplicated - we should be able to simply take distance to target / torp speed to find time to impact

EDIT:

ok, after thinking it over we do need to calculate like you posted Antar in order to take into account target's speed.

I don't see how you are factoring in torp speed into this calculation?

EDIT2:

Seems to be a problem with this calculation. Time value is going positive and negative like a sin function...

track angle and angle on bow are values of -180 to 180 (not 0 to 360). That might be why.

EDIT3:

math functions don't like it when you pass them angles instead of radians...so now time is steady but the time increases as the target gets closer.....

Are we not doing anything with s_torp?? The division by 0 is still a problem also

Last edited by TheDarkWraith; 12-17-10 at 04:18 PM.
TheDarkWraith is offline   Reply With Quote
Old 12-17-10, 04:27 PM   #3
PL_Andrev
Grey Wolf
 
Join Date: Feb 2009
Posts: 995
Downloads: 91
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
1. I see one problem with this - what happens when target speed is 0 (division by 0 not allowed)

2. Plus I think this is overcomplicated - we should be able to simply take distance to target / torp speed to find time to impact

EDIT:

ok, after thinking it over we do need to calculate like you posted Antar in order to take into account target's speed.

3. I don't see how you are factoring in torp speed into this calculation?

EDIT2:

4. Seems to be a problem with this calculation. Time value is going positive and negative like a sin function...

5. track angle and angle on bow are values of -180 to 180 (not 0 to 360). That might be why.
See my comments in yellow.

1. When the target speed is 0 these calculations have no sense,
and the time impact = range / torp_speed

2. There is no easy way to calculate it, this is the reason why torpedo electromechanical computer was on uboats...

3. The torpedo speed create a different track angle, so we do not need special calculations for torpedo speed,

4. First you calculate ship and torp distance, they should be positive both.
Check the angles they should be positive. Check the angle calculations. Aux.angle should be positive.
AoB + aux.angle + (180-torp.angle) = 180

5. AoB and track angle on my calculations should be 0-180 only.
Keep positive only (AoB, track_angle) - the sign +/- depend from target's direction course. They should be positive or negative both together.

6. There are mistake in calculations:
aux.angle = 180 - AoB - (180 - t_angle)
s_ship = r_ship * sin(aux.angle) / sin(180-t_angle)
s_torp = r_ship * sin(AoB) / sin(180-t_angle)

For me the 'degree' are more natural than radians, (but you have AoB, tarck angle in degrees too).
It is no problem to use radians - only change is: 180° = 3,1415rad (pi number)
__________________

PL_Andrev is offline   Reply With Quote
Old 12-17-10, 05:16 PM   #4
Trevally.
Navy Seal
 
Join Date: Apr 2007
Location: AN1536 (Orkney)
Posts: 5,448
Downloads: 166
Uploads: 28


Default

The game has "torp run time" already.

If you look at mav map (torp solution line on) and adjust any range setting, a time is displayed at end of line.

Could this be used?
__________________
Trevally Mods for SH5
Trevally. is offline   Reply With Quote
Old 12-17-10, 05:20 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v5.7.0 released. See post #1 for details

to those who tested this, you'll need to download this as more errors/bugs were fixed.

I'll be out snowboarding this weekend so I'll attend to any bugs/errors/etc. when I return

Last edited by TheDarkWraith; 12-17-10 at 05:41 PM.
TheDarkWraith is offline   Reply With Quote
Old 12-17-10, 08:39 PM   #6
SashaKA001
中国水兵
 
Join Date: Mar 2010
Location: 47°46′46″N, 37°14′51″E
Posts: 271
Downloads: 231
Uploads: 0
Default

if very close to put a marker on the boat, the game freezes.
and the markers are put through again.

Last edited by SashaKA001; 12-17-10 at 09:05 PM.
SashaKA001 is offline   Reply With Quote
Old 12-18-10, 03:18 AM   #7
Flash_1208
Bilge Rat
 
Join Date: Dec 2010
Posts: 1
Downloads: 13
Uploads: 0
Default

i'm new here and have one question.

i downloaded your fantastic ui_tdc mod for sh5, but how can i change the sh5 style in sh4 style.

greetings

flash
Flash_1208 is offline   Reply With Quote
Old 12-18-10, 10:41 AM   #8
pfeillant
Watch
 
Join Date: Nov 2010
Posts: 28
Downloads: 13
Uploads: 0
Default Can't determinate current position

hello,
here the error window
http://www.cijoint.fr/cjlink.php?fil...cijeRAUuIH.png

i don't know how enable real nav.

In this exemple, i just
1- start the game
2- put the crew at the flag
3- teleport at the flag

and i have the problem, without any aircraft
pfeillant is offline   Reply With Quote
Old 12-18-10, 10:57 AM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by pfeillant View Post
hello,
here the error window
http://www.cijoint.fr/cjlink.php?fil...cijeRAUuIH.png

i don't know how enable real nav.

In this exemple, i just
1- start the game
2- put the crew at the flag
3- teleport at the flag

and i have the problem, without any aircraft
Put the crew at the flag....you must mean you are topside ondeck? Where do you teleport to? This only happens when you teleport to this place? Any add-on mods enabled?

What do you have for these user options:

# minimum value for below is 1
MessageBoxWidthFactor = 2.25 # stock is 2

# minimum value for below is 1
MessageBoxHeightFactor = 5.0 # stock is 3

# this will cause the message box to start in the expanded mode (vertically) when the game starts
# change below to either True or False
MessageBoxStartsExpanded = True

# this will cause the message box to start in widened mode (horizontally) when the game starts
# change below to either True or False
MessageBoxStartsWidened = False

# is the message box displayed at game start?
# change below to either True or False
DisplayTheMessageBox = True

# is the messagebox draggable?
# change below to either True or False
MessageBoxIsDraggable = False

# does the messagebox show when moused in and hide when moused out?
MessageBoxScrolls = False
TheDarkWraith is offline   Reply With Quote
Old 12-18-10, 07:19 AM   #10
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 73
Uploads: 0
Default

Quote:
Originally Posted by Antar View Post
See my comments in yellow.

1. When the target speed is 0 these calculations have no sense,
and the time impact = range / torp_speed

2. There is no easy way to calculate it, this is the reason why torpedo electromechanical computer was on uboats...

3. The torpedo speed create a different track angle, so we do not need special calculations for torpedo speed,

4. First you calculate ship and torp distance, they should be positive both.
Check the angles they should be positive. Check the angle calculations. Aux.angle should be positive.
AoB + aux.angle + (180-torp.angle) = 180

5. AoB and track angle on my calculations should be 0-180 only.
Keep positive only (AoB, track_angle) - the sign +/- depend from target's direction course. They should be positive or negative both together.

6. There are mistake in calculations:
aux.angle = 180 - AoB - (180 - t_angle)
s_ship = r_ship * sin(aux.angle) / sin(180-t_angle)
s_torp = r_ship * sin(AoB) / sin(180-t_angle)

For me the 'degree' are more natural than radians, (but you have AoB, tarck angle in degrees too).
It is no problem to use radians - only change is: 180° = 3,1415rad (pi number)
Don't forget that torpedo makes an initial run-away then turns and only then it heads towards ship, so it is not a straight line from you to the ship unless you are shooting straight ahead. I guess we don't know the run-away distance and the turn radius however the error is not going to be huge, 5 secs at max.

Here are the formulae to convert degrees into radians and back:
radians = degrees * pi() / 180
degrees = radians * 180 / pi()

EDIT: I guess the game takes the run-away and the turn into account when showing the tracking angle so we can consider that the path is straight. Then there is no error in Antar's calculations.

EDIT2: Can the torpedo run time be reflected by the red needle on the chrono? I.e. the same as in vanilla when you fire it but before the launch?

Last edited by Vanilla; 12-18-10 at 07:32 AM.
Vanilla is offline   Reply With Quote
Old 12-18-10, 07:27 AM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

just noticed a crash when returning from a mission and then going to request a new mission (campaign). I found the cause of it and I'll have to release a new version to fix it. So I'll be releasing v5.7.1 here soon.

Here are some of the other things I have noticed and fixed also:
v5.7.1 - fixed bug of navigation fixes not cleared (reset) at game end
- fixed bug of navigation fixes visible on navigation map while receiving new mission orders
- fixed possible game hang when setting new navigation fix close to actual boat's position
- fixed game crash that happens when in campaign and you do a mission then return to base and request a new mission

These navigation fixes are kicking my butt. Price to pay for adding something entirely new to the game But once these are sorted out adding the super marks will be a breeze.

Patch 1 released for v5.7.0. See post #1 for details.

Last edited by TheDarkWraith; 12-18-10 at 08:10 AM.
TheDarkWraith is offline   Reply With Quote
Old 12-18-10, 09:11 AM   #12
PL_Andrev
Grey Wolf
 
Join Date: Feb 2009
Posts: 995
Downloads: 91
Uploads: 0
Default

I do not see the link to newest 5.7.0, the patch (97kB) only...
__________________

PL_Andrev is offline   Reply With Quote
Old 12-18-10, 09:51 AM   #13
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 73
Uploads: 0
Default

BTW, forgot to mention - there is another division by zero issue - if the tracking angle is 0 or 180 then sine of it is zero as well.

In the cases of zero divisions we need to use torpedo speed and that returns us to the problems with torpedo run away and turn times.
Vanilla is offline   Reply With Quote
Old 12-18-10, 03:59 PM   #14
pfeillant
Watch
 
Join Date: Nov 2010
Posts: 28
Downloads: 13
Uploads: 0
Default I'll be out snowboarding this weekend

hello,
go to your snowboarding.
Whe, in france, whe go to sleep under the snow.
bye
pfeillant is offline   Reply With Quote
Old 12-18-10, 04:30 PM   #15
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by pfeillant View Post
hello,
go to your snowboarding.
Whe, in france, whe go to sleep under the snow.
bye
temp is 6F today with windchills in the -9F. Too cold for snowboarding Tomorrow is high of 22F, good conditions for snowboarding v5.7.2 will be releasing here soon. You'll have to let me know if it cures the problem you reported or not
TheDarkWraith is offline   Reply With Quote
Reply

Tags
dbrn, favorite, new ui

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 02:52 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.