severedsolo

[1.7.x] Oh Scrap!- A ScrapYard based Part Failure and Reliability Mod 1.6.3 (22/06/2019)

Recommended Posts

So I'm having a problem with the generation not advancing after a flight. I'm using v.1.1.1 as suggested earlier in the thread. I'm using the stock recover button after actually flying my craft (not just a static test), but not explicitly using any of the scrapyard functionality. 

My ksp log:

https://ufile.io/xo11qmee

Also, are parts supposed to be able to fail after being repaired? Once again this is with the corvus mod, the parachute/RCS combo failed twice. 

Share this post


Link to post
Share on other sites
4 minutes ago, subyng said:

So I'm having a problem with the generation not advancing after a flight. I'm using v.1.1.1 as suggested earlier in the thread. I'm using the stock recover button after actually flying my craft (not just a static test), but not explicitly using any of the scrapyard functionality. 

My ksp log:

https://ufile.io/xo11qmee

Also, are parts supposed to be able to fail after being repaired? Once again this is with the corvus mod, the parachute/RCS combo failed twice. 

I can be very much mistaken, but I thing that "generation" is how many times you have built a certain part during your career. It not advancing after a flight might be perfectly normal: If SY's auto-apply function is checked, every time a craft is assembled/loaded in the VAB/SPH, the mod tries using already built parts if they are available. The result is that at each new launch, usage number increases, while generation number keeps constant.
Recycling parts is a cost- and time-effective method if you are using SY's (experimental) fund override method and KCT, but every time  you re-use a part after the second usage the reliability of that part will decrease and, even worst, you will miss the advantages of increasing the generation number.

P.S: SrapYard v1.1.3 is out for testing. You might want to install that version instead of  v.1.1.1 :)

Share this post


Link to post
Share on other sites
3 minutes ago, gap said:

I can be very much mistaken, but I thing that "generation" is how many times you have built a certain part during your career. It not advancing after a flight might be perfectly normal: If SY's auto-apply function is checked, every time a craft is assembled/loaded in the VAB/SPH, the mod tries using already built parts if they are available. The result is that at each new launch, usage number increases, while generation number keeps constant.
Recycling parts is a cost- and time-effective method if you are using SY's (experimental) fund override method and KCT, but every time  you re-use a part after the second usage the reliability of that part will decrease and, even worst, you will miss the advantages of increasing the generation number.

P.S: SrapYard v1.1.3 is out for testing. You might want to install that version instead of  v.1.1.1 :)

But I am not recovering most of my rocket, so the number of times I am building those parts should increase, no?

Share this post


Link to post
Share on other sites
3 minutes ago, subyng said:

But I am not recovering most of my rocket, so the number of times I am building those parts should increase, no?

If you already built a given part and you didn't recover it (or you recovered it but you did not re-use it), and the next time you built a rocket including that part its generation number didn't increase, then something seems to be wrong. But, as I said before, if you want severedsolo to track down the problem, I think you should run another test using the last SrapYard version released today...

Share this post


Link to post
Share on other sites

Figured it out! It was an outdated version of Magicore that was causing the issue!

Share this post


Link to post
Share on other sites
On 5/7/2019 at 8:39 PM, gap said:

the safety rating calculation seems messed up. If I assemble a craft in the VAB or load a saved one, OhScrap's windows always gives me a safaty rating of 0 (horrible). In order to get the actual rating I must leave the craft loaded in the VAB, exit and enter it again.

 

On 5/7/2019 at 10:20 PM, severedsolo said:

it's under ScrapYard/3 and will be fixed before I go away :) For now, I highly recommend using SY 1.1.1 - literally the only change was the KRASH wrapper, which has messed things up.

I updated to ScrapYard 1.1.3 and the bug above still persists. All my old parts were originally built using SY 1.1.2 though. Could it be the reason why craft's safety rating is miscalculated in the VAB?

Share this post


Link to post
Share on other sites
Posted (edited)
8 hours ago, gap said:

 

