Skip to content

Add support for custom debugging builds.#363

Open
R-T-B wants to merge 12 commits intoKSPModdingLibs:devfrom
R-T-B:master
Open

Add support for custom debugging builds.#363
R-T-B wants to merge 12 commits intoKSPModdingLibs:devfrom
R-T-B:master

Conversation

@R-T-B
Copy link
Copy Markdown

@R-T-B R-T-B commented Apr 12, 2026

This simply adds support for custom dll builds where possible, mostly by using prefixes or fixed transpilers. It uses a basic size heureustic that is pretty reliable to detect custom dlls of Assembly-CSharp.

This is mostly useful for debugging, and is expected to be best effort, not a truly supported thing, but I expect it would be welcomed by some.

@R-T-B R-T-B changed the title 1.40.1_RTBFORK_r2 Add support for custom debugging builds. Apr 12, 2026
@R-T-B
Copy link
Copy Markdown
Author

R-T-B commented Apr 12, 2026

Should be ready now, there were some slight transpiler logic errors on MSVC built dlls but I fixed them.

@R-T-B R-T-B marked this pull request as draft April 13, 2026 02:18
@R-T-B
Copy link
Copy Markdown
Author

R-T-B commented Apr 13, 2026

converting to draft pending more testing.

Copy link
Copy Markdown
Collaborator

@Phantomical Phantomical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will probably have more comments but I need to do my taxes so I'm posting these for now.

@R-T-B
Copy link
Copy Markdown
Author

R-T-B commented Apr 13, 2026

So, I think it's ready now. But welcome any further comments.

The worst part is probably how it uses file size to ID stock dlls, but, well, it certainly won't ever do the wrong codepath on a stock user, and the support for modded dlls is explicitly understood to be best effort, so...

@R-T-B R-T-B marked this pull request as ready for review April 13, 2026 15:42
@R-T-B
Copy link
Copy Markdown
Author

R-T-B commented Apr 13, 2026

That should be it for tweaks, I have made a test build here and will be asking custom deobfuscated dll / debugging build users to play with it and see what happens.

https://github.com/R-T-B/KSPCommunityFixes/releases/tag/1.40.1_RTBFORKr2

Copy link
Copy Markdown
Collaborator

@Phantomical Phantomical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more small comments. I'm also not quite happy with the ModuleIndexingMismatch one, so I'm going to take a shot at rewriting some of it to work appropriately.

return code;
}

static bool DoubleCurve_RecomputeTangents_Prefix(DoubleCurve __instance)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're unconditionally overriding the method this should be PatchType.Override, and the method renamed to suit. It's a bit more efficient and you can then remove the bool return.

}
else
{
AddPatch(PatchType.Prefix, typeof(Funding), "onVesselRecoveryProcessing");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here, should be an override patch.

@Phantomical Phantomical changed the base branch from master to dev April 15, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants