zer0Kerbal / Komplexity

A Custom Barn Kit config addon that increases Kerbal Space Center building to ten levels instead of the stock game's four. For Kerbal Space Program. Doesn't add more building models.
https://forum.kerbalspaceprogram.com/index.php?/topic/202749-*/
Creative Commons Attribution Share Alike 4.0 International
2 stars 0 forks source link

[Bug 🐞]: Administration building compatibility issue with Strategia #57

Closed chrbkr closed 2 years ago

chrbkr commented 2 years ago

Brief description of your issue

With Strategia (and JNSQ, if that matters) installed, the administration building shows up as "Fully Upgraded" at Level 3, but with only 3 strategies available. When hovering over the (inactive) upgrade button, the info box shows "Max Active Strategies: 4", but I can't click it.

Steps to reproduce

Expected behavior

It should be possible to upgrade to level 4 (and beyond), with an according number of available strategies

Actual behavior

It's impossible to upgrade beyond level 3

Environment

Mod: 1.0.1.0
KSP: 1.12.3

How did you download and install this?

CKAN (auto install with dependencies)

github-actions[bot] commented 2 years ago

Thank you. Kindly read contributiing.md, code_of_conduct.md and styleguide.md. These are boilerplate.

zer0Kerbal commented 2 years ago

First step is to see if Strategia can handle the additional levels. The reason the current admin/mission control configs don't patch those two buildings when Strategia is installed is because of this unknown. Marked compatible because in it's current state it is. will ping @jrossignol on the KSP forums as well.

@jrossignol

zer0Kerbal commented 2 years ago

Strategia CBK patch:

@CUSTOMBARNKIT:FOR[Strategia]
{
    @ADMINISTRATION
    {
        @strategyCommitRange = 1, 1, 1
        @activeStrategyLimit = 2, 3, 4
    }

    @MISSION
    {
        @reputationKerbalRecovery = 2.5
    }
}

Komplexity Administration CBK configs

@CUSTOMBARNKIT:NEEDS[CustomBarnKit,!Strategia]:FOR[Komplexity]
{
    @ADMINISTRATION
    {
        @levels = 10
        @upgradesVisual = 1, 1, 1, 2, 2, 2, 3, 3, 3, 3
        @upgrades = 38000, 10000, 15000, 25000, 50000, 75000, 95000, 115000, 150000, 190000
        @activeStrategyLimit = 1, 2, 3, 3, 4, 4, 5, 6, 7, 8
        @strategyCommitRange = 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0
    }
}

Komplexity Mission CBK configs

@CUSTOMBARNKIT:NEEDS[CustomBarnKit]:FOR[Komplexity]
{
    @MISSION
    {
        @levels = 10
        @upgradesVisual = 1, 1, 1, 2, 2, 2, 3, 3, 3, 3
        // @upgrades = 0, 25000, 50000, 65000, 80000, 95000, 110000, 125000, 150000, 300000
        @upgrades = 19000, 10000, 15000, 20000, 25000, 35000, 45000, 55000, 75000, 100000
        @unlockedFlightPlanning = 5
        @activeContractsLimit = 2, 3, 4, 5, 6, 7, 8, 9, 10, -1
    }
}
zer0Kerbal commented 2 years ago

@chrbkr Here are the patch files (experimental) to try. Kindly tell me if they resolve your issues and if Strategia/KSP has any issue going above 3 contracts - and if that is balanced.

Manual Installation directions are included in the archives.

Komplexity-1.0.3.0-patch.zip Komplexity-1.0.3.0-patch-CF.zip

chrbkr commented 2 years ago

The problem actually got worse.

Max strategies available:

In Komplexity/Config/Administration.cfg, only the version was changed, but there's still the !Strategia modifier - so I'm not surprised the administration building only has 3 levels. But it seems very strange to me that the number is different between right-click and from within the building. It looks like right-click uses the config from Komplexity. I have no idea where 0, 2, 4 comes from, though.

zer0Kerbal commented 2 years ago

@chrbkr you are correct. I had intended to remove the !Strategia - but it was missed.

These should be patching correctly now:

Komplexity-1.0.3.0-patch2-CF.zip Komplexity-1.0.3.0-patch2.zip

If the differences still exist - then the issues must lie with Strategia (@jrossignol)

Again, kindly test (with above listed caveats) and please do what you did - tell me what happened. 🥇

If this doesn't work - then I will ask for your ModuleManager.ConfigCache and KSP.Log and the MMPatch.log

chrbkr commented 2 years ago

The limit issue has been fixed now. The behavior is:

To clarify: by "from inside" I mean the y at "Active Strategies: x [Max: y]"

Apparently, the value from the right click comes from the level. I remember reading something about the wrong number in the Strategia thread. No idea where the right-click value comes from, but the actual limits seem to be those from your patch.

Interestingly, some strategies are unavailable (I guess due to some inner logic of Strategia) and show an incorrect number in the "The Administration Facility cannot support more than x active strategies at this level". I.E. x is 7 for a specific strategy, but I can select a different one without a problem. I guess this is a Strategia bug, though.

zer0Kerbal commented 2 years ago

Excellent and thank you @chrbkr ! will pack and ship, noting the issue is with Strategia and not Komplexity.

🦃

issue here in Strategia: https://github.com/jrossignol/Strategia/issues/66 activeStrategyLimit too low #66 Schnobs opened this issue on Oct 28, 2017

zer0Kerbal commented 2 years ago

Issue seems to be here:

https://github.com/jrossignol/Strategia/blob/e9f398e556d515ae9d3d21b2186a2137cf98633a/source/Strategia/StrategyNotifier.cs#L216-L235

zer0Kerbal commented 2 years ago

@chrbkr would you try something else for me?

I compiled (private compile) Strategia for 1.12.3 and made one small change - attempted to fix this display error.

I will remove these files within twenty-four hours out of respect to @jrossignol.

chrbkr commented 2 years ago

The patch for Strategia fixed the outside, right click info. The internal one is still broken. Thanks for the fix in Komplexity!

zer0Kerbal commented 2 years ago

The patch for Strategia fixed the outside, right click info. The internal one is still broken. Thanks for the fix in Komplexity!

You are most certainly welcome! 🙇 Thank you for the report and the assistance @chrbkr!

chrbkr commented 2 years ago

Just FYI: I just realized that your Strategia patch does not really fix the outside info. Maybe it was working only for lower levels. But. e.g. for Facility Level 6, it shows "Max Active Strategies: 7" from outside, while in reality it's 4, as it should. But I guess any further discussion should be continued over at the Strategia issue.

zer0Kerbal commented 2 years ago

@chrbkr thank you. did you try the recompile of Strategia I posted previously/above (removed)?

@chrbkr would you try something else for me?

I compiled (private compile) Strategia for 1.12.3 and made one small change - attempted to fix this display error.

I will remove these files within twenty-four hours out of respect to @jrossignol.

chrbkr commented 2 years ago

@zer0Kerbal yes, this is what I meant by Strategia patch. The Komplexity patch that closes this bug is fine. I found some other quirks with Strategia when there are multiple levels, I guess Strategia could use some rework in order to improve compatibility with Komplexity. A lot seems to be hardcoded or based on assumptions about facility levels (who could have known someone would ever change the number of levels ;)

zer0Kerbal commented 2 years ago

@chrbkr thank you for the clarification and for the beta test.

yes Strategia needs some ❤️ - I might consider it, however would also need to do contract configurator (which is a massive rebuild) - just not yet.

Agree - and I know the person for the job - just he is busy with his day job and several other code mods at this point.