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

I've just posted 1.4 Beta 5 revision 1 which just fixes a small error that snuck in last night, where an already failed part could fail again.

Full changelog for Beta 5 (sorry, it was late last night and I just wanted to get to bed)

  • Fixed next check not resetting on situation change
  • Added DefaultSettings.cfg to PluginData - this allows you to configure failure settings to your liking
  • Added option for a separate timeBetweenChecks for Planes (and technically reentry too, but it's mostly geared towards planes). This kicks in when the vessel is in atmosphere and has a MET of >5 minutes. It's set the same as "rockets" (<5 minutes) right now, but the option is there if you want it.
  • Logger will now delete logs more than 24hrs old
  • Initial failure rate is now baseChance/generation.
  • Fix parts magically repairing themselves (dont ask)

 

Edited by severedsolo
Link to comment
Share on other sites

Cheers for the active development of this fun:

I did a couple of tries with this craft: https://kerbalx.com/XLjedi/FA-38-Nemesis It's particularly fun for O Scrap! since it has an array of 16 (20?) small jets for VTOL capabilities (and it's a hoot to fly).

I first tried it out with v1.3.5 and experienced the usual gradual failure of tanks, engines, and control surfaces, with the cockpit always considered the "worst" part (yellow highlight). Having that array of small engines was fun since they would slowly drop out of service or explode as I flew around the KSC. :)

Wiped the scrapyard scenario from my save to clear the part history, and installed B5r2 above, and ran the same craft through it as if it were fresh off the line. All gen 1 parts, craft rating terrible. Taking it on a similar circuit around KSC for a few minutes, waiting for the >5 timer to kick in and just experienced a series of engine failures. Mostly fuel leaks/exploding engines, but I think there was an under-thrust in there as well. This was by no means a comprehensive test, but it does seem far more biased toward (6-7) engine failures and zero control surface, or tank issues.

Seems the cockpit is rarely the *actual* worst part on a craft. :)

Edited by Beetlecat
Link to comment
Share on other sites

9 hours ago, Beetlecat said:

Seems the cockpit is rarely the *actual* worst part on a craft. :)

That's a problem with changing over to the new system. The "worst part" checks the safety ratings and if the rating is lower than the one it knows about, it sets that one as the worst part instead. This used to be acceptable because the safety rating was directly tied to the failure chance. Now the safety rating is relative to the part, so a part with a lower base failure chance (like cockpits which are full of reaction wheels and batteries) can still report itself as "terrible" even though your engines will be worse. I'll change it so it actually checks failure chance rather than just the safety rating.

9 hours ago, Beetlecat said:

This was by no means a comprehensive test, but it does seem far more biased toward (6-7) engine failures and zero control surface, or tank issues. 

This one is a craft specific issue, and one which I don't have a good answer to right now. Please note this is all guesswork at this point, I will load that craft up in debug mode later, so I can examine exactly what's happening, but this is my best guess:

I think what's happening is that when the list is being sorted by failureChance it's putting the engines above the control surfaces (they have the same failure rate). The tanks will also be lower down in the list, because they have a slightly lower chance of failing anyway. As your craft has a large number of engines, you are getting a disproportionate number of rolls against the engines. Once it finds a part to fail, it stops looking. - In short, you have too many engines ;)

The reason this didn't happen in 1.3.5 was because each part rolled for itself individually. The thing is, every part rolling for itself is really awful for performance (noticeably so, and I have a really good computer). That''s the main reason we roll against the vessel rather than each part now.

The only way I can think of around this right now, is to roll every part anyway, record which ones failed, then pick one of those at random. That brings it's own problems though (like, we have no guarantee that the bad parts are going to fail first)

Link to comment
Share on other sites

