Skip to content
This repository has been archived by the owner on Oct 26, 2020. It is now read-only.

Issues with extra building levels #156

Closed
NathanKell opened this issue Jun 27, 2017 · 17 comments
Closed

Issues with extra building levels #156

NathanKell opened this issue Jun 27, 2017 · 17 comments

Comments

@NathanKell
Copy link
Contributor

NathanKell commented Jun 27, 2017

For the save-destroying update of RP-0 we've added way more building levels via CBK.

However, we've encountered two very serious issues.

  • As seen here upgrading the R&D complex from tier 4 to tier 5 leads to a spam of money being added to the player's funds, basically toasting the save. This also occurs upgrading the pad from level 4 to level 5, and probably any building.
  • Pad limits are quite messed up, it seems there may be an offset in play. I can roll out a 300t LV to a 60t pad, but not a 450t one to the same pad (but I can roll that out to the 320t pad). Note that the same process holds in the VAB: you only get the "Warning, this can't be rolled out" if it's over the (false) limit of the current pad. I would suggest, regardless of the bug, also targeting that warning to only fire if the thing in the VAB/SPH exceeds the max pad/runway limit, not the current one.

Does KCT make assumptions about the number of tiers anywhere? How does it query limits? If it made assumptions I'd think only the first three mass limits would work and you couldn't upgrade buildings/the pad past that limit, but nope, upgrades....except it does look like there is a cap, it's just 4 rather than 3? Confusing.

Anyway, while the second issue is fairly serious, it's work-around-able by the honor system. It's the first issue that's the real show-stopper

@NathanKell
Copy link
Contributor Author

NathanKell commented Jun 27, 2017

Edited to remark that maybe there is a cap after all, just at 4 rather than 3, and that's causing the bug. Although levels above 4 work totally fine in stock (even with KCT installed but disabled) so that's why j'accuse.

@magico13
Copy link
Owner

Hmm, I just made changes so that KCT didn't have assumptions about level caps and would work with custom barn kit correctly. Only the Presets should have any assumptions about levels. I may not get a chance to look through those logs for a little while, I've been rather busy lately with work.

I really hate how KCT retroactively handles KSC upgrades. It might be time for me to try forcibly overwriting the stock upgrade buttons again. Last time I came to the conclusion I'd have to rewrite the whole right-click UI but I really just need to not have the upgrade events fire.

@NathanKell
Copy link
Contributor Author

If you just made 'em, we don't have 'em--we're on 1.2.2 and KCT 1.3.5.1. Might it be possible (pretty please! :) ) for you to backport those changes to 1.2.2?

@NathanKell
Copy link
Contributor Author

As for overriding the buttons--I can't remember if I made them nice and friendly public delegates, but if not JPL might.

@magico13
Copy link
Owner

The 1.2.2 build is mostly up to date with the 1.3 one and I made those changes back in 1.2.2 originally. I'll have to do some playing around, maybe tomorrow. I'll let you know what I find and if I'm able to fix any of this.

@NathanKell
Copy link
Contributor Author

Thanks much! Looking at the log, looks like the upgrade to 5 actually takes the Pad down to 3 (!) and then it tries to go to 4 again but it's already at 4.

It should be trivial to repro: Install CBK, add another two tiers of pad, and upgrade in game. I don't think it will need anything beyond that. But if you want you can just use our MM patch to CBK here since it won't depend on anything but MM itself.

@magico13
Copy link
Owner

I've seen that sort of looping before in that same manner. It may be caching the wrong max level somehow, in which case it might be an easy fix. I'll test it out tomorrow and will keep you informed. That could explain why the pad restrictions are off as well. I don't know why they decided to use a float for the current level...

@Bornholio
Copy link

I'll make a clean 1.2.2 in the morning and duplicate using NathanKell's suggestion. Poke me for any testing.

@magico13
Copy link
Owner

Definitely hit it going from Tier 5 to 6 with R&D (visual, 4 to 5 when 0 indexed). I'll report back when I've got more, but figured I'd at least let you know I can definitely reproduce it.

@magico13
Copy link
Owner

Floats. Floats are the reason. Specifically casting a float times an int to an int, resulting in it going 4.99999 to 4 instead of to 5. I'm rounding now, which I should have done before. Easy to backport to 1.2.2 but I need to look into the launchpad thing as well. Might be fixed with this change too.

@NathanKell
Copy link
Contributor Author

That is awesome! Thank you! :)

@magico13
Copy link
Owner

Alright, I think I've got both things fixed. Rounding the level calculation means it shouldn't think it's level 4 when it's actually 5, and the editor checks were assuming 2 levels and aren't anymore. I also changed them so in the VAB you only get the warning if the vessel is bigger than your highest pad allows, but at rollout it compares against the current pad.

I've already uploaded the 1.2.2 version to SpaceDock. I also set up automated builds for 1.2.2 backports here. If you get a chance to test and aren't seeing it anymore then please close this. Thanks!

@NathanKell
Copy link
Contributor Author

Wonderful! We're all trying it now!

@Bornholio
Copy link

Thanks!

@NathanKell
Copy link
Contributor Author

Fixed for me!

@Bornholio
Copy link

Bornholio commented Jun 28, 2017

Looks great, worked with up to level 7 Pad and level 7 R&D center without problems that I can detect.
KSC switcher, properly limited other sites to local pad level.

@NathanKell
Copy link
Contributor Author

Closing with many thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants