Jump to content

Facility Reset for 64 bit KSP


NoPanShabuShabu

Recommended Posts

64 bit users have long been plagued by the fact that in career mode the facilities show as fully upgraded and can't be upgraded.  This mod addresses that issue by resetting the facilities to appear as the level they are actually supposed to be.

It's been over a year since upgradable facilities were introduced in version 0.90, and with KSP version 1.1 coming soon(tm), this mod is both overdue and soon to be outdated, but here it is anyway.

Download: http://spacedock.info/mod/44/Facility%20Reset%20for%2064bit%20KSP (moved to SpaceDock)

Warning: This mod and Kerbal Construction Time (KCT) do not play nice together, so don't use this if you want to use KCT.

Warning addendum: Actually, you can use this with KCT just fine if you unselect "KSC Upgrade Times" from the Features section of the KCT Settings.

As they say "no pics, no clicks", so here's the mod in action in version 0.90:

 

 

 

Edited by NoPanShabuShabu
Imgur
Link to comment
Share on other sites

On ‎2‎/‎10‎/‎2016 at 8:19 AM, Joshwoo69 said:

Downloaded it when it got on kerbal stuff. Nice stuff though :)

Ps how does it work?

Thanks.  I decided to look into whether a solution to this problem existed for completely selfish reasons.  I had a new 1.0.5 RSS install which never reverted the facilities to normal using the old Tracking Station method, and I did not want to go through the pain of looking up the costs and editing the save file.  So I spent a number of hours looking at what certain things showed as the facility level, and what certain methods did, and finally I had a thing that really worked.  I thought about it for a while and decided to share it because it would be wrong to keep it to myself if it could help even one other player.

