Quote:
Originally Posted by Fifi
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)