Jump to content

[1.1.2] B.R.O.K.E. - Beta 4 - 05/26/2016 - Now with gameplay!


magico13

Recommended Posts

When that menu icon breeding like a rabbit bug is squashed I am sooo going to utterly and joyfully bankrupt my space program.  Just discovered Ippo's Science Funding which allows one to basically ignore contracts and go at it how you wish.  Now I need a good money sink to balance it out :) 

Link to comment
Share on other sites

  • 2 weeks later...

I have a suggestion in relation to the reputation funding FM.  I think this may be out of it's scope a bit and I'm not sure how to implement this myself.  But reputation always seems to be in abundance if one is careful with their contract choices.  So how about reputation decay over time?  Something small like 1 or 2 points a month perhaps or a percentage (say 5% a month/3 months, that way no chance of a negative value resulting).  Combined with KCT  this could mean noticeable loss if one doesn't perform some "filler missions" between the big ones.  It gives a good reason to not ignore those "launch sat to x" missions just to keep that decay at bay.

The public certainly doesn't enjoy a do-nothing, boring Space Program after all :)  Even if you keep telling the media you are just waiting for that transfer window ("Excuse me Miss Director, but what's a transfer window??" asks local reporter ::headslap::)

Maybe this would be best as just an option for BROKE itself, even if one does not use the Rep funding.

Link to comment
Share on other sites

11 hours ago, autumnalequinox said:

So how about reputation decay over time?

I'm actually planning on changing that FM because I don't like that it basically just gives you infinite free money. Instead of giving you X*rep funds each quarter, it'll give you up to X*rep funds each quarter capped at Y*rep total. That way instead of just being given tons of free money, you're given a budget to work with. You can save up over a few quarters (no more than a year) to try to fund larger missions, though I might even set the cap to be reached in one quarter and require you to take loans for big missions.

With that, reputation just gives you a bigger cap and infinite timewarping doesn't change anything, since if you're at the cap you won't get any more funds. Another option is that I'll probably recommend mods like Punish The Lazy (wow, that mod is way more out of date than I thought, I might have to update it) to be used in conjunction with this and my other mods. We've talked about adding rep decay into BROKE proper, but we think the FMs should handle that sort of thing on their own.

Link to comment
Share on other sites

On 5/26/2016 at 10:50 AM, magico13 said:

I'm actually planning on changing that FM because I don't like that it basically just gives you infinite free money. Instead of giving you X*rep funds each quarter, it'll give you up to X*rep funds each quarter capped at Y*rep total. That way instead of just being given tons of free money, you're given a budget to work with. You can save up over a few quarters (no more than a year) to try to fund larger missions, though I might even set the cap to be reached in one quarter and require you to take loans for big missions.

With that, reputation just gives you a bigger cap and infinite timewarping doesn't change anything, since if you're at the cap you won't get any more funds. Another option is that I'll probably recommend mods like Punish The Lazy (wow, that mod is way more out of date than I thought, I might have to update it) to be used in conjunction with this and my other mods. We've talked about adding rep decay into BROKE proper, but we think the FMs should handle that sort of thing on their own.

Oh ok sweet!  I didn't know the FMs could could do that.  (I've looked over the source but i'm still at a todder's level of understanding of C#)

Never heard of that mod.  And I looked around HARD for something like that.  I'm all for it I'm glad it's in the pipeline.  

And I def like the idea of the hard cap.  I'm crazy about the financial planning side of all of this.  I think it's because I come from a family of government accountants (my grand-uncle ran the finances of the Manhattan project, my grand-father the Dept of the Interior, and a sibling is in Defense department auditing, so yeah.....)

I'm about to buy a house myself so honestly anything that keeps my head in the game so to speak :D I think a poster mentioned a ways back that mods like this can have real world applications (I thank video games for my ability to manage a budget on a small income).

Link to comment
Share on other sites

4 hours ago, autumnalequinox said:

I didn't know the FMs could could do that.

FMs can do anything they want since they have the full KSP API at their disposal. The main restriction for them is that they aren't a full MonoBehaviour and they're instead instantiated by BROKE. There's definitely a way to have both, I haven't done it before but I'm betting you could write a separate MonoBehaviour and an FM and just have the classes interact with each other. Getting the particular FM instance might be slightly problematic but you could likely write a method that returns the instance.

