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 03-26-13, 05:33 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Here's a question/something to test:

Can you totally drain the batteries? I mean does battery level ever go to 0% and you lose propulsion? Looking at the game code here (just stumbled onto it ) it suggests that if current battery capacity < 0.001 then set current battery capacity to 0.001 thus meaning you can never deplete the batteries fully Can someone test this and report on it
TheDarkWraith is offline   Reply With Quote
Old 03-26-13, 05:52 PM   #2
Fifi
Navy Seal
 
Fifi's Avatar
 
Join Date: Dec 2012
Location: France
Posts: 6,254
Downloads: 510
Uploads: 0


Default

You are right TDW!!
Flank speed underwater, i fall to 2% (and never can go under this value) but speed finally fall to 1 knot...and i can navigate submerged for ever! (unless i have no more CO2)
So batteries never can stop...this is a major bug you have to fix IMO!!
Fifi is offline   Reply With Quote
Old 03-26-13, 05:58 PM   #3
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Here's a question/something to test:

Can you totally drain the batteries? I mean does battery level ever go to 0% and you lose propulsion? Looking at the game code here (just stumbled onto it ) it suggests that if current battery capacity < 0.001 then set current battery capacity to 0.001 thus meaning you can never deplete the batteries fully Can someone test this and report on it
Quote:
Originally Posted by Fifi View Post
You are right TDW!!
Flank speed underwater, i fall to 2% (and never can go under this value) but speed finally fall to 1 knot...and i can navigate submerged for ever! (unless i have no more CO2)
So batteries never can stop...this is a major bug you have to fix IMO!!
Maybe this is a life buoy devs left in the code for us
gap is offline   Reply With Quote
Old 03-26-13, 06:14 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Fifi View Post
You are right TDW!!
Flank speed underwater, i fall to 2% (and never can go under this value) but speed finally fall to 1 knot...and i can navigate submerged for ever! (unless i have no more CO2)
So batteries never can stop...this is a major bug you have to fix IMO!!
Assembly code doesn't lie

Quote:
Originally Posted by gap View Post
Maybe this is a life buoy devs left in the code for us
Unrealistic. Time to patch this out I'm looking for a battery drain curve and so far I'm not finding it. Appears devs have simple battery drain - linear. Real life this is an exponential curve where the curve falls off quickly towards the end of the battery's capacity (ex-Navy Nuke EM here ) . Looks like have to code that in if I can't find it also.
TheDarkWraith is offline   Reply With Quote
Old 03-26-13, 07:08 PM   #5
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Unrealistic. Time to patch this out I'm looking for a battery drain curve and so far I'm not finding it. Appears devs have simple battery drain - linear. Real life this is an exponential curve where the curve falls off quickly towards the end of the battery's capacity (ex-Navy Nuke EM here ) . Looks like have to code that in if I can't find it also.
some typical charge/discharge curves for lead acid batteries (the ones used on U-boats), in case you needed for them:

http://www.ibt-power.com/Lead_acid_t...cid_tech.html#
http://www.yuasaeurope.com/en-gb/ind.../products/npl/

The graphs available from the above links are relative to modern batteries, indeed, but hopefully they didn't change that mutch since WWII
gap is offline   Reply With Quote
Old 03-26-13, 07:45 PM   #6
Fifi
Navy Seal
 
Fifi's Avatar
 
Join Date: Dec 2012
Location: France
Posts: 6,254
Downloads: 510
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
Time to patch this out
Good luck with it! I'm sure you'll offer a nice fix as usual
Luckily you are here
Fifi is offline   Reply With Quote
Old 03-26-13, 08:10 PM   #7
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Fifi View Post
Good luck with it! I'm sure you'll offer a nice fix as usual
Luckily you are here
Oh I just stumbled onto a gold mine that I've been waiting to discover

alright put your thinking caps on

Here's the problem: the below defines how the game gets the speed in knots from ordered speed (ordered speed in range -1.0 to 1.0). I can't figure it out

VIIC submerged (12m) with no snorkel so using electric engines. Ordered speed set to 0.1. Current speed is 0 knots:

Loads something dealing with engine into XMM1 (3.913995) <----- what is this number? This number is something dealing with the electric engines
multiplies XMM1 by ordered speed (0.1) - ordered speed in range -1.0 to 1.0
XMM1 now equals 0.3913995
compares 0.0 to XMM1
If after then do something with it - ours is before so it's good
compares XMM1 to 0.0
if before or equal then jump - ours is after so:
loads XMM2 (1.0) into a stack variable
compares XMM0 (0.0) to XMM1
loads XMM1 into XMM0 (XMM0 now equals 0.3913995)
if after then do something - ours is before so it's good
loads constant 0.333333 (1/3) onto top of floating point stack
adds XMM2 (1.0) to XMM0 (0.3913995) thus XMM0 now equals 1.3913995
divides XMM0 by 559500.0 <---- what is this number? This number is something dealing with the electric engines
XMM0 = 2.486862e-06
multiplies XMM0 by 7432.328 <---- what is this number? This number is something dealing with the electric engines
XMM0 = 0.01848318
multiplies XMM0 (0.01848318) by XMM1 (0.3913995)
XMM0 = 0.007234306
multiplies XMM0 (0.007234306) by XMM1 (0.3913995)
XMM0 = 0.002831504
raises XMM0 to the 0.3333333 power (why the 0.3333333 power?)
XMM0 = 0.1414726026023053196
multiplies XMM0 by 30.99133 <---- what is this number? This number is something dealing with the electric engines
XMM0 = 4.3844245387299654350 which is the new speed of the sub in knots
multiplies XMM0 by direction (1.0 = forward, -1.0 = reverse) - we are going forward
saves XMM0 to engine's speed in knots memory address

Anyone make any sense of this

I need to figure this out so I can try and code in something that decreases the engine's efficiency (wear) over time (time being career)
TheDarkWraith is offline   Reply With Quote
Old 03-26-13, 08:57 PM   #8
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Sorry, I have no idea about those numbers

but I have noticed that in describing the whole process you used often the words before and after as if you were sure that the discussed variables are times. Is it so, or am I misunderstanding your reasoning?
gap 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 11:22 PM.


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.