Jump to content

[1.8.x] Oh Scrap!- A ScrapYard based Part Failure and Reliability Mod 2.0.1 (07/12/2019)


severedsolo

Recommended Posts

@severedsolo @Lan_Morehell

I already had the idea of personel to be added to the mod.

Like employ a scientist and an engineer - these are the chiefs of ground staff.
ofc Bill and Bob can take these roles.

  1. They can not assign to missions
  2. They could / should increase skill, corresponding to KCT, ScrapYard and mission results (so Oh Scrap! itself)
  3. Their skill affects the MBT and also the random factor
  4. Their wages are corresponding to mods like MonthlyBudget, but slightly higher than the "normal" staff to compare the "no mission for you" factor
  5. mods like KerbalRenamer should not crash the mod / game
  6. EarnYourStripes should also work with it

Edit:

Why?

Because I can't stand it that every new part is prone of having a failure at the first two launches.
So I thought "engineers and scientists also get better, they don't always invent the wheel again and again" ...

Edited by Gordon Dry
Link to comment
Share on other sites

4 hours ago, Lan_Morehell said:

s sthere any chance to get a summary of failed parts and kinds of failures during flight? Or at least see a failure description in part menu?

Check your messages app. It posts a message telling you what failed, and how it failed, and repeats those messages when you reload the craft. Having said that, I'm half open to puting it in the PAW, but I'm wary of clogging up PAWs even more than they already are. I'll consider it.

The mod used to list broken parts in the GUI but it was a) ugly b) a freaking mess to maintain/debug and c) hardly ever used by me. (I'm a very selfish modder. I write features for myself. If I don't want it/won't use it, it usually doesn't go in). It won't be making a re-appearance any time soon.

4 hours ago, Lan_Morehell said:

How to get the actual failure probability of a particular part? now in context menu I can only see the safety rating, which somewhy never gets above 5. But how can I convert rating into probability per flight hour or minute, or flight cycle? 

You can't. Not directly anyway. Unless you fancy compiling from source and putting it in Debug mode. Actual numbers are meaningless anyway, a ship made of 30 parts at 10% each is actually pretty likely to fail. The safety rating system converts it to a more meaningful number to give you an idea of "am I going to suffer problems or not".

4 hours ago, Lan_Morehell said:

How fast the failure probability decreases? What time the part should spend in flight so the failure probability drops twice? What flight time counts towards it? Does the time spent as a space waste count (some tanks can orbit for years in this case) 

What are the conditions for test firing the part? should it leave the ground? If i make a test facility that jumps for 1m, then lands back on kerbin and spends there an hour, engine running at idle until zero fuel, then recovers - does it count?

These two are the same question, and that's answered in the FAQ

1 hour ago, Gordon Dry said:

Because I can't stand it that every new part is prone of having a failure at the first two launches.
So I thought "engineers and scientists also get better, they don't always invent the wheel again and again" ...

It's not a bad idea, but it's not going to happen.

First of all, this is primarily designed as a KCT companion mod. KCT resets the "build time buff" on every single new part too, so clearly the engineers don't learn. Secondly, it sounds like a lot of effort to code for not much payoff, offsets one of the core design features of the mod, and I probably wouldn't use it (see comments about selfish modding above).

Edit: Post above may be a little snarkier than usual, it's been a long day, if so I apologise.

Edited by severedsolo
Link to comment
Share on other sites

4 minutes ago, severedsolo said:

It's not a bad idea, but it's not going to happen.

I can patch it myself, just trying it the next session with:

Spoiler

@PART[*]:HAS[@MODULE[AntennaFailureModule]]:FINAL
{
	@MODULE[AntennaFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[BatteryFailureModule]]:FINAL
{
	@MODULE[BatteryFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[ControlSurfaceFailureModule]]:FINAL
{
	@MODULE[ControlSurfaceFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[EngineFailureModule]]:FINAL
{
	@MODULE[EngineFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[ParachuteFailureModule]]:FINAL
{
	@MODULE[ParachuteFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[RCSFailureModule]]:FINAL
{
	@MODULE[RCSFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[ReactionWheelFailureModule]]:FINAL
{
	@MODULE[ReactionWheelFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[SolarPanelFailureModule]]:FINAL
{
	@MODULE[SolarPanelFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[SRBFailureModule]]:FINAL
{
	@MODULE[SRBFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

@PART[*]:HAS[@MODULE[TankFailureModule]]:FINAL
{
	@MODULE[TankFailureModule]
	{
		@baseChanceOfFailure /= 10
		@expectedLifetime *= 3
	}
}

 

 

Link to comment
Share on other sites

Is the new requirement checking for both a staging event AND the 1 m/s requirement? I just staged an SRB with a parachute to test my chute and the SRB failed. Since the rocket didn't reach 1 m/s it looks like the parts weren't recovered by ScrapYard.

EDIT: Just confirmed this is happening with only KCT, ScrapYard, and OhScrap installed. If the vessel doesn't reach 1 m/s but you still staged, the parts are not recovered.

EDIT 2: Also confirmed this does not happen with OhScrap 1.3.2

Edited by Kwebib
Link to comment
Share on other sites

7 hours ago, Kwebib said:

Is the new requirement checking for both a staging event AND the 1 m/s requirement? I just staged an SRB with a parachute to test my chute and the SRB failed. Since the rocket didn't reach 1 m/s it looks like the parts weren't recovered by ScrapYard.

It should be either/or. Can you reproduce and send me the log please?

Might be a few days until I get to it, my daughter just got accepted into her first choice school, and I've got family stuff going on, so I'm spending the weekend visiting relatives and school uniform shopping.

Edit: Actually @Kwebib I think I found the problem. Try the latest dev build, tell me if that fixes it.

Edited by severedsolo
Link to comment
Share on other sites

Are resource tanks still support to fail (leak)? They were failing last week for me, but after updating it does not seem to happen any more (option is on in difficulty settings).

Link to comment
Share on other sites

9 minutes ago, Proply said:

Are resource tanks still support to fail (leak)? They were failing last week for me, but after updating it does not seem to happen any more (option is on in difficulty settings).

Log please.

Link to comment
Share on other sites

20 hours ago, severedsolo said:

You can't. Not directly anyway. Unless you fancy compiling from source and putting it in Debug mode. Actual numbers are meaningless anyway, a ship made of 30 parts at 10% each is actually pretty likely to fail. The safety rating system converts it to a more meaningful number to give you an idea of "am I going to suffer problems or not".

 

Thanks! But then it really lacks the score base value... Safety rating is 1 from what? 1 of 5 and 1 of 20 makes a big difference. At what rating part failure is extremely remote? Maybe a brief description may be added for a good understanding? something like 1:"this piece of sh... was broken even before assembly on a vessel" and 10:"shiny piece of art that can make it to the hell and back without a scratch"

 

It there any way to adjust the speed of safety growth? foe example slow it by half, so the part doesnt get relianble too fast

Link to comment
Share on other sites

28 minutes ago, Lan_Morehell said:

Thanks! But then it really lacks the score base value... Safety rating is 1 from what? 1 of 5 and 1 of 20 makes a big difference. At what rating part failure is extremely remote? Maybe a brief description may be added for a good understanding? something like 1:"this piece of sh... was broken even before assembly on a vessel" and 10:"shiny piece of art that can make it to the hell and back without a scratch" 

Caveat: The following is true for the latest version of Oh Scrap! - I have a feeling you mentioned somewhere you were on 1.3.1 still, so the below may or may not be true for those versions (it went through alot of changes)

Gonna guess you haven't opened the GUI ;) - the rating system goes from 1-5 and is labelled in there from "terrible" to "excellent" depending on the rating (for the worst part).

If you want actual numbers, the math isn't terribly difficult:

            float safetyCalc = 1.0f - ((float)displayChance / safetyThreshold);
            if (safetyCalc > 0.95) safetyRating = 5;
            else if (safetyCalc > 0.9) safetyRating = 4;
            else if (safetyCalc > 0.8) safetyRating = 3;
            else if (safetyCalc > 0.7) safetyRating = 2;
            else safetyRating = 1;
            // if the part is damaged beyond the safety rating then it gets a 0
	    if (displayChance > safetyThreshold) safetyRating = 0;

Reversing that formula, we know that a safety rating of 5 will get a minimum score of 0.96 (2 sf) - assuming the default safety theshold of 25% this means a part with a safety rating of 5 has a maximum failure rate of 1% (calculated by this website using the formula 0.96 = 1-x/25) - 1% is also the minimum required for a part failure to even be considered, so at 5 the failure is (almost) certainly not going to happen.

Using that formula on the other ratings, you get:

Safety Rating 4: max failure rate = 2.25%

Safety Rating 3: max failure rate = 4.75%

Safety Rating 2: max failure rating 7.25%

Safety Rating 1: max failure rating 25% (because it can't exceed the safety threshold, or it gets a 0)

Hopefully, you see now why I use a safety rating rather than give you the numbers. A failure rate of 7.25% sounds really unlikely, but if they all have that rating then even a 10 part vessel, the probability of at least one of those parts failing is  72.5%. By contrast, a safety rating of 4 on the same vessel, gives you just a 22.5% chance of failure, which is quite unlikely (this assumes the unlikely scenario that all parts have the same safety rating, this is probably not the case, but these are "worst case scenario" figures).

48 minutes ago, Lan_Morehell said:

It there any way to adjust the speed of safety growth? foe example slow it by half, so the part doesnt get relianble too fast

That depends, if you mean "when I recover a part can I stop it becoming the most reliable it's ever going to be" then no. That's a core mechanic of the mod. If you mean, "can I stop the safety rating from growing so much on each consecutive build" the answer is "kinda" - you can increase the baseFailureRate in the MM patches, and the failure rates will be adjusted accordingly and indirectly do this, the actual formula is hard coded though.

Link to comment
Share on other sites

Severedsolo,

Thank you for this mod.  It's a must-have by me.

If I might make a request though, it'd be (the option) to not report part failures on debris.  I've done a string of rescue missions which have left derelicts and scraps in LKO.  I don't go out of my way to delete these items from the tracking station, but I do set them to debris as I evacuate them.  Now, whenever I'm around Kerbin (extended physics range), I get all kinds of part failure notifications from the various scraps, hulks, and derelicts I've evacuated.  It's mostly annoying message spam until something I care about fails and I don't notice because it got lost in the noise.

Still, thank you!

Link to comment
Share on other sites

1 hour ago, severedsolo said:

 

That depends, if you mean "when I recover a part can I stop it becoming the most reliable it's ever going to be" then no. That's a core mechanic of the mod. If you mean, "can I stop the safety rating from growing so much on each consecutive build" the answer is "kinda" - you can increase the baseFailureRate in the MM patches, and the failure rates will be adjusted accordingly and indirectly do this, the actual formula is hard coded though.

Thanks for such a detailed answer. Getting clear now

I mean that fot example my FL-T800 gots rating of 5 after only 5 or so launches. Which means that from now on I can forget about this part in terms of probable failure. And this is even before i have reached the surface of the moon in career. I'm really afraid that by the time I advance to something farther than Duna, my ships may become absolute redundant... and that neglects the mod meaning :(

Link to comment
Share on other sites

20 minutes ago, Lan_Morehell said:

I'm really afraid that by the time I advance to something farther than Duna, my ships may become absolute redundant... and that neglects the mod meaning

Speaking as a player, rather than the developer of this mod: This largely becomes not a problem. Although the 1.25m parts are super reliable at this point, at the point you are going to Duna, you are probably using 2.5m parts, and if your not, your still using bigger antenna/parts. I'm getting plenty of failures on my Duna/Eve missions.

I hear what you are saying though, I think I'll probably at some point make the "maximum reliability" point configurable (its only like one line of code).

Edited by severedsolo
Link to comment
Share on other sites

1 hour ago, Kwebib said:

@severedsolo Had time for a quick check. The dev build fixes the issue. My SRB failed, and didn't take off, and all parts were recovered.

Sweet. I was playing around with the GameEvents to try and get it working without needing to stage, and apparently I forgot to change that one back. Dev build should be fine to use for now (literally just that one change) I'll do a formal release at some point tomorrow probably.

Link to comment
Share on other sites

@severedsolo With my "slightly" altered patch config I had my first failure ...

Not so often, but it happens (it was ullage SRB, made the 2nd stage rotate, but Jeb did it whatsoever) ...

Edit:

Well, these values are high enough, for real.

I have a mission with a mix of Gen 1 to Gen 3 parts, some new, some used max. 2x - and 4 parts already failed.

  • Bill was capable of repairing an SRB retro thruster on EVA (Stage 2 -> Stage 3)
    (The stages are still attached, I got way enough dV, but I need way more for an inclination change to 45° for a contract)
  • The Gemini pod's CommNet is broken, luckily I got Gemini solar antennas at the GSM
  • The GSM's RCS is broken, but I have RCS attached radially so I hope it's okay ... I hope the engine works but to be safe I should do the reentry burn with stage 3
  • On top of the Gemini was a "supply and target buoy" made by Agena parts, filled with EC, TAC-LS and MonoProp.
    Before decoupling it I received the message that one SolarBattery leaks StoredCharge

So enough fun, also with a 1/10th of the chance of a failure and 3x the life expectancy.

Edit:

@severedsolo I just learned that I have not even the possibility to repair a broken part at another vessel than the active one - so the decoupled buoy with the broken SolarBattery is out of repairability for me while on EVA with Bill. Right-clicking the part only shows "Aim Camera" as only possible interaction.
The buoy is just 220m away so I tried it before doing the inclination burn...

Edit:

Because I'm in the mood and the sun just set:

Spoiler

The main vessel
o7czSqx.png
You can see the buoy below/behind it, about 100m away - it got indicator lights blinking in green

The buoy
4KZS3p8.png

From the other side with the main vessel in background
hvXB1Wq.png

And the main vessel from the same direction
sWdU23b.png

27 min. later, shortly before the inclination burn, the nearest encounter to the buoy:
s5J8xJ1.png

Camera aimed at buoy, other direction:
Uq0ay4e.png

 

Edited by Gordon Dry
Link to comment
Share on other sites

Here's something that might be of interest. I sometimes take mod subfolders out and put them directly into the GameData folder. For example, with this mod I placed the OhScrap folder directly in the GameData folder, rather than a subfolder of Severedsolo as it is supplied. Makes it easier to see what mods are there by looking at the folder list, rather than having to go into each folder when I don't remember what the Severedsolo mod does. :D I've not noticed any problems before with other mods, but in this case doing that makes the mod not work.

Not implying this is a problem or something that should be changed. Just mentioning it here as other people may have a similar thought process and not mention that when they ask for support when it doesn't work. Can add it to the list of things to check before spending too much time on resolving a non-issue.

Going to check all my mods now to make sure I'm not missing any others that come in subfolders. Who know what isn't working because of my silliness?? :/

Link to comment
Share on other sites

22 hours ago, Thwomp said:

If I might make a request though, it'd be (the option) to not report part failures on debris.

It didn't even occur to me that would be a problem as I use a standard physics range, but it's easily fixed I'll put it into the next update. Edit: Done. Try the latest dev build if you like Release incoming.

18 hours ago, Gordon Dry said:

I just learned that I have not even the possibility to repair a broken part at another vessel than the active one - so the decoupled buoy with the broken SolarBattery is out of repairability for me while on EVA with Bill. Right-clicking the part only shows "Aim Camera" as only possible interaction.

You were way out of range, the range for EVA repairs is only about 5m.

Also:

18 hours ago, Gordon Dry said:

Bill was capable of repairing an SRB retro thruster on EVA (Stage 2 -> Stage 3)

Repairing an SRB should just give you a message about how this is a really bad idea. Can you tell me the part you used this on (and the mod it came from if applicable)

@strudo76 - yeah don't mess with folder structures. Usually stuff like that is shipped that way for a reason. In Oh Scraps case it needs to load after ScrapYard, and KSP loads the folders in GameData in alphabetical order.

 

 

Edited by severedsolo
Link to comment
Share on other sites

7 hours ago, severedsolo said:

Repairing an SRB should just give you a message about how this is a really bad idea. Can you tell me the part you used this on (and the mod it came from if applicable)

Yes, there was this message and the retro SRB had a failure on staging, but because it was one of four, the tilt of the detached stage was not so bad...

Link to comment
Share on other sites

Oh Scrap 1.3.4 Released

  • Fixed OnLaunch() not firing immediately after staging.
  • Debris will no longer trigger failure messages (the failures will still happen, they will just fail silently)

 

Link to comment
Share on other sites

19 hours ago, severedsolo said:

You were way out of range, the range for EVA repairs is only about 5m.

 

Spoiler

 

Well, now I docked at the buoy with Gemini 2 and still can't repair...

I don't have to float 5m beneath the other vessel with Gemini 2 without docking, or do I really have to?
In security measures this is not what I should try to do.

The distance from the docking port to the part to be repaired is about 1.5m ... an RCS thruster block.
There is another one that also has to be repaired.

wBnreWT.png

Sorry, my bad, I'm not very used to Oh Scrap! - tried to repair the RCS block that is marked as worst part, not the really broken one.

It worked, mission accomplished, ready to do the reentry burn:

Spoiler

aEVsnRh.png

btw how about an "inspect part" feature like in Kerbalism?

Edited by Gordon Dry
Link to comment
Share on other sites

49 minutes ago, Gordon Dry said:

btw how about an "inspect part" feature like in Kerbalism?

That's where I'd love to find some way of blending the functions of this mod with Dang It! and even Kerbal Krash System (if it ever returns) -- ways to provide weighted/random, systemic, and user-induced part failures that can be fixed or replaced. "perform maintenance" can reduce the failure chance (or reset a MTBF counter...) etc.

Edited by Beetlecat
Link to comment
Share on other sites

@severedsolo I just can't leave you alone. :P

KSP: 1.4.3 Windows 7 64-bit

Problem: Generation also increments by one after recovering craft and hitting "Quick Apply" in ScrapYard.

Mods installed:

KCT 1.4.0.69

ScrapYard 1.1.0.107

Oh Scrap! 1.3.4

Module Manager 3.0.7

Reproduction steps:

1) Create craft on a launch clamp to do a "pad test".

2) Stage the engine

3) Recover

4) Load craft and hit "Quick Apply" in ScrapYard.

5) Previous Uses is 1 and Generation is 2

Log:

Output Log

EDIT: Looks like something screwy is happening down at line 23659 and beyond in the log. Not sure what it means, though.

Edited by Kwebib
Link to comment
Share on other sites

@severedsolo Could you please add StoredCharge to be fully recognized by Oh Scrap! because actuall the Tank Safety Rating is always zero?
This is the reason why the RealBattery parts have so many failures, even with my patch.
See here:
L4IeyqK.png
it doesn't matter if the part is new or has 5 previous uses.


 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...