Scaling up Crew Capacity

That's this history: I toyed a bit with scaling up parts with crew capacity. Again. :-) This time on 1.8.1 to see if something had changed.

TL;DR : No, it's no possible to scale up CrewCapacity due some hardcoded limits on KSP - some heavy hacking will be needed.

The Status Quo

Default Behaviour - no scaling up. Default Behaviour - no scaling up.

Previously, I had postulated that probably the UI was borking because it was coded using the Part's prefab CrewCapacity value, instead of the part's CrewCapacity. This was confirmed for 1.7.x and 1.8.x (almost certain for every KSP in the past, but I didn't bored to confirm this - yet).

The New Stunt\^W Hope.

I had confirmed this by trying a stunt: I scaled the prefab's CrewCapacity too (while saving the original value in another place). By doing that, the UI started to behave as I intended - but, of course, mangling with the prefab caused collateral effects. The Part capacity for new parts started to have more crew seats, no matter it was scaled or not - what's expected, after all, I was mangling the prefab!

By mangling the prefab, things kinda works. More or less.. By mangling the prefab, things kinda works. More or less..

You can at least populate the part now. You can at least populate the part now.

But we have this glitch on the Part List now… (due the prefab mangling) But we have this glitch on the Part List now… (due the prefab mangling)

In 1.8.x I run trough a new behaviour, however. Now there's a check on launching the craft to prevent it to be launched with more crew than available seats - on prefab. Previously I could hand code a craft file with the crew capacity expanded and crew allocated, and the craft was being launched all right. But now a Exception is being thrown - of course, the check is looking the prefab CrewCapacity, not the living part's one. Damn. >:-/

[EXC 02:35:05.426] IndexOutOfRangeException: [PartCrewManifest Error]: seat index out of range: i = 4 while mk1-3pod has 3 seats
        PartCrewManifest.AddCrewToSeat (ProtoCrewMember crew, System.Int32 seatIndex) (at <394a98b9c7624adc895c04290da62640>:0)
        KSP.UI.BaseCrewAssignmentDialog.GetManifest (System.Boolean createClone) (at <394a98b9c7624adc895c04290da62640>:0)
        KSP.UI.BaseCrewAssignmentDialog.Refresh () (at <394a98b9c7624adc895c04290da62640>:0)
        KSP.UI.CrewAssignmentDialog.MoveCrewToEmptySeat (KSP.UI.UIList fromlist, KSP.UI.UIList tolist, KSP.UI.UIListItem itemToMove, S
        KSP.UI.BaseCrewAssignmentDialog.ListItemButtonClick (KSP.UI.CrewListItem+ButtonTypes type, KSP.UI.CrewListItem clickItem) (at
        UnityEngine.Events.InvokableCall`2[T1,T2].Invoke (T1 args0, T2 args1) (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
        UnityEngine.Events.UnityEvent`2[T0,T1].Invoke (T0 arg0, T1 arg1) (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
        KSP.UI.CrewListItem.<Awake>b__26_0 () (at <394a98b9c7624adc895c04290da62640>:0)
        UnityEngine.Events.InvokableCall.Invoke () (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
        UnityEngine.Events.UnityEvent.Invoke () (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
        KSP.UI.UIStateButton.<Awake>b__24_0 () (at <394a98b9c7624adc895c04290da62640>:0)
        UnityEngine.Events.InvokableCall.Invoke () (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
        UnityEngine.Events.UnityEvent.Invoke () (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
        UnityEngine.UI.Button.Press () (at <6b3e52a3b1e042958be60434d0f24ce7>:0)
        UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <6b3e52a3b1e042958be60434d0f24c
        UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystem
        UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData event
        UnityEngine.EventSystems.EventSystem:Update()

So, besides being able to hack my way into the UI (even by relying on dirty tricks), apparently on 1.8.x they had shut tighter the door for this feature. I can't edit or launch the craft anymore after forcing my way into scaling up the Crew Capacity - unless I mangle the prefab, with undesirable collateral effects. So the following screenshot will be still a dream for some time yet.

At least we still have our dreams! At least we still have our dreams!

Conclusion (for now)

If you want to give a shot on this, you need to checkout this branch and then define the symbols CREW_SCALE_UP and, if you are feeling adventurous, PREFAB_SCALE_HACK.

DEFINEs Project Options

I think the only way out for this feature will be patching KSP code using Harmony. It's something I prefer not to do dure the potential collateral effects this can incur, but as it looks, will be the only possible way for this.


L., 2019-1110

This article was also published on Forum.