SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 08-07-12, 12:30 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Like I said I have code in place that has the AI crew pumping out flood water. That code was just a theory to practice to ensure the idea/code was sound. Now being of sound nature I can add the changes necessary to make it complete.

Here's my thinking: The pumps onboard the units will be able to pump equivalent to 20-30% damage (a random function will determine the % on every frame update thus giving some randomness to the pump amount). This will allow a compartment to accumulate flood water (allbeit at a lower rate than it would without pumps) until the crew fixes the damage to the compartment. The damage to the compartment is used in the formula by the game to determine amount of flood water to add to the compartment per frame update (it's actually per flood water timer update which is set at 5 seconds by the game). If the flood water level is > 65% of the compartment the crew abandons trying to pump out the water and lets the compartment flood full (sealing it off from other compartments).

The crew will try and fix the damage to the compartment every frame update. A random function will determine whether they (crew AI) successfully decreases some damage to the compartment every frame update. If they are successfull then the max the crew can repair damage per frame is 0.003%. A random number will be generated (0-1.0 in value) and multiplied by 0.003 to get the amount of damage reduced in that frame update.

These changes will allow flood water to accumulate in the compartment if damage is > 20-30% (random number). Once the crew manages to get the damage to the compartment repaired to a level that the pumps can remove the water then the flood water level will decrease in that compartment. This all together will give a nice curve of flooding versus time (starts out high and exponentially decreases over time as crew repairs damage). Say the damage to the compartment is 55% and the game calculates that the flood water level increase in that timer update is 0.17. Since the pumps can remove 20-30% of the water I'll take 0.17 * ( 1 - 20-30% random number) to get the amount of flood water to add in that timer update. Same applies to if damage is say 12%. Since 12% is < 20-30% random number then I'll take whatever the game calculates as the flood water level increase and negate it and pass it onto the function to update compartment water level thus decreasing the water level in that compartment.

Now the game keeps track of the flood water level in the compartment at all times. Thus if the water level in the compartment gets to the water level at the hull flooding stops (as it should). This gives the crew the possibility of not exceeding the 65% damage threshold before having to quit trying to remove flood water.

If you have any ideas for this please speak up. We can make this do just about whatever we want it to do

Last edited by TheDarkWraith; 08-07-12 at 12:46 PM.
TheDarkWraith is offline   Reply With Quote
Old 08-07-12, 01:04 PM   #2
NONONO
Seaman
 
Join Date: Jun 2010
Posts: 37
Downloads: 366
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Like I said I have code in place that has the AI crew pumping out flood water. That code was just a theory to practice to ensure the idea/code was sound. Now being of sound nature I can add the changes necessary to make it complete.

Here's my thinking: The pumps onboard the units will be able to pump equivalent to 20-30% damage (a random function will determine the % on every frame update thus giving some randomness to the pump amount). This will allow a compartment to accumulate flood water (allbeit at a lower rate than it would without pumps) until the crew fixes the damage to the compartment. The damage to the compartment is used in the formula by the game to determine amount of flood water to add to the compartment per frame update (it's actually per flood water timer update which is set at 5 seconds by the game). If the flood water level is > 65% of the compartment the crew abandons trying to pump out the water and lets the compartment flood full (sealing it off from other compartments).

The crew will try and fix the damage to the compartment every frame update. A random function will determine whether they (crew AI) successfully decreases some damage to the compartment every frame update. If they are successfull then the max the crew can repair damage per frame is 0.003%. A random number will be generated (0-1.0 in value) and multiplied by 0.003 to get the amount of damage reduced in that frame update.

These changes will allow flood water to accumulate in the compartment if damage is > 20-30% (random number). Once the crew manages to get the damage to the compartment repaired to a level that the pumps can remove the water then the flood water level will decrease in that compartment. This all together will give a nice curve of flooding versus time (starts out high and exponentially decreases over time as crew repairs damage). Say the damage to the compartment is 55% and the game calculates that the flood water level increase in that timer update is 0.17. Since the pumps can remove 20-30% of the water I'll take 0.17 * ( 1 - 20-30% random number) to get the amount of flood water to add in that timer update. Same applies to if damage is say 12%. Since 12% is < 20-30% random number then I'll take whatever the game calculates as the flood water level increase and negate it and pass it onto the function to update compartment water level thus decreasing the water level in that compartment.

Now the game keeps track of the flood water level in the compartment at all times. Thus if the water level in the compartment gets to the water level at the hull flooding stops (as it should). This gives the crew the possibility of not exceeding the 65% damage threshold before having to quit trying to remove flood water.

If you have any ideas for this please speak up. We can make this do just about whatever we want it to do
possible to implement tools for fire management and
Allowable concentrations of toxic gases (harmful substances) in case of fire,
Effect of water temperature and air personnel,and when the sub sank from damage to the critical depth is not on the ground, the crew will try and fix the damage all try to come up with a lot of emergency submarine
NONONO is offline   Reply With Quote
Old 08-07-12, 01:19 PM   #3
DelphiUniverse
中国水兵
 