One thing that's starting to kind of disturb me though is that this bug is the reason that I (and many others) never used the semi-official 64 Bit version that came with KSP 0.90.  I only tried the 64 Bit hack again when I learned that you could sometimes get the facilities to go back to normal by going in and out of the tracking station.  Well this mod works with 0.90 and I presume every version up through current.  The code that actually does the work is like 3 lines.  Why didn't somebody who actually knows how to mod do this already?  Sorry about the rant, but I could have some dark thoughts (that I don't really believe) about the modder community if I put a tinfoil hat on.

The entire source code is included in the download, but here's an overview of how it works:

It looks like the facilities levels are handled by two parts of the KSP code.  One part seems to handle how it appears, upgrading with right click, etc, and the other seems to handle what it can do, part limit, max weight, etc.  For whatever reasons, when the game goes to draw the Space Center view and looks up what the levels should be, it comes back with the max level for that first part. 

Fortunately, the second part always comes back correctly.  Also fortunately, the code allows for a mod to set the facility level used in that first part.  So what the mod does is run through a list of the facilities, compare what it shows for the first part with the second part, and sets the facility level to be what the second part says.  Voila, it's fixed. 

Well, not quite fixed yet.  There is also a bit of screwing about with unregistering and registering the upgradable facility (I have no idea what this is actually doing) because if I don't do that then when you actually upgrade the facility, it won't ever stick and next time you come to the Space Center scene the facility will be at the old level.  You might still see a similar side effect if you have an install which will more regularly result in the correct levels coming up.  If you have just upgraded a facility, go in and out of a building, the facility might revert to the old level.  It should go back to the correct level permanently if you click the Facility Reset button, or go in and out of a facility.

Link to comment
Share on other sites

On 14/02/2016 at 2:59 PM, fallout2077 said:

The button doesn't seem to work for me. I try clicking it, but the button doesn't highlight and clicking does not perform an action.

Oops... disregard!

From what I have been following the forum, the problem of buildings is directly related to Kopernicus:

 

Link to comment
Share on other sites

22 hours ago, MKellerBR said:

From what I have been following the forum, the problem of buildings is directly related to Kopernicus:

 

Wow, good hunting! I can't live without my OPM though, so this building reset mod is integral in my KSP installs.

 

To add, I've been looking for a way to quit relying on the Linux version of KSP for a while, as using it forces me to run KSP in opengl, which hosts its own set of problems (I have my suspicions that using either Linux or OpenGl is what is causing the clouds to disappear after the 60km mark on Kerbin). So, the Facility Reset button is my excuse to return to Windows and the DirectX rendering mode it natively offers. Thanks again, NoPanShabuShabu, for creating this mod!

Edited by fallout2077
Link to comment
Share on other sites

On ‎2‎/‎14‎/‎2016 at 11:59 AM, fallout2077 said:

The button doesn't seem to work for me. I try clicking it, but the button doesn't highlight and clicking does not perform an action.

Oops... disregard!

Yeah, I don't like the fact that it doesn't highlight either, but I did pretty much just slap together the most rudimentary version of an app launcher button.  I was like "It works. Screw it!"  I may at some time see how to add that.

On ‎2‎/‎15‎/‎2016 at 6:10 PM, fallout2077 said:

Wow, good hunting! I can't live without my OPM though, so this building reset mod is integral in my KSP installs.

 

To add, I've been looking for a way to quit relying on the Linux version of KSP for a while, as using it forces me to run KSP in opengl, which hosts its own set of problems (I have my suspicions that using either Linux or OpenGl is what is causing the clouds to disappear after the 60km mark on Kerbin). So, the Facility Reset button is my excuse to return to Windows and the DirectX rendering mode it natively offers. Thanks again, NoPanShabuShabu, for creating this mod!

I was never very happy with the Linux version, graphics being one of the biggest issues for me.

Link to comment
Share on other sites

Just to let prospective users know: this fix doesn't play nicely with Kerbal Construction Time. Resetting the facilities causes KCT to place facility upgrade orders. I kinda expected this to happen but thought I'd give it a try anyway. Ideally, KCT would have this functionality built-in to handle it correctly, but oh well...

I'm not going to beg you to make this KCT-compatible. This is incredibly useful as is. You've done more than enough for us few deserted 64bit users.

Link to comment
Share on other sites

On Thursday, February 18, 2016 at 7:33 AM, MaxRebo said:

Just to let prospective users know: this fix doesn't play nicely with Kerbal Construction Time. Resetting the facilities causes KCT to place facility upgrade orders. I kinda expected this to happen but thought I'd give it a try anyway. Ideally, KCT would have this functionality built-in to handle it correctly, but oh well...

I'm not going to beg you to make this KCT-compatible. This is incredibly useful as is. You've done more than enough for us few deserted 64bit users.

Heh, I was just about to post regarding this same conflict. Although, to add, in my install not only does KCT place orders, I received up to 2 million credits following the first couple contracts (do science and launch first vessel)! Obviously, such an issue makes playing in Career mode rather pointless. Has anybody else experienced this bug?

Link to comment
Share on other sites

3 hours ago, fallout2077 said:

Heh, I was just about to post regarding this same conflict. Although, to add, in my install not only does KCT place orders, I received up to 2 million credits following the first couple contracts (do science and launch first vessel)! Obviously, such an issue makes playing in Career mode rather pointless. Has anybody else experienced this bug?

Hmm... no, everything else works flawlessly for me (apart from the usual 64bit physics timestep issues under high CPU load). Sounds to me like something messed with your funds gain multiplier. I seriously doubt this mod has anything to do with that though...

Link to comment
Share on other sites

2 minutes ago, MaxRebo said:

Hmm... no, everything else works flawlessly for me (apart from the usual 64bit physics timestep issues under high CPU load). Sounds to me like something messed with your funds gain multiplier. I seriously doubt this mod has anything to do with that though...

Hmm... odd. Perhaps I'll reinstall and try again.

Link to comment
Share on other sites

I actually integrated KCT after I started my current campaign, when the first milestone contracts were already done. After I noticed the unsolicited upgrades, I stopped using Facility Reset. So technically, there was no way for me to experience this problem even if it does in fact exist. So however seemingly unlikely, it might have to do with this mod after all. I don't think it matters much though; you simply can't use Facility Reset and KCT together either way, so...

Link to comment
Share on other sites

On 2/21/2016 at 8:23 PM, eberkain said:

yeah me too, I've used it a couple times and now have 6 million credits

 

 

On 2/21/2016 at 8:26 AM, MaxRebo said:

I actually integrated KCT after I started my current campaign, when the first milestone contracts were already done. After I noticed the unsolicited upgrades, I stopped using Facility Reset. So technically, there was no way for me to experience this problem even if it does in fact exist. So however seemingly unlikely, it might have to do with this mod after all. I don't think it matters much though; you simply can't use Facility Reset and KCT together either way, so...

I suppose I'll try playing with KCT, just to see if I can live to play without it. It's nice to know that the problem isn't just isolated to me, though!

Link to comment
Share on other sites

 

2 minutes ago, fallout2077 said:

 

I suppose I'll try playing with KCT, just to see if I can live to play without it. It's nice to know that the problem isn't just isolated to me, though!

I've decided to just play 64 bit career without Kopernicus for now, and once I get far enough along that all the facilities are upgraded, then I'll add it.   Not an option for someone that doesn't want to play with the stock solar system.   I only plan to add Jool Biomes and Extrasolar Planets, so this seems the best solution. 

Link to comment
Share on other sites

KCT definitely does act weird using this mod.  Like folks are saying KCT adds building upgrades to it's queue, but that seems at first to be superficial; it doesn't seem to actually take any funds or change the levels back.  However, it does seem to allow you to upgrade a facility and have the benefits of that upgrade immediately.  It also seems to refund you the upgrade cost of the fully upgraded facility when you reset, or something like that.  I'm currently watching the funds in my testing game adding up with no end in sight; it's approaching 300 million funds as I type.

 

So, yeah, KCT is definitely not a good match with this mod.

 

Edit: Over 700 million funds and still counting...

Edited by NoPanShabuShabu
Link to comment
Share on other sites

On ‎2‎/‎18‎/‎2016 at 7:33 AM, MaxRebo said:

Just to let prospective users know: this fix doesn't play nicely with Kerbal Construction Time. Resetting the facilities causes KCT to place facility upgrade orders. I kinda expected this to happen but thought I'd give it a try anyway. Ideally, KCT would have this functionality built-in to handle it correctly, but oh well...

I'm not going to beg you to make this KCT-compatible. This is incredibly useful as is. You've done more than enough for us few deserted 64bit users.

I don't think I can make this compatible with KCT as it currently stands.  It looks like KCT is detecting the change and instituting an "upgrade" which is actually a downgrade.  Then it seems to be using the refund mechanic it has for when a user tries to upgrade a building while that building is already being upgraded.  It also seems to go crazy after a bit; my test game is still counting up over a few hundred million funds and I didn't reset the facility that many times.

To be honest, I think the onus falls on KCT to do a sanity check of some kind when it detects facility level changes.  I fully understand they probably wouldn't ever need to under normal circumstances since you can't ever downgrade a facility.

Link to comment
Share on other sites

^ Whoa, good thing I returned to a save before using Facility Reset for the first time... anyway this pretty much makes perfect sense. And with 1.1 around the corner, any effort in getting KCT on board (or putting together and submitting a pull request even) would be wasted IMO. Thanks for investigating nonetheless.

Link to comment
Share on other sites

17 minutes ago, Revenant503 said:

Hey guys, you do know KCT has the option to disable its building management functions?

@Revenant503, "Facility Upgrade Time" or something like that.
Actually "KSCUpgradeTimes" in KCT_Presets\default.cfg.

Edited by KvaNTy
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...