net-lisias-ksp / KSP-Recall

Recall for KSP blunders, screw ups and borks.
GNU General Public License v2.0
25 stars 2 forks source link

Possible misbehaviour on a still unknown Add'On with KSP-Recall #44

Open Lisias opened 2 years ago

Lisias commented 2 years ago

Fellow Kerbonaut hugoraider is being screwed by what appears to be a misbehaviour triggered by an unholy interaction between KSP-Recall and (probably) B9PS.

The problems happens only when merging an existent craft into the current one. The misbehaviour is remarkably similar to what happens when AttachedOnEditor is needed but it's absent:

rf2dkER

Craft file: Vega 3.craft.zip

This craft needs:

Most dependencies weren't installed (on purpose). Only Shabby (and 0Harmony), due Conformal Decals, were installed while reproducing the problem as below:

screenshot59

What more or less matches the screen shot provided by the user.

Mission: Search and Destroy (the bug)

Lisias commented 2 years ago

Removing Not My Fault as it's too soon to be sure about. (added it by accident)

Lisias commented 2 years ago

It worths to be mentioned that the Attaching Nodes are completely missing on the merging craft - what apparently suggests that B9PS was the one initialising them - what suggests we have a problem similar to the one on Procedural Parts ( #41 ).

Lisias commented 2 years ago

Found something weird. With all the mentioned add'ons installed (with all the dependencies), I found that the problem I detected on my rig was due this exception:

[LOG 09:32:53.539] [KSP-Recall.AttachedOnEditor] TRACE: RestoreCurrentAttachmentPoints for <NO VESSEL>-HeatShield0:FFE5DB88
[EXC 09:32:53.541] ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
        System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <9577ac7a62ef4317
        System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <9577ac7a62ef43179789031239ba8798>:0)
        KSP_Recall.AttachedOnEditor.AttachedOnEditor.RestoreCurrentAttachmentNodes () (at <4fcb81485a754384981c83d6e7a0fc8d>:0)
        KSP_Recall.AttachedOnEditor.AttachedOnEditor.RestoreAttachments () (at <4fcb81485a754384981c83d6e7a0fc8d>:0)
        KSP_Recall.AttachedOnEditor.AttachedOnEditor.Update () (at <4fcb81485a754384981c83d6e7a0fc8d>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        KSPe.Util.Log.UnityLogDecorator:UnityEngine.ILogHandler.LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

Happening where AttachedOnEditor was working on the HeatShield0. But this part is a Stock one, and once I removed all that add'ons, this part behave while merging a craft with it.

So we have someone screwing up things here. And it's not me.

Lisias commented 2 years ago

It's weird and almost surely unrelated.

I edited the craft file to replace HeatShield0 with HeatShield1 (this last part doens't borks), but the problem remains. So this NRE is not causing neither affecting the problem.

Lisias commented 2 years ago

On the other hand…. A huge crapload of Exceptions are being thrown by the Part Loader:

KSP.log.zip

Let's remove the affected parts and see what happens...

Lisias commented 2 years ago

So, I removed the following directories

as well also:

Not all z_deprecated parts were at fault, but a huge load of them were, so I took some shortcuts in order to hush the diagnosis. I removed them all. :)

But yet, nothing changes. The problem is still there. :(

Lisias commented 2 years ago

Oukey, with the KSP.log clean from Exceptions, now I gone to the good and old Trial and Error.

And found that Tantares/parts/code_almaz/_grus_crew_s2_s1p5_1/grus_crew_s2_s1p5_1, Grus Size 1.5 Fuselafe, is the one borking on me.

screenshot60

Lisias commented 2 years ago

Found another one that causes problems: Tantares/parts/code_almaz/_grus_adapter_s2_s1p5_1/grus_adapter_s2_s1p5_1, Grus Size 2 to Size 1 Adapter.

screenshot61

Interesting enough, these two parts has fairings by ModuleProceduralFairing. I may had find a pattern.

Lisias commented 2 years ago

Oukey. So I removed SimpleAdjustableFairings and B9PartSwitch (as it complained about SAF) to see what happens.

Unsurprisingly, same problem. Whatever is happening, apparently is related to ModuleProceduralFairing.

Lisias commented 2 years ago

So, it's related somehow to ModuleProceduralFairing, and now I need to check if it's something related to AttachedOnEditor interacting with it, or if it's something wrong with the "Grus" parts on Tantares.

So I made this craft :

screenshot64

Using a Fairing as root. merge test.craft.zip

And it was merged all right:

screenshot62

Variations of the merge test craft worked as well, as long all the parts involved were stock.

screenshot65

So, no. There's no conflict between AttachedOnEditor and ModuleProceduralFairing.

So whatever is happening, is on Tantares for sure.

Lisias commented 2 years ago

~Temporary workaround~: [EDIT: DIDN'T WORKED]

GameData/__LOCAL/KSP-Recall/Tantares.cfg

@PART[grus*]:HAS[@MODULE[ModuleProceduralFairing]]:FINAL
{
    -MODULE[AttachedOnEditor],* { }
    -MODULE[TweakScale],* { }
}
Lisias commented 2 years ago

I bluntly removed every part that was throwing an Exception on KSP.log, no matter how silly was the Exception or where.

I removed AttachedOnEditor and TweakScale from the affected parts (the Grus thingies with ModuleProceduralFairing.

Tailored a simplified version of the test craft. Vega 3 kpado.craft.zip

And got this: screenshot66

Conclusion: The AttachedOnEditor is needed on the affected parts, otherwise we see the parts scattered around as demonstrated by the screenshot. But something broken on some Tantares parts (and there are a lot of broken parts, as it appears) is screwing up with KSP-Recall.

Exactly what I'm unsure if I should purse, because it's not up to me to fix every single broken AddOn on the face of Kerbin.

Lisias commented 6 months ago

I think this may be related to #66 too (crafts appears to be rerooted before being merged).