Yeah, I'm pretty sure FMs can do anything they want. For really simple things though, 75% of the work is done by BROKE for you and you don't need to worry about Unity at all. I imagine most FMs will either be self-contained (not super likely though) or will interact just with the KSP API (very likely). I doubt very many will need to use any further parts of Unity past the basic GUI code (and most of the GUI is handled by BROKE already). There's a slight chance that way later down the line I might make it so you can write basic FMs just with config files, but it's not too hard to write one in C# as-is.

 

Edit: Fixed the bug with the button reproducing like mad in Beta 4. I may work on some FMs later tonight. Get it from GitHub.

Edited by magico13
Link to comment
Share on other sites

On 5/26/2016 at 5:26 PM, magico13 said:

Edit: Fixed the bug with the button reproducing like mad in Beta 4. I may work on some FMs later tonight. Get it from GitHub.

::squee::

And that's good info there, thank you.  I have some ideas for an FM I am roadmapping so I'm going to play with a few things in the meanwhile.  Need to learn a few things and play with the mod a bit. :)

Link to comment
Share on other sites

16 hours ago, magico13 said:

Edit: Fixed the bug with the button reproducing like mad in Beta 4. I may work on some FMs later tonight. Get it from GitHub.

I don't think I noticed that before, so I think it's the Beta 4 update that suddenly started to present me with

[LOG 15:37:28.487] 5/27/2016 4:37:29 PM,BROKE,DEBUG: New Day! Year 1, Day 420 - 3h, 23m, 37s
[LOG 15:37:28.487] 5/27/2016 4:37:29 PM,BROKE,DEBUG: New Quarter! Year 1, Day 420 - 3h, 23m, 37s
[LOG 15:37:28.487] 5/27/2016 4:37:29 PM,BROKE,DEBUG: New Year! Year 1, Day 420 - 3h, 23m, 37s

almost daily when timewarping very fast at the KSC, making me swim in more Kerbucks than I could ever spend in a whole full career in a matter of days. Actual billing is supposed to happen quarterly, right? At least that's what happened for me with Beta 3, even though all three messages popped up every time rather than just the appropriate one.

I looked at the commits and I'm aware you didn't make any changes since Beta 3 that could cause something even remotely similar to this behavior, but I swear it never happened before today's update - it's not like timewarping a few days while waiting for the KCT build queue is something I only started doing today. What could be going on here?

Edited by MaxRebo
Link to comment
Share on other sites

36 minutes ago, MaxRebo said:

I don't think I noticed that before, so I think it's the Beta 4 update that suddenly started to present me with

Well that's certainly not correct. I'll try to take a look at it tonight if I find some time.

Link to comment
Share on other sites

4 hours ago, magico13 said:

Well that's certainly not correct. I'll try to take a look at it tonight if I find some time.

Nice! No hurries though. I'm dealing with it for now by scaling down the government and payroll FM parameters to make more sense for a daily billing, and in a way that's kinda nice too.

Link to comment
Share on other sites

Same here.  Although I had funding turned off and payroll on.  It kept spamming and spamming.  By the time I limped into the Space Center I owed 61 million for payroll.  I'm having trouble with dropbox (my internet sucks) cause the log swelled to 16 megs but lemme know if you need it too.

 

Link to comment
Share on other sites

On 5/27/2016 at 2:31 PM, MaxRebo said:

Nice! No hurries though. I'm dealing with it for now by scaling down the government and payroll FM parameters to make more sense for a daily billing, and in a way that's kinda nice too.

 

15 hours ago, autumnalequinox said:

Same here.  Although I had funding turned off and payroll on.  It kept spamming and spamming.  By the time I limped into the Space Center I owed 61 million for payroll.  I'm having trouble with dropbox (my internet sucks) cause the log swelled to 16 megs but lemme know if you need it too.

 

