Jump to content

[1.4.5] HullBreach - Making things Sink


gomker

Recommended Posts

In collaboration with SMSolutions I present my first efforts in KSP modding , HullBreach is designed to simulate flooding of submerged parts and allow them to sink. 

Features

  • Uses heat "damage" to trigger the flow of water into part
  • Parts can be set as "Hydroexplosive" - once underwater they will take on extra heat based on depth to simulate increasing pressure, used for Hulls that take on water
  • Parts that are configured as "Crushable" will be destroyed at set depth, used for other parts that will not take on water that you want destroyed when sunk
  • Parts with Electric charge are drained when fully sumberged
  • Parts marked as Crushable will have their buoyancy set to 0 when fully submerged to keep from having floaty bits around
  • Included Module Manager patches for Large Boat Parts, SMMarine and NAS

Example Configurations

Hull Parts

Spoiler

	MODULE
	{
		name = ModuleHullBreach
		flowRate = 100
		critFlowRate = 200
		breachTemp = 0.4
		critBreachTemp = 0.8
    	hull = true 
	    hydroExplosive = true
	}
	RESOURCE
	{
		name = SeaWater
		amount = 50
		maxAmount = 3750
		
	}

 

Crushable Parts

Spoiler

	MODULE
	{
		name = ModuleHullBreach
		hull = false
		hydroExplosive = false
		crushable = true
		crushDepth = 100
	}

 

Notes on configuration

  • Parts should not be marked as Hydroexplosive AND Crushable - only one is applicable
     
  • Some helpful notes courtesy of  @SpannerMonkey(smce) on how we designed this to work with other parts

Notes to prospective users.  The effectiveness of HullBreach is purely determined by the patch you write for the part, while it is very easy to get a hull to sink, getting it to sink at a realistic rate can take a little bit of cfg tuning. As mentioned in the OP both SM Marine and the LBP have been enabled for HullBreach and you can inspect  the patch cfg's there,  they will serve as a reference point for similar sized craft and parts

For weapon mod makers it is suggested that you ensure that your turrets will not float, simply adding buoyancy = -2  to the part cfg  will prevent floaty turret syndrome. Floaty turret syndrome is caused by the buoyant turrets detaching from the crushing exploding parts and floating back to the surface, this  usually results in a nice outline of where the ship used to be being formed by the floaty turrets. Also has been known to mess up screenshots. nothing looks as odd as a 40ton turret bobbing in the waves :) 

All SMM And LBP structural parts are zero buoyancy to so that they will sink along with the hull. If you have a ship or boat mod or parts that you'd like to use on ships i recommend that you do the same. The only buoyant parts ideally will be hull parts, i also change the buoyancy value for things that would never float, such as girder formed masts, structural panels etc into  negative buoyancy parts, so in the same way as the weapon mods add buoyancy = -2 to anything you want to sink like a stone and more neutral numbers for things that should sink slowly, i find the gradual disappearance of parts adds to the whole effect.

 

Download

Required Mods

Recommended Mods

Reporting Issues / Support

  • For support please ensure you are following these instructions and provide logs

    The Logs

    Spoiler

    These are text files that the game spits out for debugging purposes as it runs; if something broke horribly in-game, there will be something in here about it. You should upload the entire log as a file (i.e. not to pastebin); you can use dropbox or an equivalent host to upload the file. Make sure the entire file gets uploaded; you may have to zip it first, as logs can be very long. Here is where you can find the log:
    Windows: KSP_win\KSP_Data\output_log.txt (32bit) or KSP_win64\KSP_x64_Data\output_log.txt (64bit)
    Mac OS X: Open Console, on the left side of the window there is a menu that says 'files'. Scroll down the list and find the Unity drop down, under Unity there will be Player.log ( Files>~/Library/Logs>Unity>Player.log )
    Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log

     

  • Github Issues  - Github is the preferred way to communicate issues or feature requests, feel free to discuss in thread of course.

License 

This work is shared under CC BY-NC-SA 3.0 license

Change Log

Spoiler

v0.1.5.5.4 

- Updates to Module Manager Configs for release of SMMarine and LBP

Special thanks to @SpannerMonkey(smce) for helping me out with my first plugin and the video above

 

Edited by gomker
Link to comment
Share on other sites

  • 2 weeks later...

How does the mod deside if a hull breach happens or not? Is it something to do with the weapons individual damage or is it accumitative? I can slam 4 Mark XII aerial torpedos into a Carrier hull section and get nothing but 4 203mm cannon shells can destroy it. The parts I'm refering to are from LBP and NAS mod.

Link to comment
Share on other sites

16 minutes ago, Vjrcr said:

How does the mod deside if a hull breach happens or not? Is it something to do with the weapons individual damage or is it accumitative? I can slam 4 Mark XII aerial torpedos into a Carrier hull section and get nothing but 4 203mm cannon shells can destroy it. The parts I'm refering to are from LBP and NAS mod.

 

6 minutes ago, XOC2008 said:

Pretty sure it has to do with the heat imparted to the part, so the torpedoes may not generate enough against the hull section compared to the cannon shells.

Hi yes it's all heat triggered the LBP now uses a sanity patch to place the values for heat and damage at high but acceptable levels,  a breach is simulated when  the temperature of the part gets above 50% of it's max value, It is very likely that the shells from NAS have a much higher heat output than the torpedoes. if in fact the torpedoes have a heat output at all.  It's completely in the hands of NAS how they balance their products, they i believe use real world values for the shells as it their right , though ideally to work best with LBP they should be considerably less, somewhere around 65% works well

Link to comment
Share on other sites

1 hour ago, SpannerMonkey(smce) said:

 

Hi yes it's all heat triggered the LBP now uses a sanity patch to place the values for heat and damage at high but acceptable levels,  a breach is simulated when  the temperature of the part gets above 50% of it's max value, It is very likely that the shells from NAS have a much higher heat output than the torpedoes. if in fact the torpedoes have a heat output at all.  It's completely in the hands of NAS how they balance their products, they i believe use real world values for the shells as it their right , though ideally to work best with LBP they should be considerably less, somewhere around 65% works well

Does water effect heat? I did get a bull breach once but it was when I drop 2 torpedos into the hull just above the water line. But if not then I'll work on something to get it working.

Link to comment
Share on other sites

9 hours ago, Vjrcr said:

Does water effect heat? I did get a bull breach once but it was when I drop 2 torpedos into the hull just above the water line. But if not then I'll work on something to get it working.

Hi. I'll take a look at NAS, maybe it's something we can teak with a MM patch.  Water has no effect on heating that I've noticed, and I've sunk a lot of ships :)

Link to comment
Share on other sites

  • 2 weeks later...

