Jump to content

[1.12.x] Bureaucracy - Monthly Budgets, Reimagined (1.6.1 - 16/03/2023 (Final release))


severedsolo

Recommended Posts

6 hours ago, Pippin said:

Never mind. It happened again, and it had nothing to do with the science rewards from EVARepairs. Here is the log.

 

Can you put the log in a file rather than pasting it as a quote - it messes up the forum for mobile users and makes it easier for me to search for what I'm looking for in my text editor. You can upload the log to DropBox/Google Drive etc and send me the link.

Link to comment
Share on other sites

On 3/17/2023 at 6:38 AM, severedsolo said:

Bureaucracy 1.6.1 Released

  • Fix Allocation Settings not persisting between scene changes

I'm glad you fixed it, but how? Could you please tell something about it? I'm trying to learn coding from this.  But  you didn't update your code in GitHub,  so I guess I'll never know.

Link to comment
Share on other sites

1 hour ago, tinygrox said:

I'm glad you fixed it, but how? Could you please tell something about it? I'm trying to learn coding from this.  But  you didn't update your code in GitHub,  so I guess I'll never know.

I've just pushed the changes to Github.

Basically - because the funding allocations are stored as floats - which isn't very UI friendly, I was storing the UI allocation settings separately in an int then updating the managers. The default allocations in UIController were overriding the settings. It was a bit of a stupid/convoluted way to do it anyway (as allocations were being held in two places) - so I changed it to pull the allocations out of the Managers themselves, but round it instead.

Link to comment
Share on other sites

  • 4 weeks later...
On 3/21/2023 at 7:24 AM, severedsolo said:

Can you put the log in a file rather than pasting it as a quote - it messes up the forum for mobile users and makes it easier for me to search for what I'm looking for in my text editor. You can upload the log to DropBox/Google Drive etc and send me the link.

I'm experiencing something similar to what Pippin describes, and (while I am also pretty heavily modded) I am not using EVARepairs. However, it's less consistent: on some game starts, science seems to be instant immediately, and on other application runs it can take dozens of launches before it happens. My latest log is here.

..

Link to comment
Share on other sites

On 4/19/2023 at 12:06 AM, Darael said:

I'm experiencing something similar to what Pippin describes, and (while I am also pretty heavily modded) I am not using EVARepairs. However, it's less consistent: on some game starts, science seems to be instant immediately, and on other application runs it can take dozens of launches before it happens. My latest log is here.

..

Are you by any chance changing scenes before a full in-game day has passed? Same question @Pippin

(Also side note: Gaming on Noveau drivers and pushing it with Visual mods? You're very brave!)

On 4/22/2023 at 3:33 AM, Siphon said:

Is there a way to stop the mod from using the stock alarm system and switch to KAC instead? 

No, but it might come in future. I prefer KAC myself, so you may find next time I get motivated to play I decide to change it back. No promises obviously.

Edited by severedsolo
Link to comment
Share on other sites

On 4/23/2023 at 3:09 PM, severedsolo said:

(Also side note: Gaming on Noveau drivers and pushing it with Visual mods? You're very brave!)

I was using NVidia binary drivers, but some update broke something to the point where several games, KSP included, would lock my system up entirely shortly after launch, requiring a magic-sysrq reboot to recover. I got sick of trying to fix it and switched to Nouveau instead. Not quite as performant, but better than "locks not just X but the entire computer".

 

On 4/23/2023 at 3:09 PM, severedsolo said:

Are you by any chance changing scenes before a full in-game day has passed?

Frequently, especially early in career when I'm using SoundingRockets to do FieldResearch "science around KSC" contracts for reputation (and, if I wasn't using Bureaucracy, funds). This can easily lead to multiple launches in a day despite my use of KCT since I'm recovering a very small rocket from within KSC, editing it slightly to change the heading it'll launch on, refuelling, and rolling it right back out again — not to mention jumping into Mission Control every so often to grab the next contract.

Link to comment
Share on other sites

7 hours ago, Darael said:

Frequently, especially early in career when I'm using SoundingRockets to do FieldResearch "science around KSC" contracts for reputation (and, if I wasn't using Bureaucracy, funds). This can easily lead to multiple launches in a day despite my use of KCT since I'm recovering a very small rocket from within KSC, editing it slightly to change the heading it'll launch on, refuelling, and rolling it right back out again — not to mention jumping into Mission Control every so often to grab the next contract.

There's your issue. Bureaucracy only fires the budget advancement events every 1 in-game day, and that timer is reset on a scene-change - you don't lose out as it does catch up from the last time the event fired. Technically this is working as intended.

There are probably things I can do to make that a bit friendlier though, like exposing the polling interval in the settings, or catch up on a scene change. (If memory serves there is a reason it's not doing it on the scene change but I don't remember what it is). Raised #28

Link to comment
Share on other sites

  • 1 month later...
On 4/23/2023 at 7:09 AM, severedsolo said:

No, but it might come in future. I prefer KAC myself, so you may find next time I get motivated to play I decide to change it back. No promises obviously.

For the record, it is I, RTB, and not severedsolo who made the PR that switched it to the ingame stock alarm clock.

