SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   Realism- and gameplay-related hardcode fixes for SH3.EXE (https://www.subsim.com/radioroom/showthread.php?t=174225)

h.sie 01-13-11 02:34 AM

Quote:

Originally Posted by Stiebler (Post 1573005)
@H.sie:

But I have discovered something else!
the q-d-tank is referenced by float [esi+438h].
the crash-dive flag is referenced by byte [esi+440h].

Stiebler.

@Stiebler: What's wrong with that? I don't see any problem.

Congratulations to your fix. I also have a fix that still has some problems. Short code but difficult, since it uses pointers. So as always: 2 solutions are better that none.

Your fix is only located in SH3Sim.act or does it also change sh3.exe?

h.sie

Stiebler 01-13-11 07:05 AM

Stiebler ‘Crash-Dive Blues’ Fix.
 
I have fixed the crash-dive blues.

Code principle is completely trivial:
IF (crash-dive-flag = 0) THEN quick-dive tank = 0.5000.

Of course, it took H.sie and me some time to discover all the key features. I myself wrote over one page of assembly code just to locate the quick-diving tank. Then I found it fixed at [esi+438h], so I could reduce all the code to a few lines!

The fix appears to solve all problems, even though it sets q-d-tank to 0.500 on surface, when value should be 0.000 (sometimes).

This code is also called uselessly every time there is a call to the hydroplanes. However, the code is so compact, that any code to avoid this useless recall would probably be a lot slower!

I've given everything a massive test under all dive conditions that I can think of: crash-dives, interrupted crash-dives by clicking on depth-gauge above and below crash-depth, conventional dives, orders to periscope depth, interrupted crash-dive with order to periscope depth, blowing ballast, resumed crash dives after interruption. *Everything" works well, with full stability at slow underwater speed.

I shall release the code for some bold testers after H.sie has examined it.

@H.sie:
You have a PM.
You need SH3SIm.act only, no need to alter sh3.exe.

Stiebler.

h.sie 01-13-11 07:25 AM

@Stiebler: That would be really great!!! I'll look into it ASAP.

One thing I ask myself: With your fix the q-d-tank is 0,5 instead of (as you wrote) 0.0 when surfaced. Doesn't this change the boats physics when surfaced, since the boats mass is higher??

h.sie

Stiebler 01-13-11 08:51 AM

Crash-dive Blues NOT fixed
 
I have found in further testing that the value of esi, used to point to the crash-dive flag and the q-d-tank, varies repeatedly in the vicinity of a convoy, and ultimately causes a serious computer crash (values written to wrong memory).

Back to the drawing-board.

@H.sie:
Quote:

One thing I ask myself: With your fix the q-d-tank is 0,5 instead of (as you wrote) 0.0 when surfaced. Doesn't this change the boats physics when surfaced, since the boats mass is higher??
I considered that, too. But the U-boat seems to ride perfectly well in the water on the surface.

I also considered if a residual value of 0.500 in the q-d-tank might affect depth-keeping after an interrupted crash-dive at periscope depth, or if it would affect rate of rising from deep waters. Or maybe the crash-dive rate might be affected.

None of these parameters seem to be affected enough to notice.

Stiebler.

h.sie 01-13-11 03:53 PM

@Stiebler: Good news: I was able to reconstruct direct pointers to the quick-dive tank and the crash-dive flag, so they both can easily be accessed & manipulated from the little controlling routine I programmed in sh3.exe for continuously watching/controlling multiple things (like snorkel speed restriction and so on). I don't have to patch Sh3Sim.act. So my fix will work very similar to yours, but without risking to write into wrong memory locations:

Immediately (or some seconds after) the crash-dive flag is set from 1 back to 0, I force q-d-tank=0,5 once.

And since the fix is active only in the special situation when crash-dive flag is switched from 1 back to 0, it won't affect other situations, e.g. when boat is surfaced.

That's it. Very optimistic that it will work.
h.sie

h.sie 01-13-11 05:14 PM

I think the "crash dive blues" is history. After some tests I think one can now interrupt the crash dive anytime without losing control of the boat. The fix is only active once, immediately after a crash dive is interrupted, that means: it does not affect boats physics in other situations. (Yeah!)

@Stiebler: Will send you a PM with a BETA version, including Fix code.

h.sie

Stiebler 01-14-11 11:53 AM

@H.sie,

Great work!

I shall test it immediately. You have a PM.

Stiebler.

Fubar2Niner 01-14-11 01:03 PM

@h.sie & @Stiebler

Geez guys, don't you ever take a break, I'm going to nominate you both for next years awards already :yeah:

Best regards.

Fubar2Niner

Magic1111 01-14-11 03:31 PM

Quote:

Originally Posted by Fubar2Niner (Post 1574144)
@h.sie & @Stiebler

I'm going to nominate you both for next years awards already :yeah:

Best regards.

Fubar2Niner

...yes, me too...:yeah::ping::yeah::up::yep:

h.sie 01-15-11 06:39 AM

Thanks guys. The best award for me is a working sim.

Waiting now for Stieblers final test results...........

Stiebler 01-15-11 09:59 AM

Nominate H.sie for the award, not me.

He does all the hard work.

Test results so far:
H.sie's fix for the Crash-dive blues works perfectly.

I have tested it in convoys with crash-dives, interrupted crash-dives, with damage, without damage, after air attacks, after destroyer attacks, with silent running, without silent running, and reloading after a saved game. Everything so far is perfect.

Stiebler.

h.sie 01-15-11 10:20 AM

Great! So I'm pleased to announce the "Fix for the Crash Dive Blues by h.sie and Stiebler" (whose idea I used in the fix) to be included in the forthcoming patch version V15E. But it will take some time to program the (external) torpedo reload issue.

Crash dive blues now is history!

h.sie

LGN1 01-15-11 10:24 AM

Great news, h.sie & Stiebler :up: I'm looking forward to V15E!

Cheers, LGN1

Delareon 01-15-11 03:05 PM

Does this also mean the bug where u cant save your game while dived should be fixed (because your boat sometimes sinks and you cant do anything against it)?
(Probably fixed of course always with the risk of a bug while in mass tests but....you know ;) )

Never experienced the bug myself because since i first heard about that bug from multiple sources i never tried it on my own.

fitzcarraldo 01-15-11 03:17 PM

Quote:

Originally Posted by h.sie (Post 1574759)
Great! So I'm pleased to announce the "Fix for the Crash Dive Blues by h.sie and Stiebler" (whose idea I used in the fix) to be included in the forthcoming patch version V15E. But it will take some time to program the (external) torpedo reload issue.

Crash dive blues now is history!

h.sie

Great news! Watching the new update...

Best regards.

Fitzcarraldo :salute:


All times are GMT -5. The time now is 04:15 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.