I wasn't getting this issue on my end, but it might have been caused by the FMs being outdated. Either way, I've uploaded a new release that fixes a GUI bug and also includes a new FM that is a replacement for RepuationFunding. It's the one that provides a quarterly budget but has a maximum that it gives out. If your current funds are over the amount given yearly (aka, over the course of 4 quarters) then you won't get any new funds. Thus you can't get infinite funds just by timewarping. I haven't tested it for balance yet, but it's at a point where I can probably start playing with this now.

I also noticed that the current FMs were set to process quarterly and yearly, which meant you'd get twice as much (and owe twice as much) as you should each year, so I disabled their yearly updates. Yearly is just supposed to be used by FMs that only do things on a yearly basis rather than quarterly.

Link to comment
Share on other sites

@magico13 The issue doesn't seem to be resolved (entirely). When I resumed where I left off last friday, at first it seemed like everything was working as expected now. I only got the "New Day!" entry in the log when timewarping to next morning once. Then I timewarped to next morning a second time, and BAM - the faux new quarter + new year entries were there again (day 421 is neither a new quarter nor a new year, right?). In addition, I now also get an exception that kills the BROKE UI and makes it impossible to return to the main menu (loading a save works though and that seems to reset the effects of the exception).

Here's the relevant part of the log:

Spoiler

[LOG 10:31:20.048] Warping to morning. Local time is 0.318683885134273 and desired time is 0.3 so ETA for daylight: 5 hours, 54 minutes, 16 seconds
[LOG 10:31:20.048] Warping to UT:9066812.3. Max Rate Allowed: 10000.0x.
[LOG 10:31:21.687] 5/30/2016 10:31:21 AM,BROKE,DEBUG: New Day! Year 1, Day 420 - 0h, 1m, 36s
[LOG 10:31:23.576] Warping down...  UT: 9061896.9 DecelStart at 9061811.8 Overshoot is 85.1s.
[LOG 10:31:25.278] Real-time resumed. Current UT is: 9066812.2. TgtUT Error is -0.0771s. (Undershot)
[LOG 10:31:27.287] Warping to morning. Local time is 0.302833465603144 and desired time is 0.3 so ETA for daylight: 5 hours, 59 minutes, 58 seconds
[LOG 10:31:27.287] Warping to UT:9088412.3. Max Rate Allowed: 10000.0x.
[LOG 10:31:29.070] 5/30/2016 10:31:29 AM,BROKE,DEBUG: New Day! Year 1, Day 421 - 0h, 2m, 0s
[LOG 10:31:30.957] Warping down...  UT: 9083520.8 DecelStart at 9083411.8 Overshoot is 109.0s.
[LOG 10:31:30.957] 5/30/2016 10:31:30 AM,BROKE,DEBUG: New Day! Year 1, Day 421 - 3h, 11m, 51s
[LOG 10:31:30.957] 5/30/2016 10:31:30 AM,BROKE,DEBUG: New Quarter! Year 1, Day 421 - 3h, 11m, 51s
[LOG 10:31:30.957] 5/30/2016 10:31:30 AM,BROKE,DEBUG: New Year! Year 1, Day 421 - 3h, 11m, 51s
[EXC 10:31:30.957] ArgumentNullException: Argument cannot be null.
Parameter name: collection
	System.Collections.Generic.List`1[BROKE.InvoiceItem].CheckCollection (IEnumerable`1 collection)
	System.Collections.Generic.List`1[BROKE.InvoiceItem].AddRange (IEnumerable`1 collection)
	BROKE.BROKE.NewYear ()
	BROKE.BROKE.FixedUpdate ()
[LOG 10:31:32.567] Real-time resumed. Current UT is: 9088412.3. TgtUT Error is 0.0327s. (Overshot)

 

I disabled the reputation funding and space hotel FMs, and that didn't change anything. Neither did removing them altogether. Happens with just quarterly funding and payroll. Are you sure outdated FMs were the underlying problem?

/update It appears setting payment to full-auto so that the BROKE window never pops up unless opened manually seems to completely get rid of this behavior...

/update2 Finally hit my first New Years (outside of time acceleration no less). Payment on full-auto did not help this time. Getting the above exception plus NRE spam with full GUI lockup, i.e. Alt-F4 being the only way to get things under control again. Relevant part of the log:

