PDA

View Full Version : [WIP] Depth keeping problem at deep depths


TheDarkWraith
01-12-11, 03:11 AM
Today I decided to look into the problem with the depth keeping issue at deep depths (> 100ft). I finally isolated the routine that is responsible for it and now just have to decipher what it's exactly doing. I can see in realtime that there is a value that is supposed to zero out when you reach the depth wanted but at deep depths it is staying negative and a negative number keeps adding to it thus making you dive deeper and deeper and deeper.
What I hope to do is release a patch for the .exe file to fix this problem. As I see people are doing this in SH3 I don't see why we can't in SH5. The patch would work like this: you run an application that reads a file and updates your installed .exe file based on the contents of that file. As I'm not supplying a modified .exe file and only a patch for it that has to be installed with another application there should be no problems with this at all. Like I said they are doing it in SH3 so what's good for the goose is good for the gander also.
Before people start asking multiple questions and requests let me just say that it's very time consuming work. You have to know how to read and write assembler. The hardest part is just finding the variable(s) you're looking for. Once you found the variable then it takes hours, sometimes days, to decipher what the assembly is doing to change/update those values (sometimes you have pointers to pointers to pointers to.....). It took me over 10 hours just to narrow down this one routine and it will take even more time to totally figure out exactly what it's doing.
Now it is time to sleep :zzz:

arnahud2
01-12-11, 07:28 AM
Hi, many many thanks once again !!!

Ragtag
01-12-11, 07:33 AM
You never seize to amaze TDW, thanks :D

Jaeger
01-12-11, 07:36 AM
good idea tdw. i think ubi has totally abandon sh5, so there should not be any problems with them.

an idea for this application: make it like sh3 commander. you could do a gui which is obligatory for starting the game. in this guy, you could integrate the journal editing tool and all the option-file entries. checkboxes for each option and a scroll bar for the AI strength. after the player has chosen his option choice, the app writes the options file and starts the game with this configuration. parallel, all the changes xou made to the sh5.exe file will automatically be active as well.

perhaps you can directly use some of the gui layouts from sh3 commander of jscones? this could avoid some work???


Jaeger

Nufsed
01-12-11, 07:37 AM
You never cease to amaze TDW, thanks :D

I'll second that :up:

Meldric
01-12-11, 08:26 AM
Isn't a changed exe going to trigger DRM-issues?

TheDarkWraith
01-12-11, 09:43 AM
shouldn't as nothing is changing from the DRM standpoint. We're just simply changing some bytes, possibly adding some. I'm not totally sure yet as I just narrowed down the routine and haven't made any 'changes' to mine yet.
The intent is to fix problems found in the game and not to try and circumvent any DRM or the likes :yep:

Meldric
01-12-11, 10:07 AM
Well, I know what is intended. I was just thinking that DRM might use some kind of checksum mechanism that might be triggered by "changing some bytes"... Maybe not... :)

Zedi
01-12-11, 11:13 AM
...
What I hope to do is release a patch for the .exe file to fix this problem. As I see people are doing this in SH3 I don't see why we can't in SH5.
...

As far as I know, the SH3 eula is not restrictive anymore on any changes to SH3 at any level, its a 10 year old game and is not developed in any way anymore. Is not the case with SH5, so you may wanna be careful with these things...

THE_MASK
01-12-11, 02:25 PM
Devs look at this forum , if they dont wany you to do anytrhing i am sure they well let you know .

Zedi
01-12-11, 02:46 PM
Devs look at this forum , if they dont wany you to do anytrhing i am sure they well let you know .

I dont think this is their job.

Ducimus
01-12-11, 02:53 PM
I can see in realtime that there is a value that is supposed to zero out when you reach the depth wanted but at deep depths it is staying negative and a negative number keeps adding to it thus

For what it's worth this bug was carried over from SH4. In that game, there are trim gauges. When you hit or cross 183 meters, that trim gauge just pegs over.

Madox58
01-12-11, 03:02 PM
I was just thinking that DRM might use some kind of checksum mechanism

Nope.
It doesn't do that.
The first 'So called' hacks changed file sizes but the Game still kind of worked.

Illyustrator
01-12-11, 03:48 PM
Developers have refused from SH5 !?
The person DARES to BUY SH5 after will see all MODS to game. They should tell thanks Modders. Only they do demand on SH5!!! They and only They have corrected errors of Developers.
It is necessary to do qualitative Games, and then to make a complaint. I on their place would pay compensation Modders for "Lost dreams."
(Excuse for emotions. This opinion of the majority of people which have bought SH5).

BigBANGtheory
01-14-11, 02:21 PM
holy moly, Jes Louise etc etc....

Any modder(s) that use debugging tools and assembler to alter compiled binary code truely deserve respect.

TDW and Privateer are equals in reverse engineering and the reason I donated to Subsim, because you can't actually buy that kind of dedication it just needs to be appreciated from time to time.