Join Date: Mar 2010
Location: Scapa Flow, underneath a ferry
Posts: 272
Downloads: 125
Uploads: 0
Default

The end patrol button not working (after every second patrol), is this something that you can work out in a future patch?
DelphiUniverse is offline   Reply With Quote
Old 08-07-12, 01:46 PM   #4
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Thinking out loud...

What was the maximum water pumping rate for WWII bilge pumps? How were they powered? I guess the most likely answer is through ship's propulsion engines.

In this case pump's power should be a function of unit engine's max power, and consequantly a ship with her engines on flames shouldn't be able to manage her floodings at all.
gap is offline   Reply With Quote
Old 08-07-12, 01:54 PM   #5
Trevally.
Navy Seal
 
Join Date: Apr 2007
Location: AN1536 (Orkney)
Posts: 5,448
Downloads: 166
Uploads: 28


Default

Quote:
Engine Room Flooding
In the case of engine room flooding; the level of the incoming seawater in the bilges must be controlled in order to prevent it reaching the main power generators. This would be catastrophic, leading to the loss of main power to pumps and the main engine.
If the torp hit the engine room - no pumping
__________________
Trevally Mods for SH5
Trevally. is offline   Reply With Quote
Old 08-07-12, 03:29 PM   #6
mookiemookie
Navy Seal
 
mookiemookie's Avatar
 
Join Date: Nov 2005
Location: Houston, TX
Posts: 9,286
Downloads: 105
Uploads: 1
Default

Quote:
Originally Posted by gap View Post
Thinking out loud...

What was the maximum water pumping rate for WWII bilge pumps? How were they powered? I guess the most likely answer is through ship's propulsion engines.

In this case pump's power should be a function of unit engine's max power, and consequantly a ship with her engines on flames shouldn't be able to manage her floodings at all.
Bilge pumps were electric.
__________________
They don’t think it be like it is, but it do.

Want more U-boat Kaleun portraits for your SH3 Commander Profiles? Download the SH3 Commander Portrait Pack here.
mookiemookie is offline   Reply With Quote
Old 08-07-12, 04:40 PM   #7
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by mookiemookie View Post
Thank you for the link mookiemookie, good website that one

It refers to US subs drain system anyway. Indeed I can be wrong, but I doubt battery powered pumps could keep the pace with heavy floodings on larger ships.
gap is offline   Reply With Quote
Old 08-07-12, 07:04 PM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Thank you for the link mookiemookie, good website that one

It refers to US subs drain system anyway. Indeed I can be wrong, but I doubt battery powered pumps could keep the pace with heavy floodings on larger ships.
I come from a Navy background and our pumps were electrical in nature. We could rig emergency power if needed to power anything.

This is why I thought it was prudent to bring this into discussion. I want to implement something that is accurate (as much as possible) and also realistic

This AI crew damage control would only apply to AI units - not the player's sub. That means AI ships and subs and Aircraft. I can possibly filter out certain types if I can locate the pointer that points to the unit's type (i.e. 102, 104, 201, etc.). I have seen this pointer before now I just have to remember where I saw it!
TheDarkWraith is offline   Reply With Quote
Old 08-07-12, 09:18 PM   #9
mookiemookie
Navy Seal
 
mookiemookie's Avatar
 
Join Date: Nov 2005
Location: Houston, TX
Posts: 9,286
Downloads: 105
Uploads: 1
Default

Quote:
Originally Posted by gap View Post
Thank you for the link mookiemookie, good website that one

It refers to US subs drain system anyway. Indeed I can be wrong, but I doubt battery powered pumps could keep the pace with heavy floodings on larger ships.
Well you were correct in a way - it was related to the diesel engines, as those were the dynamos for charging the batteries. But in any case, the bilge pumps were electrically operated on U-boats also - here's a description of how they rigged the U-505's bilge pumps to work without having engines or a full battery charge: http://uboat.net/forums/read.php?20,59020,59029
__________________
They don’t think it be like it is, but it do.

Want more U-boat Kaleun portraits for your SH3 Commander Profiles? Download the SH3 Commander Portrait Pack here.
mookiemookie is offline   Reply With Quote
Old 08-07-12, 10:48 PM   #10
9thinfSword
Sailor man
 
Join Date: Sep 2009
Location: Kings Bay, GA
Posts: 43
Downloads: 234
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
If you have any ideas for this please speak up. We can make this do just about whatever we want it to do
you asked...
I'd love to see a personnel brow from the bunker to the boat( that is cross-able) and or mooring lines pier side. I've often wondered why we weren't drifting away form the pier. I know its purely cosmetic, but wouldnt that be something.
__________________
"For every dive you must surface, or say hello to your maker, its depths we shouldn't stay"
9thinfSword is offline   Reply With Quote
Old 08-07-12, 01:40 PM   #11
Trevally.
Navy Seal
 
Join Date: Apr 2007
Location: AN1536 (Orkney)
Posts: 5,448
Downloads: 166
Uploads: 28


Default

This is for ships that we have attacked
Not our u-boats
__________________
Trevally Mods for SH5
Trevally. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:27 AM.


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