Is it too simplistic to start in Plane Mode if it launches from the runway, vs Rocket Mode if it launches from the launch pad?  (no idea if it's even possible to do such a check)

Edited by fourfa
Link to comment
Share on other sites

1 hour ago, fourfa said:

Is it too simplistic to start in Plane Mode if it launches from the runway, vs Rocket Mode if it launches from the launch pad?  (no idea if it's even possible to do such a check)

I wish it were that easy.

Also, I just want to clarify something as a few people have mentioned this now: right now at default settings "plane mode" and "rocket mode" for atmosphere are exactly the same thing. However, there is an option for "plane mode" to have different check times to "rocket mode" (I need better names for these things) - it just happens that they are set to the same thing right now (that will probably change though)

Link to comment
Share on other sites

Something that might not have been considered is that if you include the DefaultSettings.cfg file with the mod, ckan will probably overwrite it during updates (as I understand it anyway). Might be better to have the mod generate the default file automatically (if that's possible) or share it as an optional download that can be just dumped into the folder after installation.

Link to comment
Share on other sites

8 minutes ago, strudo76 said:

Something that might not have been considered is that if you include the DefaultSettings.cfg file with the mod, ckan will probably overwrite it during updates (as I understand it anyway). Might be better to have the mod generate the default file automatically (if that's possible) or share it as an optional download that can be just dumped into the folder after installation.

That's a good point, and one I hadn't considered. I will change it so it auto-generates, thanks.

Link to comment
Share on other sites

Oh Scrap 1.4 Beta 6 is now available get it here

  • Changed initial failure rate generation (again)
  • Logger will no longer log when nothing happened.
  • Add option to remove funds that StageRecovery gives you if that mod is installed. (UNTESTED)
  • "Worst part" will now display the worst part in terms of failure rate, rather than guessing by safety rating.
  • Rebalanced atmospheric/plane failure rates a little

 

Barring any unforseen circumstances, this will probably be the last beta before I put out a Release Candidate.

Things I need to look at:

  • SRBs dont highlight on failure.
  • Not sure repair checks are working (succeed too often)
  • Probably need to rebalance planes again.
Link to comment
Share on other sites

So just a little update on where I am with this.

I've been doing some serious balance testing, and I think by jove I've finally got it right. I just need to investigate an issue where repair rolls are always succeeding, and I will be ready to push a release candidate.

Also, I mentioned before that I was going to release my spreadsheet that I use to do the balancing. I've decided not to do this, just simply because it's not useful to you guys. I have the advantage that I can pull data directly out of the mod in real time, unless your willing to compile it yourself, that's not going to work for you.

So instead, I've put it in the mod instead! With the next release, if you have "extra logging" enabled, it will also tell you the chances of a failure happening in the next x amount of time. With a few caveats:

1) The calculation breaks down in space mode. Basically, according to the maths, the chance of a failure event happening approaches 100% so closely that it makes no odds in 30 days (which is my benchmark for space mode) this means that a reliable ship will report itself as having a 40%+ chance of failure in the next 30 days. Real life testing does not support this.TLDR: Take space mode calculations with a pinch of salt as the formula can't handle such a large amount of events. I recommend balancing for atmospheric and planes and letting space sort itself out.

2) It takes a shortcut when calculating the "per part" rates. It assumes that all parts have the "average" failure rate. This means that it will never be 100% accurate but should give you a good "ballpark figure".

Link to comment
Share on other sites

On 11/15/2018 at 9:35 AM, severedsolo said:

So just a little update on where I am with this.

I've been doing some serious balance testing, and I think by jove I've finally got it right. I just need to investigate an issue where repair rolls are always succeeding, and I will be ready to push a release candidate.

Heyo! Sitting down to test this out on longer missions, does it make sense to wait until your next release? Thanks in advance!

Link to comment
Share on other sites

Have a bit of confusion with part generations @severedsolo. I have a set of gen 4 plane part that have multiple (4+) uses.

I recover the vessel into SPH inventory, then go to edit it and replace those parts using the "use new part" button in scrapyard. This does not, however, increase their generation. 

Does generation only increase for parts that are either destroyed or recovered using the stock "recovery" button, and not for the "Recovery craft into inventory" one?

Also, every time we recover an aircraft from the runway into inventory, the editor looks like it's orienting it like a rocket, plane is doing a tail stand next time you launch it. You have to to and edit the craft from inventory and reset it's orientation 90 degrees or hilarity ensues upon loading it to the runway.

Wasn't sure if this is supposed to go in ScrapYard or OhScrap, but thought generations were a function of OhScrap so here it is.

Link to comment
Share on other sites

8 hours ago, DasValdez said:

Heyo! Sitting down to test this out on longer missions, does it make sense to wait until your next release? Thanks in advance!

I'd wait for the next release, I will try and get it out today (meant to do it yesterday, but had a stupidly busy day)

7 hours ago, DasValdez said:

Does generation only increase for parts that are either destroyed or recovered using the stock "recovery" button, and not for the "Recovery craft into inventory" one?

Active Vessel Recovery is a bit funky at the moment, I can't remember if its ScrapYard or OhScrap causing it, but it's never really worked very well - I seem to remember I did figure out what it was, but I've forgotten again - will take another look, probably I need to listen for an event or something.

7 hours ago, DasValdez said:

Also, every time we recover an aircraft from the runway into inventory, the editor looks like it's orienting it like a rocket, plane is doing a tail stand next time you launch it. You have to to and edit the craft from inventory and reset it's orientation 90 degrees or hilarity ensues upon loading it to the runway. 

That's a KCT issue - according to magico , KSP REALLY doesn't like it when you try and force a vessel back into a craft file. The guy who's taken it over is doing a big rewrite at the moment though, so maybe that's something he'll look at.

Edited by severedsolo
Link to comment
Share on other sites

Oh Scrap Release Candidate 1 Released

  • Decouple vessel failure rate from part failure rate (will mean less wild variations when adjusting the MM patches)
  • Fixed repair rolls
  • Plane Mode now kicks in after 2 minutes
  • Plane mode checks now occur every 150 seconds
  • Fixed Solar Panels "failing" when they were physically incapable of doing so.
  • Extra logging will attempt to calculate probability of a failure occurring in next 2 minutes (atmospheric)/5 minutes(plane)/30 days(space). See post further up this page for caveats on this.

 

Edited by severedsolo
Link to comment
Share on other sites

12 hours ago, severedsolo said:

Active Vessel Recovery is a bit funky at the moment, I can't remember if its ScrapYard or OhScrap causing it, but it's never really worked very well - I seem to remember I did figure out what it was, but I've forgotten again - will take another look, probably I need to listen for an event or something.

Excellent... right now the lack of progression in reused plane parts is the biggest hamper to aircraft. Its really cool to bring the plane into the hangar and overhaul (replace with new parts, really) the engines and control surfaces after x flights, or after a failure, but right now swapping them out never increases the generation.

Two quick questions: 

1) Do you know any workaround which would allow me to increment the generations given that they don't increment on active vessel recovery?

2) Right now, is there a way via configs to increase expected lifetime of plane parts? I see how I can do control surfaces, but engines seem to be grouped under all engine types, and same with fuel tanks. Its done by a wider "tank" config and not on a part by part basis?