Spoiler

[LOG 18:38:54.451] 5/30/2016 6:38:54 PM,BROKE,DEBUG: New Day! Year 2, Day 1 - 0h, 0m, 23s
[LOG 18:38:54.451] 5/30/2016 6:38:54 PM,BROKE,DEBUG: New Quarter! Year 2, Day 1 - 0h, 0m, 23s
[LOG 18:38:54.454] 5/30/2016 6:38:54 PM,BROKE,DEBUG: New Year! Year 2, Day 1 - 0h, 0m, 23s
[EXC 18:38:54.455] ArgumentNullException: Argument cannot be null.
Parameter name: collection
	System.Collections.Generic.List`1[BROKE.InvoiceItem].CheckCollection (IEnumerable`1 collection)
	System.Collections.Generic.List`1[BROKE.InvoiceItem].AddRange (IEnumerable`1 collection)
	BROKE.BROKE.NewYear ()
	BROKE.BROKE.FixedUpdate ()
[LOG 18:38:54.484] 5/30/2016 6:38:54 PM,BROKE,DEBUG: New Day! Year 2, Day 1 - 0h, 1m, 10s
[EXC 18:38:54.485] NullReferenceException: Object reference not set to an instance of an object
	BROKE.BROKE.<FixedUpdate>b__8 (BROKE.InvoiceItem item)
	System.Collections.Generic.List`1[BROKE.InvoiceItem].ForEach (System.Action`1 action)
	BROKE.BROKE.FixedUpdate ()
[LOG 18:38:54.486] 5/30/2016 6:38:54 PM,BROKE,DEBUG: New Day! Year 2, Day 1 - 0h, 2m, 2s
[EXC 18:38:54.486] NullReferenceException: Object reference not set to an instance of an object
	BROKE.BROKE.<FixedUpdate>b__8 (BROKE.InvoiceItem item)
	System.Collections.Generic.List`1[BROKE.InvoiceItem].ForEach (System.Action`1 action)
	BROKE.BROKE.FixedUpdate ()
[LOG 18:38:54.518] 5/30/2016 6:38:54 PM,BROKE,DEBUG: New Day! Year 2, Day 1 - 0h, 2m, 57s
[EXC 18:38:54.518] NullReferenceException: Object reference not set to an instance of an object
	BROKE.BROKE.<FixedUpdate>b__8 (BROKE.InvoiceItem item)
	System.Collections.Generic.List`1[BROKE.InvoiceItem].ForEach (System.Action`1 action)
	BROKE.BROKE.FixedUpdate ()

^ Repeat ad nauseam ^

 