I would love to learn how you do it. Maybe if you come across a task that can be handled by others you might PM me and educate me on how to help.

bart
01-14-11, 05:58 PM
Nice one TDW :up:

This issue bugs me as it must others, thanks for looking into it for us :salute:

IonicRipper
01-20-11, 11:02 PM
Any updates on this?
You would be my hero, TDW :D

PurpleCity
01-21-11, 12:06 AM
Today I decided to look into the problem with the depth keeping issue at deep depths (> 100ft). I finally isolated the routine that is responsible for it and now just have to decipher what it's exactly doing.

Does this mean it might also be possible to add a natural positive or negative buoyancy when the propellers are stopped?

TheDarkWraith
01-21-11, 08:38 AM
Any updates on this?
You would be my hero, TDW :D

slow moving....very hard to trace out due to numerous procedure calls in the code :doh: Right now trying to find the trim tank and ballast tanks routines.

jean74
01-21-11, 11:44 AM
Many Thanks to you for your research and your very very good, important and impressive work. :salute:

Here, you are working on a very important SH5's bug (for me).:up:

Maybe after this, you can make us able to use trim and ballast :o !!
Who knows ?!?:rotfl2:

Another Time many thanks for all your work,

Best regards

Jean

Firebird3924
01-22-11, 11:41 AM
Lifetime sub lover, first time post
This, dive plane control, & individual propeller speed control would bring this game to the level it was destined. darkwraith could u please point me to the software & places I could learn what's needed to help out. I may be inexperienced as once all were but since its clear that we can make this game the nailbiting edge of seat excitement, focus, & fear with an envelope u can push. point me at the "how to" so I can help make more I can do that TOO!!
Firebird3924

BowfinSS287
01-25-11, 01:05 PM
fingers crossed that the TDW will be able to figure this out
i have a feeling that if he does, we will be in for a serious
trim and ballast system.....good luck

Jaeger
01-25-11, 01:20 PM
i hope it is like that atm: the longer he doesnt post here, the deeper he digs in the sh5.exe file. in the sh3 modding forum, somebody said it would also be possible to separate the engines. the only problem would be to make the grafiks for extra buttons and gui things... i hope tdw can reach both points: the ballast tanks and the engine controlling. one thing will be sure: adding gui elements wont be the problem for him... :up:

andycaccia
01-28-11, 09:10 AM
Great!
The depth issue is one of the most annoying bugs in sh5... I made a dirty fix, but I had too many side effects..

TheDarkWraith
01-30-11, 11:00 PM
well you all, I found a solution :rock: After digging through the SH5.exe file and seeing what was going on the problem was really easy to fix. The problem is in the .sim files of the subs.

I took a VIIb down to 170ft @ 0 knots and it held depth no problem. Working on other subs now :D

stoianm
01-30-11, 11:06 PM
well you all, I found a solution :rock: After digging through the SH5.exe file and seeing what was going on the problem was really easy to fix. The problem is in the .sim files of the subs.

I took a VIIb down to 170ft @ 0 knots and it held depth no problem. Working on other subs now :D

You never rest? - you are the best!:rock::rock::rock:

Now, no more ,,blow balast'' , ,,level the boat'' , ,,all stop,, and so on comands needed to keep to good dept.

Wonderful work!:salute:

TheDarkWraith
01-31-11, 12:30 AM
Here is something for you all to test: http://www.filefront.com/17874042/TDW-Depth-Keeping-Problem.7z/

This fixes the depth keeping problem with the 7A, 7C, and 7C41 subs. Still working on the 7B.

You'll be able to keep depth at 0knots down to 170m at least :D

Unzip straight to MODS folder. Enable via JSGME

Haven't fixed the UHS ones yet. These are the stock files fixed.

I'm curious to see how these work at all different kind of depths. I'll probably make a version that requires you to be at at least one knot to hold depth or you slowly gain depth (go deeper) for those that don't like the 'hummingbird' effect.

Magic1111
01-31-11, 02:10 AM
Here is something for you all to test: http://www.filefront.com/17874042/TDW-Depth-Keeping-Problem.7z/

This fixes the depth keeping problem with the 7A, 7C, and 7C41 subs. Still working on the 7B.

You'll be able to keep depth at 0knots down to 170m at least :D

Unzip straight to MODS folder. Enable via JSGME

Haven't fixed the UHS ones yet. These are the stock files fixed.

I'm curious to see how these work at all different kind of depths. I'll probably make a version that requires you to be at at least one knot to hold depth or you slowly gain depth (go deeper) for those that don't like the 'hummingbird' effect.

:rock::rock::rock:Many thanks, IŽll give it a try !!! :rock::rock::rock:

Ragtag
01-31-11, 03:04 AM
great work TDW. Waiting eagerly for the next mega mod version :D

jean74
01-31-11, 06:25 AM
Hi TheDarkWraigth,