This is really getting dialed in!

Link to comment
Share on other sites

36 minutes ago, DasValdez said:

1) Do you know any workaround which would allow me to increment the generations given that they don't increment on active vessel recovery?

No sorry. I did test and it's working properly on actually building it in the SPH, but that's not really a workaround. If it's doing what I think it's doing, I can put a quick and dirty hack in to re-evaluate the failure rates/generations if it notices the ID changes, until I can get to looking at it properly. I could even get that in before the main release probably.

36 minutes ago, DasValdez said:

2) Right now, is there a way via configs to increase expected lifetime of plane parts? I see how I can do control surfaces, but engines seem to be grouped under all engine types, and same with fuel tanks. Its done by a wider "tank" config and not on a part by part basis? 

Really complicated MM patching lol. Depends on how you want to do it,

If you wanted to target a specific part (say the Terrier) for example you could do this (note that this is untested pseudopatching, names may not match up to anything, I'm just using them as examples) - always use :FINAL so you know they will be patched after OhScrap has finished it's own patching (you can't use :AFTER[OhScrap] because it does a run then to add the Events Module):

@PART[liquidEngine1]:FINAL
{
	@MODULE[EngineFailureModule]
	{
		@baseChanceOfFailure = 0.1
		@expectedLifeTime = 45 //originally 6
	}
}

Or if you wanted to effect all tanks that had a specific resource, you could do something like this

@PART[*]:HAS[@RESOURCE[LiquidFuel]:FINAL
{
   @MODULE[TankFailureModule]
    {
       @baseChanceOfFailure = 0.1
       @expectedLifetime = 12
    }
}

Or, if you want to get REALLY fancy and only effect engines that have LF but no Oxidiser, you could do this (note that as written this would also affect Nervs)

@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[Oxidiser]]]:FINAL
{
	@MODULE[EngineFailureModule
	{
		@baseChanceOfFailure = 0.11
		@expectedLifetime = 24
	}
}

My point is - it's all handled by MM, so you can get out of it by MM too. You can even delete the cfgs I've put in and write your own. As long as the module names match the class names, it shouldn't care.

I will say though, planes behave MUCH better with the RC - 2.5 minutes between checks feels like a good place for 15-30 minute flights.

Edited by severedsolo
Link to comment
Share on other sites

So I haven't had time to test this yet, but how well does this work on existing saves? I would like to update (I might wait until the new version is fully released) but I'm wondering if I'll have to do some save-file editing to make sure my existing ships don't get their failure rates reset to generation one. If anyone has tested this please let me know, otherwise I can test it when I get the time (probably some time in the next week or so)

Link to comment
Share on other sites

9 minutes ago, BobTheRocketeer said:

So I haven't had time to test this yet, but how well does this work on existing saves? I would like to update (I might wait until the new version is fully released) but I'm wondering if I'll have to do some save-file editing to make sure my existing ships don't get their failure rates reset to generation one. If anyone has tested this please let me know, otherwise I can test it when I get the time (probably some time in the next week or so)

Tried it, by default all parts on flying craft go to gen 0 and your Space Station falls apart in a hilarious, but very kerbal, way.

Link to comment
Share on other sites

8 minutes ago, BobTheRocketeer said:

I'm wondering if I'll have to do some save-file editing to make sure my existing ships don't get their failure rates reset to generation one.

No need for save-file editing, the tracker (and ScrapYard) work as they always did.

Backing up your save is a good idea thoough just in case

Link to comment
Share on other sites

18 minutes ago, DasValdez said:

Tried it, by default all parts on flying craft go to gen 0 and your Space Station falls apart in a hilarious, but very kerbal, way.

 

18 minutes ago, severedsolo said:

No need for save-file editing, the tracker (and ScrapYard) work as they always did.

Backing up your save is a good idea thoough just in case

So all existing ships have their parts reset to gen 0 failure rates? What about parts themselves (i.e. does a simple probe core that would be like gen 50 or so on the old version get reset to gen 0 failure rate on a new ship?)

Link to comment
Share on other sites

16 hours ago, severedsolo said:

Oh Scrap Release Candidate 1 Released

  • Decouple vessel failure rate from part failure rate (will mean less wild variations when adjusting the MM patches)

 

For a second I was worried decouplers were going to start malfunctioning. Or do they not yet already? :D

Link to comment
Share on other sites

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