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


Default Diving tank again

@H.sie:
You identified earlier a diving tank and another variable, tentatively thought to be possibly a depth rudder ( = hydroplane). (Seen at code SH3Sim.act + 0x7527, and indexed through register ecx.)

I have now checked out this code, and there appear to be five variables involved, all indexed by ecx. Since there is no way of identifying these by constant memory addresses, I shall identify them by the last three digits of their addresses (these last three digits are probably the same for you too). The values were checked for a simple dive (‘D’-key) from surface, and a crash-dive (‘C’-key) from surface, at TC = 1. I’m using a IXC boat.

xxxxx170: involved in dive + crash-dive. Value reaches a maximum of about +0.5235 in mid-dive, averages zero when at requested depth.
xxxxx05c: value remains steady at 0.0 throughout (dive + crash-dive). However, the calling code leads to:
xxxxx18C: involved in dive +crash-dive. This value rises rapidly from 0.0000 to 1.0000, and presumably represents the memory location of the diving tank.
xxxxx144: involved in dive + crash-dive. Value is frequently the negative value of xxxxx170, but the values differ slightly during the dive. Value averages zero when at requested depth.
xxxxx1A0: involved in crash-dive only. Value rises very fast from 0.0000 to 1.0000, faster than xxxxx18C. It appears to represent (correctly) a quick-diving tank for crash-dives. After the U-boat reaches the crash-dive depth, the value falls very fast to 0.5000.

Comments:
We know already that a crash-dive in SH3 reaches its depth (80 metres here) faster than a high-speed dive to 80 metres. This is obviously modelled correctly with SH3 - well done, devs.
The ‘crash-dive blues’ occurs when a crash-dive is interrupted by changing the depth before the crash-dive has completed. When this happens, the U-boat does not level out correctly, but has a downwards angle. The bug affects all the super-mods, but is particularly noticeable with NYGM.

When a crash-dive is interrupted, the value of xxxxx1A0 does not return to 0.5000, but remains at 1.0000. This is the only difference I have detected (yet) between a completed crash-dive, an interrupted crash-dive, and a simple dive. When the NYGM U-boat is set to slow ahead, after an interrupted crash-dive, it sinks. When the speed is set to half-ahead, the U-boat returns to the depth set by the player when he interrupted the crash-dive. There is *no difference* between the values of the five variables shown above in either circumstance.

This is hard to interpret. Is it possible that that xxxx170 and xxxxx144 can be hydroplanes/depth-rudders, and the difference in water flow over them at different submerged speeds causes a gain or loss of depth? That is how hydroplanes are intended to function. But in that case, why is there not a severe angle on the hydroplanes at slow underwater speeds, when the boat is sinking, but wishes to rise?

Stiebler.
Stiebler is offline   Reply With Quote