KSP Recall

KSP Recall

345k Downloads

`AttachedOnEditor` is being screwed up when Merging crafts

Lisias opened this issue · 13 comments

commented

Somehow I screwed up something when merging crafts.

[EDIT]: NOPE. It's a new (old) bug on KSP Editor, since 1.4.x

Consider this craft:

Screen Shot 2023-03-19 at 02 44 49

Now, let's merge it with itself :

Screen Shot 2023-03-19 at 02 47 36

And save it with a different name:

Screen Shot 2023-03-19 at 02 48 06

Note the gap between the two subassemblies:

Screen Shot 2023-03-19 at 02 48 06

This misbehaviour is consistent downto KSP 1.4.3 - so it's something on me for sure.

Now things start to get instesting:

On TweakScale 2.4.6.25 (the current mainstream latest), by detaching the lower half of the craft and attaching it again, we still get the gap. By saving the craft and loading it again, this misbehaviour doesn't changes.

Screen Shot 2023-03-19 at 02 54 05

On TweakScale 2.5 beta (latest), detaching and reattaching the thing doesn't solves the problem, but if you save the craft and load it again, by trying the stunt, you get things tight again!

Screen Shot 2023-03-19 at 02 54 24

This confirms that TweakScale is the source of the problem, with KSP-Recall just doing what its being told to do. We fix TweakScale, we have this problem solved.

commented

I'm counting my blesses know. I will push this thing into production and then hire a priest to execute an exorcism on this damned thing.

The priest was fired. We are hiring!

commented

hellboy_aw_crap_by_superkitty27_d7lybil-pre

The behaviour is not consistent. It changes depending of the part!!!

On MK1 cockpits, there's no gap - but clipping inside!!!!

Screen Shot 2023-03-20 at 00 57 43

DAMN!!

The behaviour is consistent with the Mk2, saving and reattaching solving the glitch. But, again, DAMN!!!

commented

IT'S A FSKCING ROUNDING PROBLEM!!!

Screen Shot 2023-03-20 at 03 37 45

When we save the AA vessel (the two A ones merged), the vessel Y size is being set to 10.49992 M.

When I saved AA again as AA2, the Y size is now 10 M, the correct size because now I can deatach and reattach the damned thing into the right place.

On the A file, the Y size is correctly set to 5 M.

commented

Removing TweskScale from the GameData "solves" the issue, so this is really some misbehaviour caused (or induced) by TweakScale.

commented

Interesting:

Screen Shot 2023-03-20 at 04 00 22

When you load the craft file, everything works fine. When you "load for merge", things are completely screwed.

Screen Shot 2023-03-20 at 04 00 22

If TweakScale would be at fault, loading the resized A craft would trigger the problem too.

So it's not something TweakScale is doing wrong. It's something someone (TweakScale or Recall) is not doing right.

Time to mess with AttachedOnEditor to see what I get.

commented

HA!! I found two problems!

The gap on unscaled parts is something on KSP-Recall. But the clipping parts it's something else. Since the original problem is the gap, I'm transferring back this issue to KSP-Recall.

commented

HOLY KRAP. Again.

KSP's Editor behaviour differs when loading a subassembly from loading a craft for merge. This is completely bonkers.

Whoever wrote that code for KSP 1.4.x, he/she/it/whatever didn't programmed a feature. he/she/it/whatever hacked and sliced and butchered the way out of the task. (sigh)

Damn… How I was naive a couple years ago...

commented

The misbehaviour is consistent from KSP 1.4.3 to KSP 1.12.5 :

When using a subassembly, everything works fine.

When merging a craft, that crappy gap happens.

Oukey, this is not a bug on TweskScale neither Recall. Is a new bug from KSP that I only realised today.

commented

It's a BUG on KSP, so it's not my fault.

commented

(almost) fixed on commit 9649697

There's still a gap, however. Still digging.

commented

Oukey, we still have the misbehaviour - it only happens to be smaller now.

Still the same effect, only smaller:

Screen Shot 2023-03-20 at 13 03 56

Screen Shot 2023-03-20 at 13 07 33

commented

Apparently commit 8d58433 fixes this second misbehaviour (smaller gap).

But I'm pretty unsatisfied with this stunt. I think there's a float wounding lurking somewhere in TweakScale - but where it would be it's beyound me right now. This issue was also happening with unscaled parts, and TweakScale just don't do any math on unscaled parts! (or should not)

commented

Additional instrumentation on TweakScale just confirmed what I already now - that TweakScale does not do any math on the part when it is not scaled, so the original misbehaviour is still unexplained at this time.

So I don't really know why it happened at first place.

So I don't know why the changes made for this issue solved the issue.

(deep sigh)

I'm counting my blesses know. I will push this thing into production and then hire a priest to execute an exorcism on this damned thing.