/update3 I narrowed it down to the ArgumentNullException being caused by Payroll, and the NREs by Quarterly Funding. Disabling those makes New Years go smoothly. But with no moneyz being passed around :(

Edited by MaxRebo
Link to comment
Share on other sites

Hmm. Thanks for all the detective work. I have some ideas and I'll try to take a look at them tonight. At the very least I should be able to take care of the NREs without much trouble. Hopefully that's all that is causing the excessive new quarters/years (I haven't seen that myself unfortunately, so fixing it is difficult without reproducing it). I'm moving next weekend so this week is being spent packing, but I might find some time tonight after I pack up this room.

Link to comment
Share on other sites

On 5/30/2016 at 6:21 PM, magico13 said:

Hmm. Thanks for all the detective work. I have some ideas and I'll try to take a look at them tonight. At the very least I should be able to take care of the NREs without much trouble. Hopefully that's all that is causing the excessive new quarters/years (I haven't seen that myself unfortunately, so fixing it is difficult without reproducing it). I'm moving next weekend so this week is being spent packing, but I might find some time tonight after I pack up this room.

Same problem here.  Take your time.  Moving is tough stuff:  have to do it myself in a few months (yay!).

Link to comment
Share on other sites

Yeah, take your time. We're well aware this is still more or less WIP, and I went back to "daily" funding with beta 4 for now, so there is really no pressing need from my side. Not that there could be one that would out-prioritize real life anyway. RL 1st always!

Link to comment
Share on other sites

  • 2 weeks later...
On 31.5.2016 at 0:21 AM, magico13 said:

Hmm. Thanks for all the detective work. I have some ideas and I'll try to take a look at them tonight. At the very least I should be able to take care of the NREs without much trouble. Hopefully that's all that is causing the excessive new quarters/years (I haven't seen that myself unfortunately, so fixing it is difficult without reproducing it)

Just a small heads-up, in case you didn't find the time working on this yet and/or didn't find out yourself by now:

The problem only manifests if you use the "Warp to Next Morning" button. Specifically, the faux quarters/years appear when KSP starts slowing down the time warp from >=1000x. If the next morning is close enough that only 100x warp or less is being applied, then nothing bad happens. Other means of timewarping (KAC, KCT, manual) don't cause this no matter at what factor they're being applied.

Avoiding "Warp to Next Morning" like the plague, Beta 5 works absolutely flawlessly.

Edited by MaxRebo
Link to comment
Share on other sites

On 6/14/2016 at 7:17 AM, MaxRebo said:

Just a small heads-up, in case you didn't find the time working on this yet and/or didn't find out yourself by now:

The problem only manifests if you use the "Warp to Next Morning" button. Specifically, the faux quarters/years appear when KSP starts slowing down the time warp from >=1000x. If the next morning is close enough that only 100x warp or less is being applied, then nothing bad happens. Other means of timewarping (KAC, KCT, manual) don't cause this no matter at what factor they're being applied.

Avoiding "Warp to Next Morning" like the plague, Beta 5 works absolutely flawlessly.

Oh!  Good find.  I hate launching in the dark and that's totally what happened to me.  I just didn't make the connection.  I'm going to have to load up BROKE again and just manually warp instead (besides, I love launching in the early morning anyways with that beautiful Scatterer/EVE-enhanced sunrise in the background).

Link to comment
Share on other sites

I've been thinking of some simple-ish FMs that could help flesh out BROKE.  I know it's intended for the mod to eventually involve costs per active flight based on the type to keep contact/control with them so obvs I don't want to mess with that.  I'd like to make some of these myself but may need some help/guidance.

1.  (+KCT):  Cost for every spacecraft kept in storage (already built and awaiting rollout).  Essentially a maintenance fee.  Not sure if KCT keeps track of the build points of each vessel but if it does I could see it being a cost per BP x the number of days stored.

2.  Research cost.  Active mobile research labs cost money to run.  A check to see if a research lab is generating science (if that's possible) or simply exists and a flat charge for that.  This will help mitigate the OP of mobile research labs.  You won't technically be "buying" science since you still have to staff the lab, run experiments, etc.  But it will be painful to just endlessly spam science (since this could suck away $).

             2b:  Cost for science!  As sort of the anti-ScienceFunding (an Ippo mod) you may have to pay for every point of science you use to do research.  This represents the payroll for your aerospace engineers.  

3.  Building maintenance fees:  Flat cost per level of buildings to represent upkeep.  This could be one of the largest costs that can eat up the budget quick since administration tends to be a very large expense for government/private organizations.  This is a good check on time warping since simply maintaining the KSC will be expensive.  The simplest way to do this would be a % of the original building cost per year (say 3-10% or whatever player wants).  This is the first one I want to do since it "seems" easy.

4.  Private Space Corp Stock Market:  An option to turn a private space corporation into a publicly traded company.  Some kind of RNG determines the state of the stock market and generates or takes income each quarter.  Reputation could modify this so as long as rep is decent it is unlikely to wipe out your budget.  Has potential for big $ but also a chance for big loss.  Essentially you gamble with your budget.  This could be taken further with the option to buy your own "stocks" to reduce the unpredictability in exchange for losing the chance for big $ (I know this is not how these things work IRL).

Link to comment
Share on other sites

On 19.6.2016 at 1:44 AM, theonegalen said:

Oh, just so you know, using KCT's "Warp to Complete" also triggers the "erryday payday" bug.

Strange, I've been trying this many, many times just to be sure it doesn't before I post, and to date it hasn't done that even once for me... well what do you know, just now it did. Is this dependent on the moon phase or something? :ph34r:

On 19.6.2016 at 0:30 AM, autumnalequinox said:

I've been thinking of some simple-ish FMs that could help flesh out BROKE

I'm liking those a lot. If I wasn't so short on time that I'd rather spend it playing KSP than developing for it, I'd definitely try and come up with a barebones implementation for the science and maintenance FMs. Selfish of me, I know :( especially since Magico is probably at least as busy if not more...

Edited by MaxRebo
Link to comment
Share on other sites

6 hours ago, MaxRebo said:

Strange, I've been trying this many, many times just to be sure it doesn't before I post, and to date it hasn't done that even once for me... well what do you know, just now it did. Is this dependent on the moon phase or something? :ph34r:

I tried my really hard to make this happen myself and couldn't get it to trigger.  But it obvs did for you randomly.  I mostly just use the "vessel warp to complete" in the build window.  Did you hit a different button?  Like for research or building upgrade?  It would be crazy if it has something to do with the timing of when clock hits (say it happens to run exactly the length of time of a pay period or some such).  I have KAC running as well with KAC alarms for KCT turned off.  Still can't get this bug to show.

6 hours ago, MaxRebo said:

I'm liking those a lot. If I wasn't so short on time that I'd rather spend it playing KSP than developing for it, I'd definitely try and come up with a barebones implementation for the science and maintenance FMs. Selfish of me, I know :( especially since Magico is probably at least as busy if not more...

Thanks!  I've been running into the same problem myself.  I scrape together free time and then just end up playing or at most writing MM configs to harmonize everything in my game but haven't gotten much more then a basic outline of the FMs.  I want to help take some of the workload for stuff I enjoy.  I think this is the curse of this game :)

Edited by autumnalequinox
Clarification
Link to comment
Share on other sites

On 21.6.2016 at 2:58 PM, autumnalequinox said:

I tried my really hard to make this happen myself and couldn't get it to trigger.  But it obvs did for you randomly.  I mostly just use the "vessel warp to complete" in the build window.  Did you hit a different button?  Like for research or building upgrade?  It would be crazy if it has something to do with the timing of when clock hits (say it happens to run exactly the length of time of a pay period or some such).  I have KAC running as well with KAC alarms for KCT turned off.  Still can't get this bug to show.

I realized a little later that this actually happened on an install that had Beta 4 running, which I was about to migrate a save from. It might well be that part of this bug has been fixed with the Beta 5 FMs through whatever strange side effect. As far as I can tell, it did not happen even once with my Beta 5 setup, and just now I "failed" repeatedly trying to cause it using KCT time warp. So, no need to question your sanity over this anymore :D

Edited by MaxRebo
derp
Link to comment
Share on other sites

49 minutes ago, MaxRebo said:

I realized a little later that this actually happened on an install that had Beta 4 running, which I was about to migrate a save from. It might well be that part of this bug has been fixed with the Beta 5 FMs through whatever strange side effect. As far as I can tell, it did not happen even once with my Beta 5 setup, and just now I "failed" repeatedly trying to cause it using KCT time warp. So, no need to question your sanity over this anymore :D

Oh ok phew.  I actually remembered you posting about running Beta 4 before and thought about that.  I was worried it was going to attack me randomly and was being very careful not to hit the KCT warp to complete buttons.  

Also:  It's been a bit quiet around here and now with 1.1.3 dropping all kinds of craziness is bound to come down the pipe.  Buuut I'm not sure how BROKE is going to do active flight costs but I have a suggestion.  Have a separate window/GUI within the BROKE section that lists all active uncrewed flights.  I've seen this done in Orbital Decay.  Then have it calc the flight cost per quarter (could be as easy as a base cost with distance from Kerbin factored in).  Then have an estimated cost per quarter and allow the player to dedicate funds to each active flight.  This would allow us to overpay for a flight if desired (but of course no REFUNDS).  If it depletes the amount we dedicated to the flight, it could simply disable it (similar to how Antenna Range does).  Until we fund the flight again (plus penalties!) it would be uncontrollable.

A good example of this process IRL:  https://en.wikipedia.org/wiki/International_Cometary_Explorer :)

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