I updated to ScrapYard 1.1.3 and the bug above still persists. All my old parts were originally built using SY 1.1.2 though. Could it be the reason why craft's safety rating is miscalculated in the VAB?

Could I get a log for that?

So you are saying the rating gets calculated if you exit and re-enter? Is this an auto-loaded vessel (pre-loaded when the Editor starts)? Or one that you are loading via the load menu when the Editor starts?

A craft file wouldn't hurt either (preferably something I can load into a stock-ish game)

Edit: Scratch that, I just ran into it myself. Will use my own logs :P

Edited by severedsolo

Share this post


Link to post
Share on other sites
Posted (edited)

@gap - I found the issue. It's cache invalidation.

Basically, the process of calculating the safety ratings is quite expensive, processing wise. So I do it once, cache the result, and then only update it when the EditorConstruct (your craft) changes. It looks like when you load a craft, it's grabbing the EditorConstruct before it's actually finished loading. The UI is then (correctly) noting that the cache is in an invalid state and aborting. Hey, at least I know that my error checking works :P

I've fixed that, and the UI will now actually point out that it's cache is bad, rather than just telling you your vessel is falling apart.

Edited by severedsolo

Share this post


Link to post
Share on other sites
25 minutes ago, severedsolo said:

@gap - I found the issue. It's cache invalidation.

Basically, the process of calculating the safety ratings is quite expensive, processing wise. So I do it once, cache the result, and then only update it when the EditorConstruct (your craft) changes. It looks like when you load a craft, it's grabbing the EditorConstruct before it's actually finished loading. The UI is then (correctly) noting that the cache is in an invalid state and aborting. Hey, at least I know that my error checking works :P

I've fixed that, and the UI will now actually point out that it's cache is bad, rather than just telling you your vessel is falling apart.

Sorry for the late reply and glad that you managed tracking down the error!
Let me know if you need anything else from my part, otherwise I will be patiently waiting for the next version :)

Share this post


Link to post
Share on other sites
4 minutes ago, gap said:

Sorry for the late reply and glad that you managed tracking down the error!
Let me know if you need anything else from my part, otherwise I will be patiently waiting for the next version :)

Nah, all fixed. I've got a couple of bits I want to put in, but I'll get the fix out soon.

Share this post


Link to post
Share on other sites
1 minute ago, severedsolo said:

Nah, all fixed. I've got a couple of bits I want to put in, but I'll get the fix out soon.

Sweet, thanks!

Share this post


Link to post
Share on other sites

Oh Scrap 1.6.2 Released

  • Fixed issue where Editor Ship was being cached before it had any parts.
  • UI will now point out that the Editor Ship has no parts, rather than just reporting Safety Rating 0

Share this post


Link to post
Share on other sites
On 6/19/2019 at 10:52 PM, severedsolo said:

Oh Scrap 1.6.2 Released

  • Fixed issue where Editor Ship was being cached before it had any parts.
  • UI will now point out that the Editor Ship has no parts, rather than just reporting Safety Rating 0

Just tested the last version. It works... more or less: when I enter the VAB and load a saved craft,  its safety rating is calculated correctly. Nonetheless if, after loading/assembling a craft, I push the "New craft" button and then I load another craft, I get again the usual "0" safety rating, even though tested parts are applied to the rocket. In order to make the safety rating calculation to work again, I need to exit the VAB and enter it again.

Replicating this bug should be easy enough, but if you prefer I can send you the logs of my last gaming session :)

 

Share this post


Link to post
Share on other sites
10 hours ago, gap said:

Just tested the last version. It works... more or less: when I enter the VAB and load a saved craft,  its safety rating is calculated correctly. Nonetheless if, after loading/assembling a craft, I push the "New craft" button and then I load another craft, I get again the usual "0" safety rating, even though tested parts are applied to the rocket. In order to make the safety rating calculation to work again, I need to exit the VAB and enter it again.

Replicating this bug should be easy enough, but if you prefer I can send you the logs of my last gaming session :)

 

So, legitimate bug (I hate caches so much), but does it not work if you make a change to the vessel? Like, remove a part and reattach it etc

Share this post