I usually prefer modifying the ballast tanks on large boat parts slightly to allow them to perpetually take in water upon staging, and stick pumps to the side, so you can achieve listing or flipping when submerged, but it sometimes has a tendency to release the kraken though...(not to mention having to add 4 0's to the max heat on every part to prevent part exploding and refloating)

Link to comment
Share on other sites

  • 3 months later...
1 minute ago, Toonu said:

Is there way to stop water coming in ? Like if I get heat again under 50% it starts getting wawter out? Some electric pumps?

There is a large sea water pump in HullBreach using the resource convertor method.  I use them by setting them to switch on at launch, that way they stand the best chance of keeping a ship afloat, the sooner you start removing water the better chance you have of renaming afloat.

They will ,if you have enough of them ,stop the ship sinking while you escape hostilities, do note that they will not keep a ship afloat that has reached critical condition as that simulates a massive breach and they will not stop you sinking while still being fired upon, as the water ingress will rapidly exceed the water removal.  .   Hope this helps 

Link to comment
Share on other sites

7 hours ago, SpannerMonkey(smce) said:

There is a large sea water pump in HullBreach using the resource convertor method.  I use them by setting them to switch on at launch, that way they stand the best chance of keeping a ship afloat, the sooner you start removing water the better chance you have of renaming afloat.

They will ,if you have enough of them ,stop the ship sinking while you escape hostilities, do note that they will not keep a ship afloat that has reached critical condition as that simulates a massive breach and they will not stop you sinking while still being fired upon, as the water ingress will rapidly exceed the water removal.  .   Hope this helps 

The pump never seems to pump out water, all it is says is "missing SeaWater" even though there is SeaWater in the hull and the pump is on.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 3 weeks later...
14 hours ago, Vonnmillard said:

I found out that certain parts that can be re-scaleable using TweakScale are no longer re-scaleable with this mod installed, are you aware on this?

This mod only has MM Configs that add my module and will not affect tweakscale. Which parts are you having issues with? It is most likely a part change has occurred and you need to delete your part config database and MM cache and reload.

Link to comment
Share on other sites

  • 2 weeks later...

I can't get the Enterprise (from CVA) to sink despite having fired missiles at it repeatedly, only for it to have 50 sea water. No matter how much damage is dealt it is locked to 50. The directory of the mod goes like: KSP_win > GameData > Hullbreach (Gamedata of mod). Even if I achieved 30000 sea water using hyperedit, the carrier refuses to sink. What might be causing the problem? 

Link to comment
Share on other sites

5 hours ago, CVerts said:

I can't get the Enterprise (from CVA) to sink despite having fired missiles at it repeatedly, only for it to have 50 sea water. No matter how much damage is dealt it is locked to 50. The directory of the mod goes like: KSP_win > GameData > Hullbreach (Gamedata of mod). Even if I achieved 30000 sea water using hyperedit, the carrier refuses to sink. What might be causing the problem? 

Since things taking in water is dependent on temperature and sinking dependent of mass, I recommend checking the maxheat value of the ship and increase the resource { water } max amount in the part.cfg on the specific part.

Link to comment
Share on other sites

This is the confing for aca in hull breach:

Spoiler

 

//Config Courtesy of muricanJeb for Aircraft Carrier Accessories

@PART[Enterprise]
{    
    !MODULE[ModuleActiveRadiator]{}
    MODULE
    {
        name = ModuleHullBreach
        flowRate = 100
        critFlowRate = 200
        breachTemp = 0.4
        critBreachTemp = 0.8
        hull = true 
        hydroExplosive = true
    }
    
    RESOURCE
    {
        name = SeaWater
        amount = 50
        maxAmount = 300000
        
    }
}

 

and the config for the carrier

Spoiler

 

PART
{
name = Enterprise
module = Part
author = kfc

mesh = Enterprise.mu
scale=1
rescaleFactor = 1

// --- FX definitions ---

node_attach = 0.0, 0, 0.0, 0.0, -1.0, 0.0, 1
node_stack_top = 0.0, 0, 0.0, 0.0, -1.0, 0.0, 1
buoyancy = 0.8
boundsMultiplier = 0.7
//buoyancyUseSine = False

// --- Sound FX definition ---
TechRequired = fuelSystems
entryCost = 800000
cost = 40000000
category = Pods
subcategory = 0
title = Enterprise
manufacturer = Newport News Shipbuilding
description = USS Enterprise (CVN-65), formerly CVA(N)-65, is an inactive United States Navy aircraft carrier. She was the world's first nuclear-powered aircraft carrier and the eighth United States naval vessel to bear the name. Like her predecessor of World War II fame, she is nicknamed "Big E". At 1,123 ft (342 m),she is the longest naval vessel ever built. Her 93,284-long-ton (94,781 tonnes)displacement ranked her as the 12th-heaviest supercarrier, after the 10 carriers of the Nimitz class and the USS Gerald R. Ford. Enterprise had a crew of some 4,600 service members.

attachRules = 1,1,1,1,1

mass = 94780
dragModelType = none
maximum_drag = 0.02
minimum_drag = 0.02
angularDrag = 2
stagingIcon = SOLID_BOOSTER
crashTolerance = 10000
breakingForce = 10000
breakingTorque = 10000
maxTemp = 1000000
CrewCapacity = 300
    
    
vesselType = Base

    MODULE
    {
        name = ModuleCommand
        minimumCrew = 3
        RESOURCE
        {
            name = ElectricCharge
            rate = 1
        }
    }
    RESOURCE
    {
        name = ElectricCharge
        amount = 10000
        maxAmount = 10000
    }

    RESOURCE
    {
        name = LiquidFuel
        amount = 30000
        maxAmount = 30000
    }
    MODULE
    {
        name = ModuleReactionWheel
        PitchTorque = 500
        YawTorque = 500
        RollTorque = 500
        RESOURCE
        {
            name = ElectricCharge
            rate = 0.05
        }
    }
    MODULE
    {
        name = ModuleSAS
        SASServiceLevel = 3
    }


    MODULE
    {
        name = ModuleGenerator
        isAlwaysActive = true
        OUTPUT_RESOURCE
        {
            name = ElectricCharge
            rate = 100
        }
    }

    MODULE
    {
        name = ModuleEnginesFX
        engineID = Cruise
        thrustVectorTransformName = thrustTransform
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 15000
        heatProduction = 15
        useEngineResponseTime = false
        //engineAccelerationSpeed = 0.12
        //engineDecelerationSpeed = 0.5
        fxOffset = 0, 0, 0.74
        flameoutEffectName = flameout
        powerEffectName = running_thrust
        engageEffectName = engage
        disengageEffectName = disengage
        spoolEffectName = running_turbine
        engineSpoolIdle = 0.05
        engineSpoolTime = 2.0
        EngineType = Turbine
        exhaustDamageMultiplier = 4
        clampPropReceived = True

        PROPELLANT
        {
            name = LiquidFuel
            resourceFlowMode = STAGE_STACK_FLOW_BALANCE
            ratio = 1
            DrawGauge = True
        }
        atmosphereCurve
        {
            key = 0 640000000 0 0
        }
        // Jet params
        atmChangeFlow = True
        useVelCurve = True
        useAtmCurve = True
        machLimit = 0.75
        machHeatMult = 3.5
        velCurve
        {
            key = 0 10 0 0
            key = 0.1 0.5 0 0
            key = 2.4 0 0 0
        }
        atmCurve
        {
            key = 0 0 0 0.7448742
            key = 0.072 0.13 2.075459 2.075459
            key = 0.16 0.28 1.464173 1.464173
            key = 0.42 0.578 0.93687 0.93687
            key = 1 1 0.5529748 0
        }
    }
    MODULE
    {
        name = ModuleAnimateGeneric
        animationName = ThrustReverser
        startEventGUIName = Reverse Thrust
        endEventGUIName = Forward Thrust
        actionGUIName = Toggle Thrust Reverser
        layer = 1
    }
    MODULE
    {
        name = FXModuleAnimateThrottle
        animationName = propeller
        responseSpeed = 0.05
        layer = 2
        dependOnEngineState = True
        dependOnThrottle = True
        weightOnOperational = True
        affectTime = false
        baseAnimSpeed = 0.01        // base + (throttle setting * multiplier)
        baseAnimSpeedMult = 10
        playInEditor = False
        animWrapMode = 2      //    Default = 0    Once = 1        Clamp = 1    Loop = 2        PingPong = 4    ClampForever = 8
    }
    MODULE
    {
        name = ModuleSurfaceFX
        thrustProviderModuleIndex = 1
        fxMax = 0.5
        maxDistance = 20
        falloff = 2
        thrustTransformName = smokePoint
    } 
    EFFECTS
    {        
        running_thrust
        {            
            AUDIO
            {
                channel = Ship
                clip = sound_jet_deep
                volume = 0.0 0.0
                volume = 0.05 0.2
                volume = 1.0 0.5
                pitch = 0.0 1.2
                pitch = 1.0 2.0
                loop = true
            }
            PREFAB_PARTICLE
            {
                prefabName = fx_smokeTrail_light
                transformName = smokePoint
                emission = 0.0 0.0
                emission = 0.05 0.0
                emission = 0.075 0.25
                emission = 1.0 1.25
                speed = 0.0 0.25
                speed = 1.0 1.0
                localOffset = 0, 0, 1
                localRotation = 1, 0, 0, -90
            }                    
        }
        running_turbine
        {
            AUDIO
            {
                channel = Ship
                clip = sound_jet_low
                volume = 0.0 0.0
                volume = 0.05 0.35
                volume = 1.0 0.5
                pitch = 0.0 0.6
                pitch = 0.05 0.8
                pitch = 1.0 1.5
                loop = true
            }
        }
        engage
        {
            AUDIO
            {
                channel = Ship
                clip = sound_vent_medium
                volume = 0.8
                pitch = 2.5
                loop = false
            }
        }
        disengage
        {
            AUDIO
            {
                channel = Ship
                clip = sound_vent_soft
                volume = 0.8
                pitch = 2.5
                loop = false
            }
        }
        flameout
        {
            PREFAB_PARTICLE
            {
                prefabName = fx_exhaustSparks_flameout_2
                transformName = smokePoint
                oneShot = true
            }
            AUDIO
            {
                channel = Ship
                clip = sound_explosion_low
                volume = 1.0
                pitch = 2.0
                loop = false
            }
        }
    }

MODULE
{
    name = FXModuleConstrainPosition
    matchRotation = true
    matchPosition = false
        CONSTRAINFX
    {
        targetName = rudder
        moversName = rudder1
    }
        CONSTRAINFX
    {
        targetName = rudder
        moversName = rudder2
    }
}

    MODULE
    {
        name = Floatsystem
        Stability = 500
        yaws = 1
        yawc = 3
    }

    MODULE 
    
    {
        
        name = Hangar
        
        EnergyConsumption = 1.6
        
        //AnimatorID = Hangar
        
        Trigger = trigger_hangar
    
    }
    
    
    MODULE
    
    {
        
        name = HangarStorage
        
        HangarSpace = hangar_space
        
        SpawnTransform = launch_position
    
    }


}

 

 

Link to comment
Share on other sites

The ship is nowhere near it's max temp so that's why it is locked at 50 seawater despite the missile hits. Try a value ranging from maxTemp = 2000 to maxTemp = 10000 and it should sink within a reasonable amount of hits. maxTemp has been tricky to balance for me in the previous year, especially with NAS.

And for the problem of not sinking just add some 0s to the resource SeaWater maxAmount if it still refuses to sink.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...