View Single Post
Old 01-01-11, 02:07 PM   #780
Stiebler
Fuel Supplier
 
Stiebler's Avatar
 
Join Date: Oct 2005
Location: London, UK
Posts: 1,237
Downloads: 29
Uploads: 4


Default

@H.sie:
[Happy New Year!]

Quote:
Edit: In Sh3Sim.act+30DF5 one can find some interesting code. According to this code the current depth of the Sub is coded in float format and gets more negative when sub is deeper under water, so it's something like a Z-position. if you set it to +10, the sub can fly. Cool. There is also a depth change value dZ. If it's positive, the z-value is rising, otherwise falling.

Sh3Sim.act+30DF5:
fld [esp+30] // Loads depth change value dZ
fadd [esi+b4] // Adds dZ to current Z value, Z := Z + dZ
fstp [esi+b4] // stores new Z-value.

Now I need to know how this depth change value dZ in [esp+30] is calculated.
Many thanks for this information.

But why do you need to know how dZ is calculated?

Much simpler just to insert some code with a test for the silent-running state.
If true, then subtract a small value 'delta' from the new Z-value. Otherwise, leave the Z-value alone.

That seems to provide a complete solution. The only issue is how large the value should be for 'delta', and I think only testing will provide the answer.

Concerning problems of reloading torpedoes:
1. I think 10 minutes to dive is correct, if the reloading is interrupted by an attack.
2. I do not think that there is a problem with the issue of bad weather interrupting the reloading. The reason is due to the difficulty to the player of discovering when the weather is good enough to start reloading. The player, using time compression, will always start reloading long after the weather is good enough. Therefore, it is fair (equitable) as compensation that reloading should be allowed to continue even if bad weather commences.

Stiebler.
Stiebler is offline   Reply With Quote