Link to post
Share on other sites
1 hour ago, severedsolo said:

So, legitimate bug (I hate caches so much), but does it not work if you make a change to the vessel? Like, remove a part and reattach it etc

Good question. When editing crafts (adding/removing parts) the safety rating is calculated correctly but, during my tests,  every time I made a change to the vessel, SY kept selecting a new core part (a capsule) rather than using a pretested one even though I had not changed that part and the "auto apply"  option was checked. In order to use that capsule on my vessel, I had to re-apply it manually whenever I added/removed any other part.

Share this post


Link to post
Share on other sites
43 minutes ago, gap said:

Good question. When editing crafts (adding/removing parts) the safety rating is calculated correctly but, during my tests,  every time I made a change to the vessel, SY kept selecting a new core part (a capsule) rather than using a pretested one even though I had not changed that part and the "auto apply"  option was checked. In order to use that capsule on my vessel, I had to re-apply it manually whenever I added/removed any other part.

Ooh I need a log of that please. That sounds like the "scrapyard doesn't like the root part" bug that I've never been able to track down

Share this post


Link to post
Share on other sites
3 minutes ago, severedsolo said:

Ooh I need a log of that please. That sounds like the "scrapyard doesn't like the root part" bug that I've never been able to track down

Okay, besides the log files, should I send you my save files?

Share this post


Link to post
Share on other sites
1 hour ago, gap said:

Okay, besides the log files, should I send you my save files?

Yeah that would be good actually, if you could just zip up the entire save folder, so I get your crafts too

Share this post


Link to post
Share on other sites
2 hours ago, gap said:

Okay, besides the log files, should I send you my save files?

Here you go:

https://www.mediafire.com/file/kmvaogmold4snnf/Files_for_Severedsolo_1.rar/file

I have include a CKAN file with the main mods I have currently installed. The VAB craft that I have played with for testing your mod should be the one called "Gliding Lizard V", but I think using any other rocket won't make much difference.

For now I think that's all from my part, but let me know if I can help you in any other way :)

Share this post


Link to post
Share on other sites

Oh Scrap 1.6.3 Released

  • Force Editor Ship cache to refresh when it gets itself into an invalid state.

Share this post


Link to post
Share on other sites
3 minutes ago, severedsolo said:

Oh Scrap 1.6.3 Released

  • Force Editor Ship cache to refresh when it gets itself into an invalid state.

Great news, thanks! Will the new version solve both the problems that we have discussed yesterday? (Safety rating calculation not working after pressing the 'New craft' button, and the root part resetting to new when a change to any other part is done)

Share this post


Link to post
Share on other sites
Just now, gap said:

Great news, thanks! Will the new version solve both the problems that we have discussed yesterday? (Safety rating calculation not working after pressing the 'New craft' button, and the root part resetting to new when a change to any other part is done)

Just the first one. The second is a ScrapYard bug.

This exercise has told me that I need to insert alot more logging into that Method though. Every one of those issues was caused because my error checking was working but just not actually printing anything to say it had caught the error.

Share this post


Link to post
Share on other sites
3 minutes ago, severedsolo said:

Just the first one. The second is a ScrapYard bug.

This exercise has told me that I need to insert alot more logging into that Method though. Every one of those issues was caused because my error checking was working but just not actually printing anything to say it had caught the error.

Okay, I will test the new version as soon as possible and I will let you know if I see any other problem with it. Hopefully the experience you have gained with this fix will help you ironing out similar small bugs.

Talking about the SY-related issue, do you think it can be solved as well? It is not a big problem indeed, but removing it would make ScrapYard a more polished and user-friendly product :)

Share this post


Link to post
Share on other sites
Just now, gap said:

Talking about the SY-related issue, do you think it can be solved as well? It is not a big problem indeed, but removing it would make ScrapYard a more polished and user-friendly product :)

Assuming I can reproduce it, I should be able to yes (or at least work around it). I've got a vague idea of what it is, I just don't have time to dive into it today. This was low hanging fruit (literally a one line fix).

Share this post


Link to post
Share on other sites

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.