UBOAT
[2025.1] DeepLeaks
katamshut  [developer] 3 Feb @ 4:29am
Everything else
Modding, code, wishes..
< >
Showing 1-15 of 30 comments
katamshut  [developer] 3 Feb @ 4:37am 
Originally posted by async:
Thanks for the offer. I took a look at the code myself and I think the persisting pressure weirdness is due to PressureHatch.cs around line 420, the code for airflow through open hatches only runs for vertical passages. I moved it up to run on doors too and pressure equalized nicely through the sub (I also sped it up by 100x because the default flow rate is very slow edit: although this breaks under high time acceleration which I guess is why it was this slow in the first place)

I also wanted to make it equalize pressure with the outside by making the exterior hatch treat the outside as a room with pressure 1.0 bar and unlimited capacity but it looks like the mod doesn't even process vertical hatches? (I notice they also don't get the debug info.)

(I realize that this part is base game code and I'm not asking for anything, just messing around and sharing what I saw)

Sure, play around, that way I started modding in the end. It is the perfect spot to change the air values in your boat. Just make sure you have some "before" saves.

PressureHatch.cs around line 420, the code for airflow through open hatches only runs for vertical passages.

This code is actually from the core game with the only modification for the waterflow horizontally which deepleaks changes. Means, the devs removed horizontal airflow from that fn (I don't know why but I guess they had a good reason). If you decompile the source of uboat you'll find the original fn in Hatch class.

but it looks like the mod doesn't even process vertical hatches
Yes, deepleaks only handles the horizontal hatches. I had enough problems with them already.. so I focused only on them in a first version.

I also sped it up by 100x
yes, uboat has a problem when you deliver a linear value for all speeds, well, certainly for the water in the boat. That why they use this "limiter" to get out the right value:

float f = UnityEngine.Time.timeScale * HatchesPatches.gameTime.ArtificialTimeScale; float num1 = (double)f > 1.0 ? 2f / Mathf.Sqrt(f) : 2f; float num2 = Mathf.Min(UnityEngine.Time.deltaTime * HatchesPatches.gameTime.ArtificialTimeScale * num1, 8f); double flowTimeScale = (__instance.LeftCompartment.AirPressure - __instance.RightCompartment.AirPressure) * (double)num2 * 0.2;
async 3 Feb @ 8:57am 
Yeah I've seen the vanilla code. I was messing with airflow because I don't think the pressure hatch feature makes much sense without airflow through open hatches, inevitably the pressure will end up weird. I'll just disable it for now.
what text file reader should i use
katamshut  [developer] 3 Feb @ 3:28pm 
@greenbowl420: vscode (Visual Studio Code)
@async: sure, I'll wait until further patches of the core to see if they stick to no air flow
i am going to wait can i use it for another game like cyberpunk
async 19 Feb @ 2:13pm 
@katamshut I saw you ask about decks awash and I recently spent some time experimenting with it so I can say something. From what I see in game and some historical information I believe that decks awash is supposed to mean keeping the ballast tanks flooded but steering the boat to the surface using depth steers, which keeps the hull submerged but lifts the conning tower out of the water. This allows you, if the weather is calm, to run diesels and ventilate the boat while being less visible and also being able to dive nearly immediately since there is no need to spend time flooding the tanks. (However I don't think it would be safe for people to be on the tower in decks awash) Kind of like snorkel before you have it, plus you can go a bit faster.

Unfortunately in the game decks awash is broken. Usually trying to use the mode leads to the boat ending up at an odd crooked angle with the stern much lower than the bow, unable to access air. I have on occasion been able to have it work right and it was useful but most of the time it bugs out.
katamshut  [developer] 21 Feb @ 3:59pm 
thx for the info, I understand now.
Originally posted by async:
Unfortunately in the game decks awash is broken
Is this a mod you are talking about or is it already in the core game?
Drexack 22 Feb @ 12:54am 
I love your work, I really do, but with the latest update you had the opportunity to introduce what UBOAT sorely misses when compared to SH3, namely a kind of hull integrity mechanic.
But instead you did the opposite? The boat getting stronger the more it is damaged? That's a very odd choice in my mind.
async 22 Feb @ 1:05am 
@katamshut core game, there is a decks awash button on the depth gauge in between surface and periscope depth.
katamshut  [developer] 22 Feb @ 3:49am 
@Drexack: (nice name by the way :) I appreciate your input, but first try it out, and if you're still not satisfied, you can adjust the values to suit your needs. Additionally, I don't entirely agree with you. It was common practice to test the boat for weak spots through diving and fix those weaknesses. The values are carefully chosen, have limits on how much stronger they can get, and are still calculated randomly. You can't be sure. Think of it like this: if you have a bicycle and something breaks, then you repair it. Is it more broken than before? As I said, try it out. These are cosmetic changes that, even after many repairs, will only shift the appearance of leaks to about 30 to 60 meters deeper (very depending on min max depth)

EDIT: Also, the effect is stronger on Pipes then on Hatches and has nearly no effect on holes.
Last edited by katamshut; 22 Feb @ 4:03am
Drexack 22 Feb @ 6:24am 
I see where the idea is coming from. If you detect potential weak points during a test dive, you can reinforce them so they don't become a problem during an actual combat scenario. Is that where you were going with this?

While that sounds like an interesting mechanic, I don't like potential the side effects of this, since now getting hit by depth charges is not only inconsequential like before, but may actually be benefitial. In my opinion, this makes the game easier than it already is and therefore less interesting. If that's the case, I guess that's where I sadly don't share your vision.

Is there a way for me to edit the script so the effect is reversed? I know my way around C#, so even pointing me to the respective lines would be a huge help. :)

Or am I misunderstanding, and it only affects the occurance the random, depth dependant leaks? If that's the case, disregard what I said! :D
Last edited by Drexack; 22 Feb @ 6:45am
Improved ballast control and improved diving plane control is sorely missing now that IronCoffins is dead. As someone mentioned, the "decks awash" currently in the vanilla game is broken. True decks awash is neutral buoyancy, with ballast tanks fully or partially flooded and fine tuned use of the diving planes to keep the conning tower above the water. Would really like to see this functionality return to the game in DeepLeaks.
katamshut  [developer] 22 Feb @ 11:05am 
@Drexack: Yes right, a waterbomb will still hit you like before (the mod does not influence this) or any other damage like collision will immediately create leaks and holes. It only affects the probability calculation if the mod shall or shall not create a leak when diving below minPressureLeakDepth (something like 150m and below).

If you anyway want to play with it, it is on DeepLeaks.cs line 495:
public double GetTypePower { get => this.typePower + ((double)Math.Min(10,this.failCount) / 10); } // if you replace it with the following line you get the before version public double GetTypePower { get => this.typePower; }
Last edited by katamshut; 22 Feb @ 11:08am
katamshut  [developer] 22 Feb @ 11:31am 
@Rock: Yes I just tried it ingame and it wasn't working. I will have a look at it (or what Salamander from IronCoffins did with it).
Last edited by katamshut; 22 Feb @ 11:31am
Dust 22 Feb @ 2:57pm 
The discussion before, about hull strengthening vs. weakening with repeated failures. I like the current system a lot, as it's definitely more fun to me to be able to influence the strength of my boat.

However, I think there is validity in wanting a hull that gets more compromised over repeat damages.
Something that was tumbling in my head was potentially a realism option, not unlike the hatches feature. One where repeat leaks and stresses/damages to the hull cause it either to be more prone to leaks, certain kinds of leaks, or risk double/triple failures when a leak does trip and activate.
This ideally would be reset with a dedicated resource sink (costing a certain amount of budget for a hull refit or similar), but really could just be reset every time docked at port.


Separated from that idea, but related: I wonder about the potential to tweak the current system, so that instead of making the boat stronger against those leaks, it reinforces early leaks but accentuates the boat's proverbial crush depth. Like the more leaks you fix, it makes those initial depths safer but may hasten the onset of destruction when a crushing depth is actually reached.

Again, I'm mostly just wondering aloud. I'm pretty happy with the mod as is but it's very interesting to think about ways to add depth or dynamics to it.
< >
Showing 1-15 of 30 comments
Per page: 1530 50