Yes, there are days I regret it too.  I may see about making it an option or something in yet another PR, if I ever find time...

Edited by R-T-B
Link to comment
Share on other sites

  • 6 months later...

There appears to be a bug that causes new contracts to be generated with fund rewards after save/loading without fully exiting the game application. It can be fixed by fully exiting the game before reloading a save.

 

Steps to produce:

1. Start KSP with Bureaucracy installed

2. Start a new game

3. Test contract generation -- newly generated contracts work properly, replacing any fund rewards with reputation

4. Save game and exit to main menu

5. Reload game (or start a new game) without exiting the KSP application

6. Test contract generation -- any contracts generated before save/load will still have fund rewards replaced with reputation. However, refreshing the contracts list via cancellation, completion, or waiting will generate new contracts which have fund rewards

7. Save game and exit the KSP application entirely

8. Start KSP again and load the save (or start a new game)

10. Test contract generation -- as before, any previously generated contract rewards stay as they were before exiting. Fortunately any new contracts now generated will be working as desired, with reputation in place of funds

 

I have reproduced this behavior with a fully fresh installation of KSP, running only the Bureaucracy mod and its requirements. It also appears when other mods are installed, such as contract configurator and the exploration contract pack, or when installed in my full modpack.

If you're still interested in updating your mod, this would be a good thing to fix -- I thought the mod was irrecoverably broken before I managed to pinpoint the exact behavior. If not, this post can at least serve as a guide for how to avoid this issue for anyone else facing it. Simply exit out of the main menu before reentering your game and everything will work perfectly.

Link to comment
Share on other sites

On 12/28/2023 at 6:19 PM, Verdiss said:

Simply exit out of the main menu before reentering your game and everything will work perfectly.

For me, this solution doesn't work, even by completely exiting the game because the error is logged in the persistence.sfs file, and KSP reloads it each time. My modding knowledge is minimal, but I have the impression that Bureaucracy (through ContractInterceptor.cfg) is required to go through Module Manager to apply its changes to new contracts. As far as I know, this is impossible without completely restarting the game, but I could be mistaken...

The solution that works for me is as follows:

Prerequisites:

- Excuse my poor English.
- MAKE A BACKUP OF THE persistence.sfs file.
- Use an advanced editor, like VSCode, to make life easier (good luck with Notepad...).
- Be careful about what you delete: I'm thinking of contracts from Research Bodies, for example if it's deleted, you'll have to repurchase the research contract.

Procedure:

- Completely exit the game.
- With a text editor, perform a search: state = offered.
- You should see in the SCENARIO section with the name ContractPreloader.
- Delete all CONTRACT entries with their content included between the curly braces { }. Be sure to analyze what you're deleting.
- Save and relaunch the game.

The problem should be resolved.

Edited by Misucat
Link to comment
Share on other sites

1 hour ago, Misucat said:

My modding knowledge is minimal, but I have the impression that Bureaucracy (through ContractInterceptor.cfg) is required to go through Module Manager to apply its changes to new contracts

Actually those contracts (the stock progression contracts) are the only ones that will still probably work.

The very simplified version of what's happening is that Contract Interceptor listens for the game announcing "I just made a new contract", then goes into that contract and manually changes the values. Stock progression contracts aren't "offered" in the traditional sense so we patch them in the game files instead, so they will continue to work whether Contract Interceptor is running or not. The reason we do it this way is so we can handle mod contracts too (we don't care where the contract is from, we just care about it when it gets offered).

What's happening here is that upon returning to the Main Menu something is causing that "I just offered a contract" announcement to be made, and Contract Interceptor is running into a problem. (If I were to take a guess, I'd say its because it's trying to access Bureaucracys settings but as the main mod isn't running right now that causes it to fall over).

Once the Interceptor has fallen over, it stops running (and therefore listening for the new contract announcement) which means why subsequent contracts don't get changed.

As you observed, any contracts created while Contract Interceptor isn't running get saved with the funds still in tact and will be reloaded with your game. Usually we change the values before the game saved and KSP never knows any different because it saves the changed values. There has never been a need to go back and change values retroactively before because we changed them "at source" which is why once it breaks it stays broken.

I will say, all this means "I know what the problem is" not "I'm going to fix it".

It is a relatively simple fix, but I really did mean it when I said "this will be the last release of Bureaucracy" and I'd have to set up my KSP/ mod dev environment again. On the other hand I don't like leaving mods "broken" (even if the workaround is quite easy: "don't switch saves halfway through a play session you psychopaths" (/s if that wasn't obvious)).

Which is a very long winded way of saying "I might fix it, I might not but it would be an easy fix for someone who wanted to fork Bureaucracy, and as I'm no longer actively modding I would not be hostile to forks like I was before".

 

Edited by severedsolo
Link to comment
Share on other sites

Modding remains a hobby, and it should be done when one feels like it or has the time. This is an awesome mod that gives purpose to my career, and I thank you for conceptualizing and implementing it, and for all the work you've put into it.

The issue is workable, so as far as I'm concerned, it's not broken. The system just requires completely exiting the game and not returning from the main menu, so it's not a game-breaking issue. It adds interest, fun, and that's all that matters !

Thank you for taking the time to write this detailed explanation :D

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...