Incredible !!! You are really the best modder I have ever seen :up:

I spent many times for this, but I have never found the solution.
I will try this evening,

Another time, many many thanks for your essential and helpful work on SH5

Best regards,

Jean

panosrxo
01-31-11, 07:35 AM
I tried it (155m 0knots and it stayed there). It works!! Great job.

stoianm
01-31-11, 09:51 AM
Hi TDW,

Tested and it works. This will be a stand allone mod or will be incuded in your FIX?:06:

andycaccia
02-01-11, 07:27 AM
well you all, I found a solution :rock: After digging through the SH5.exe file and seeing what was going on the problem was really easy to fix. The problem is in the .sim files of the subs.

I took a VIIb down to 170ft @ 0 knots and it held depth no problem. Working on other subs now :D

What kind of problem have you found in the .sim files? Personally, I thought that the problem was hard coded in the engine...:hmmm:

ReallyDedPoet
02-01-11, 08:10 AM
Hi TDW,

Tested and it works. This will be a stand allone mod or will be incuded in your FIX?:06:

I am thinking it will, from his [REL] Thread on this:

I'll be making a version that requires you to have at least 1 knot of speed to hold depth for those who don't like the 'hummingbird' effect.

I'll be making a version for those who use UHS also. Currently this is for the stock version of the files.

stoianm
02-01-11, 09:16 AM
I am thinking it will, from his [REL] Thread on this:

But i not really understand what means stock version of the files. Somebody posted an message (and erased after a while) where he said that he will not install because of these ,,stock version of the files'' and he will wait the final version!?!?:damn: i am a little bit confused!

Best regards!:salute:

TheDarkWraith
02-01-11, 09:20 AM
But i not really understand what means stock version of the files. Somebody posted an message (and erased after a while) where he said that he will not install because of these ,,stock version of the files'' and he will wait the final version!?!?:damn: i am a little bit confused!

Best regards!:salute:

The UHS mod made changes to the .sim files and the .cfg files of the subs. I haven't looked into what changes need to be done to those files to get rid of the depth keeping bug. I fixed the stock SH5 files first.

TheDarkWraith
02-01-11, 09:22 AM
What kind of problem have you found in the .sim files? Personally, I thought that the problem was hard coded in the engine...:hmmm:

There are a combination of problems. For the VIIb it was a problem with length/width and submerged displacement. For all the other subs it was a simple matter of adjusting their submerged displacement.

stoianm
02-01-11, 09:23 AM
The UHS mod made changes to the .sim files and the .cfg files of the subs. I haven't looked into what changes need to be done to those files to get rid of the depth keeping bug. I fixed the stock SH5 files first.

I see now!:yep:

Thank you sir!:salute:

charognard
02-01-11, 09:40 AM
waiting for UHS version ^^ Thx for this great fix TDW :)

Seaman_Hornsby
02-01-11, 01:02 PM
There are a combination of problems. For the VIIb it was a problem with length/width and submerged displacement. For all the other subs it was a simple matter of adjusting their submerged displacement.

Impressive detective work, sir. Thanks for the efforts. :salute:

andycaccia
02-02-11, 06:26 AM
There are a combination of problems. For the VIIb it was a problem with length/width and submerged displacement. For all the other subs it was a simple matter of adjusting their submerged displacement.

I understand. That is bad. I mean, if the type VIIB had problems even with the lenght/width that means the models of the subs were made very very poorly..
I thought the problem was due to a miscalculation (bug?) in the physic engine, which returned in the form of the much hated sinking effect. I tested many many times the .sim values, and I came up with an excellent fix eventually, however, my tweaks caused super fast diving times and the also hated submarine on rail effects. Check the donwload section, my fix should be still there, in the patch section...if you wanna take a look at it.

bart
02-03-11, 11:14 AM
Just added it to my soup and it works great......thanks TDW.

Are you planning on adding this to your final release of the MO mod? (hope so!)

Thanks again sir :salute:

cunnutazzo
02-03-11, 12:31 PM
Thank you for your help, TDW! When ready I'll try your mod on the VIIB.
I found that after about 50-60m you go down and the solution is go faster (not a good solution with destroyers above you). So I tried to go down very slowly just 5 or 10m every stop. If the gouge indicates 59 or 55m, I click on 50m, and the boat goes at about 65m. Then I click on 55m and boat goes at about 75m, and so on every 5m. Finally, when I click at 80m the boat goes at 135m without problems or going deeper at 2 kts, the problem starts again if you change speed and return to 2 kts. When at 140 the compressed air will be at about 60/65%, enough to do other things. I don't know if this responds to the reality or is a mere bug, but this is my only way to play sh5, just assuming that I'm a Kaleun with an untrained crew. :salute:

TheDarkWraith
02-03-11, 12:49 PM
Look for the thread where this was officially released. This [WIP] one isn't the correct mod for the problem.