SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
01-10-11, 07:19 AM | #871 | |
Fuel Supplier
|
Quote:
[Edit:] And thanks for the code idea. I shall try to find the relevant code. Stiebler.
__________________
NYGM Tonnage War Mod - More than a mod: it's an experience! |
|
01-10-11, 07:36 AM | #872 | |
Grey Wolf
Join Date: Feb 2007
Location: CG 96
Posts: 861
Downloads: 22
Uploads: 0
|
Quote:
|
|
01-10-11, 07:41 AM | #873 |
Admiral
|
It's common for modern 3D games, which are programmed object oriented with many objects including other objects and so on.
Class Submarine - contains sections - containing subsections - containing machines - containing damage counter. Compiling/Linking the example above leads to a pointer of at least 5th order. |
01-10-11, 08:02 AM | #874 |
Pacific Aces Dev Team
|
@Stiebler and H.Sie
This is excellent news! I hope that better comprehension of the tanks model for the game can help both making a better Anti-Humming-Bird mod, and a feature I think would be worth adding: - A % random chance of crash dives getting out of control, as it happened in real life, with a risk of getting below crash depth and crushing. Ideally more probable with greener crew, but this would probably be too complicated.
__________________
One day I will return to sea ... |
01-10-11, 09:11 AM | #875 |
Admiral
|
Funny: The more progress I, or better WE, make the more wishes arise. To be honest: After fixing the crash dive blues (together with Stiebler) and after progging the external torpedo issue, I really plan to PLAY a sh3 career for the first time. I don't even know if I will like this game.
|
01-10-11, 09:51 AM | #876 |
Seaman
Join Date: Feb 2010
Posts: 36
Downloads: 64
Uploads: 0
|
See how easily and realistically performed control ballast tanks in the next little game-http://www.purely-games.com/unusual_submarine_game.html
Similar simulator at the Museum of Science and Industry in Chicago-http://www.msichicago.org/whats-here...nce-challenge/ Something like this implemented in GWX and NYGM would be a major step toward realistic management of U-boat.
__________________
Last edited by Silent Ace; 01-15-11 at 02:22 AM. |
01-10-11, 09:55 AM | #877 |
Admiral
|
@Stiebler: I discovered an Crash Dive Flag (Byte) which is 1 only during crash dive and 0 otherwise, this could be used to control / fix the fast-dive-tank.
Simply writing repeatedly 0,5 into the memory won't help, since the program will repeatedly overwrite it again, so we'll have some dirty oscillation, which could result in a helicopter instead of a submarine. so it will be necessary to do some re-engineering and find the right code (the phyisical model behind that all) to fix. I'll also look at it in the next days. Really interesting. |
01-10-11, 11:46 AM | #878 |
Fuel Supplier
|
@H.sie:
Your previous post acknowledged with thanks. It is necessary for me, once again, to try to discover which memory locations are associated with the quick-dive tank, as I try to discover the code associated with this tank. Ho hum. Stiebler.
__________________
NYGM Tonnage War Mod - More than a mod: it's an experience! |
01-10-11, 11:56 AM | #879 |
Fuel Supplier
|
@H.sie:
Is the crash-dive flag cancelled (=0) after an interrupted crash-dive? If so, the programming solution should be fairly simple. Check the flag, and always set the quick-tank variable to 0.5000 if the flag is cancelled. Doubtless this 'simple' solution will not work, or will become more complicated. Stiebler.
__________________
NYGM Tonnage War Mod - More than a mod: it's an experience! |
01-10-11, 11:58 AM | #880 |
Admiral
|
@Stiebler: For code finding purposes, I often look into the stack. The return adresses in the stack tell me, which routines called my routine, and so I often find the code I search for (stack trace). Also, the stack contains the arguments of the function calls, which also can help.
I'll be able to sit in front of my modding PC in 2 days. Unfortunately. So I don't remember all details of this flags behaviour. But one can find it easily. h.sie |
01-10-11, 01:23 PM | #881 |
Admiral
|
@Hitman: On the other hand: if we manage to fix the crash dive bug, we can easily add a certain chance that the crash dive ends on the ground of the ocean.
|
01-10-11, 02:51 PM | #882 | ||
Ace of the Deep
Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
|
Hi all,
when we discussed the compressed air topic I realized that you consume compressed air when you order a crash dive. My assumption was that the compressed air was used for blowing the quick diving tank. When you interrupt the crash dive this does not happen. Maybe this can help you to solve the crash dive blues 'Give the order' to blow the quick diving tank? Quote:
Quote:
See our old discussion on page 52 and my comment there: http://www.subsim.com/radioroom/show...&postcount=771 Cheers, LGN1 |
||
01-11-11, 08:18 AM | #883 |
Fuel Supplier
|
@H.sie:
The crash-dive routine is as follows: The quick-dive tank is filled very fast. In order to see the filling, one has to make a break in the code at Sh3Sim.act+0x8527 immediately after pressing key 'C' (for crash-dive). The relationship of key variables is this: hydroplane (A) = (relative 0) hydroplane (B) = hydroplaneA + 2C diving tank = hydroplaneB + 1C quick-dive tank= diving tank + 0x14 I've verified these relative values over four different cold starts of SH3 now, but you have to identify one of these starting variables first. The quick-dive tank starts at 0.5000 (not at 0.0000, as I thought previously), and rises to 1.0000. At a depth of about 35-39 metres (it varies even with the same IXC U-boat), the quick-dive tank starts to empty slowly. The code which empties the quick-dive (q-d) tank is a subroutine called from Sh3Sim.act+0xB002, and located at Sh3Sim.act+0xA690. This subroutine is called *only* to empty the q-d tank, not to fill it. The subroutine is NOT called after an interrupted crash-dive at 40-45 metres. Hence, the q-d tank never gets emptied (ie, restored from 1.0000 to 0.5000). It may be partially emptied, depending on what depth was reached before the crash-dive was interrupted. When the U-boat is floating level at a depth of 40-45 metres (interrupted crash-dive), the only calls to Sh3Sim.act+0xAEB3 are to the hydroplanes. Otherwise, Sh3Sim.act+0x8527 provides a break-point for calls to hydroplanes and to the q-d tank. Therefore it appears that the code needed to handle an interrupted crash-dive (to restore the q-d tank to a value of 0.5) is going to have be quite brutal. We could set a flag when the q-d tank fills to 1.0000 (occurs while the U-boat is still on the surface), check flag and depth and hydroplane status, then restore the q-d tank. I think all three of these tests are going to be needed wherever, or however, the code gets implements (although your crashdiveflag that you reported earlier could replace the 'q-d tank = 1.0000' test.) The big problem is this: After an interrupted crash-dive, and if the player goes to speed = slow, the hydroplanes both have a steep up angle (about 0.5 for the front planes, and nearly as much for the rear hydroplanes), yet the U-boat continues to sink. Therefore the method of checking hydroplanes only works at high underwater speeds. We need some new way of checking for an interrupted crash-dive, and I think this requires knowledge of depth plus something else. A crash-dive to 80m can be interrupted if the player clicks on the depthgauge for 40m, 80m or 120m, so it is necessary to check only that the depth is below the surface (>10m). But what is the 'something else'? I suggest the simple test: IF depth > 40m AND q-d tank value = 1.000 THEN q-d tank = 0.5000 That should resolve all problems, is easy to code, and we know that the q-d tank will be emptied to 0.5000 below 40m anyway! The only potential problem is that the U-boat will now sink less quickly to the crash-dive depth - but it will be safely below the surface. (Implement in code at or near Sh3Sim.act+0x8529.) In fact, possibly (?) we can even remove the test for the q-d tank - implement the code whenever the depth falls below 40m however the player chooses to dive. Stiebler.
__________________
NYGM Tonnage War Mod - More than a mod: it's an experience! |
01-11-11, 08:50 AM | #884 |
Admiral
|
@Stiebler: I'll look into it this evening. Higher priority than external torpedoes.
My ideas are similar, but we may not forget the blow ballast. If we permanently force q-d-tank=0.500 when depth > 40m, then a blow ballast would not work as intended (provided blow ballast affects q-d-tank, but I think so). h.sie |
01-11-11, 01:44 PM | #885 | |
Ace of the Deep
Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
|
Quote:
nice work The first version, however, might be problematic for people that have a less deep crash-dive depth in their cfg files so that their q-d tank value is already smaller than 1 at 40m I think one should keep it in mind that different people/mods have different crash-dive depths. Cheers, LGN1 |
|
|
|