Jump to content

[0.90] EvilCorp Kerbanomics v0.1.8 - Kerbal Payroll and Loans!


johnqevil

Recommended Posts

EvilCorp Presents Kerbanomics: Kerbal Payroll and Loans

Pay your Kerbals a fair wage, based on their years of experience!

Get periodic funding for not murdering your employees!

Running out of money? Need a boost for that next mission? Take out a payday loan and shoot for the stars*!

*Variable APR, starting at a low, low 1500% or one kneecap per year.

Thanks to ObsessedWithKSP ​for the new app launcher icon! And thanks to DivisionByZero for the fantastic APR code!

Please be aware that this plugin is going through a MAJOR rewrite for 0.2.0, and I am addressing some rather impressive bugs with this rewrite.

Please submit all bug reports either here or at the GitHub repo.

Current version: 0.1.8

Screenshot:

2xIogDi.png

DOWNLOAD: https://github.com/johnqevil/Kerbanomics/releases

MIRROR: https://kerbalstuff.com/mod/427/Kerbanomics

Also available on ckan.

SOURCE: https://github.com/johnqevil/Kerbanomics

License: http://www.gnu.org/licenses/gpl.txt

Changelog:

0.1.8
-Fixed bug where changing the scene caused another period to increment.
-Fixed bug where the loaned amount and payment were zeroing out at the
end of a period.

0.1.7

-Corrected additional bug in custom intervals. They will now save immediately when you hit "Save" in the Settings menu.
-Merged APR code from DivisionByZero's branch.

0.1.6

-Resolved issue with custom interval data not saving/loading

0.1.5

-Persistent data now saves at the same time the system is saved. This was to resolve an issue where the game froze or crashed shortly after financials were processed but before the game saved.
-Custom intervals! you may now specify your own period in Kerbin days from 1-9999. All values are calculated accordingly.
-Autopay is now working! You can specify the percentage of how much of your available Funds can be paid out automatically.
-Loans are now NOT paid automatically. They are also not figured into the Autopay system, they must be paid manually. This is to make way for upcoming changes in 0.2.0.


0.1.4

-Fixed error with reading Kerbal status
-Added back standby pay when Kerbals are not on mission (we dug up some dirt on the Brothers, they backed down during negotiations)
-Fixed floating point notation problem with large numbers in persistent
data

0.1.3 - Subprime Loan Edition

You may now take out as many loans as your little heart desires! The Kerbals were also threatening to let Jeb try to attach boosters to the VAB if we didn't give them full salary and benefits year round, so now Kerbals are paid their full salary regardless of mission status.

-Added yearly interval back to settings menu
-Removed "Standby" pay due to a bug in the engine preventing Kerbal status from updating correctly
-Removed the "Loan Deny" menu, added logic to compound multiple loans
-Added option to make a payment to the loan balance outside of the payment interval
0.1.2 Bugfix

-Fixed GUI issue with Settings menu
-Changed out icon for one provided by ObsessedWithKSP
v0.1.1 Bugfix
-Corrected issue with wage processing
-Corrected issue with additional funds being set to 0
-Removed "yearly" option as the interval is not triggering properly. Will re-add this when I get the calculation sorted out.

v0.1.0 RELEASE
-Added loans with interest and repayment plans
-Added configurable settings
-Added persistence. Settings and loan data will save to your save folder, so other saves are untouched
-Added option to bill yearly or quarterly
-Added option to disable funds processing

v0.0.3
-Fixed toolbar icon, added additional logging.

v0.0.2:
-Fixed bug where the additional funds were being processed as part of the loop handling staff wages, so way more funds were being added than expected.

v0.0.1:
-All finances are calculated every quarter, or 106.5 days.
-Kerbals are paid based on their level and status at the time of pay.
-When finances are calculated, funding is added to the available funds based on reputation. The max additional funding is 1,000,000; the minimum is 10000.

Known Issues:


Right now, nothing. Let me know if you find something!

Edited by johnqevil
Update
Link to comment
Share on other sites

Given it a test. Loans work nicely, as does the menu. Only allows one loan at a time, though: I assume the ability to have multiple loans at the same time will come later?

The salaries aren't paying correctly, however: paying 0 for all Kerbals.

Link to comment
Share on other sites

Given it a test. Loans work nicely, as does the menu. Only allows one loan at a time, though: I assume the ability to have multiple loans at the same time will come later?

The salaries aren't paying correctly, however: paying 0 for all Kerbals.

Single loans were implemented as it would be possible to simply stack them before the funding period to never have to pay the loan back. I don't know if multiple loans will get added later, that would depend on whether or not I can come up with a good method for preventing this from getting too cheaty.

I'll look into the salary issue as soon as I get a chance, that was working on my last test before uploading the release.

Link to comment
Share on other sites

Can the mod "see" the status of the various buildings? If so, why not tie the number of current loans you're allowed to have to the level of the admin facility? Level one = 1 loan. Level 2 = 3 loans, and so on. If the building gets destroyed, you're still stuck paying off your existing loans, but can't get any new ones.

I would take out the option to make additional loan payments: make loans a fixed thing with fixed repayment schedules. That way, you have to plan around them, and taking one out is not an easy decision.

Link to comment
Share on other sites

Can the mod "see" the status of the various buildings? If so, why not tie the number of current loans you're allowed to have to the level of the admin facility? Level one = 1 loan. Level 2 = 3 loans, and so on. If the building gets destroyed, you're still stuck paying off your existing loans, but can't get any new ones.

I would take out the option to make additional loan payments: make loans a fixed thing with fixed repayment schedules. That way, you have to plan around them, and taking one out is not an easy decision.

The plan, ultimately, is to have a compound interest accrued on the loans. So the longer the loan takes to repay, the more funds it takes to pay it off. The current iteration is a flat overall interest applied at the start of it.

Being able to take out more than one loan at once would enable this scenario: Take out a loan. Take out a MUCH larger loan. Pay off the original loan with the new one.

I'll actually be implementing a loan cap based on Reputation, kind of like a credit score, so you can't just start off the game with a $50 million dollar loan and take the next 30 years paying it off.

EDIT: I see that bug now. Working on it.

Edited by johnqevil
Link to comment
Share on other sites

Thing is, you can do that kind of thing with loans in real life...so it is a viable tactic, but one that will come back to bite you in the long run. Maybe have it so that taking out any loan incurs a reputation penalty (which makes sense: makes you look like you're financially suffering). And the bigger the loan, the bigger the hit. So you could use that tactic...but it'll come with a cost. And, of course, if you're dinging your reputation every time you take out a bigger and bigger loan, you'll soon not have enough reputation left to take out any more loans. It'd be a natural cap to that kind of tactic.

Link to comment
Share on other sites

I'd love to play with a payroll mod like this, but I also like playing with Kerbal Construction Time. Playing with both of those, in addition to upgrading the space center, might be an exercise in masochism, though. In .25 it could take weeks or months to build a rocket. When KCT is updated for .90 I'll give it a shot, though, because it's still cool.

Link to comment
Share on other sites

Thing is, you can do that kind of thing with loans in real life...so it is a viable tactic, but one that will come back to bite you in the long run. Maybe have it so that taking out any loan incurs a reputation penalty (which makes sense: makes you look like you're financially suffering). And the bigger the loan, the bigger the hit. So you could use that tactic...but it'll come with a cost. And, of course, if you're dinging your reputation every time you take out a bigger and bigger loan, you'll soon not have enough reputation left to take out any more loans. It'd be a natural cap to that kind of tactic.

That's not quite right. Borrowing against an appreciating asset is perfectly reasonable (house, education, etc.) but borrowing against a depreciating asset (car, etc.) is a terrible idea. Since KSC facilities allow you to run larger and longer missions that pay better, the facilities are potentially an appreciating asset (assuming you use them properly).

The reputation hit would come from failure to repay the loan, not that the loan is taken out in the first place. In fact, the only real way to increase your credit rating is to borrow and repay responsibly.

The interesting game dynamic in KSC is that you quite quickly move from missions that take no more than a few days to ones that take a year or more. Borrowing to get to Mun or Minmus is almost a no-brainer, but borrowing to get to Duna will likely bankrupt you fairly quickly if you use the warp button because the mission is going to take a year to complete (though it does provide a new incentive to transmit science data back home rather than wait months to deliver it.) OTOH, if you borrow to initiate your Duna mission, you may need to use the time in transit to run shorter-duration missions to keep cash-flow going until that one pays off.

Put short, the warp button demonstrates how unrealistic the in-game payment system is. Nobody would take a contract for 100K that takes a year to execute when you can take one for 50K that takes a day to execute. But the contract system alleviates the need for most borrowing after the first few days as the contract advances can fill that gap if you're careful about what you take. Before I took my first Mun mission I grabbed two contracts that paid 600K+ and gave 100K+ advances. That allowed me to upgrade launchpad and unlock parts to initiate the missions, and then enough payoff on completion to upgrade tracking station, astronaut complex, and some other buildings to make the Mun mission pretty easy (unlock EVA, etc.)

The problem you need to consider is the late game impact of payroll. How much cash will you need to have to launch a Jool mission and make payroll, or will you never be able to warp because you need to keep running other missions (and will there be enough short-term missions to do that?). Not sure how the contract system works late game.

But for that scenario, you might want to look at Kerbal Alarm Clock to to stop warp when you're about to run out of money or some such. Slipping and hitting 10k warp instead of 100k could be a game-ending error.

Link to comment
Share on other sites

Johnsonwax, as you say: you'd need to run shorter missions whilst waiting for the long ones to complete, which is my hope for this mod. It means that long missions ARE long, in gameplay terms...rather than just exactly the same as short missions, but with more fast forwarding. You wouldn't be able to just fast-forward and get the instant science payoff. You'd have to wait for it, as rightly you should.

Balancing things so that you're never crippled will be important. Johnqevil's already included a menu that lets you set the wage levels, so that's good.

Link to comment
Share on other sites

I love the ideas behind this mod!

I just sent you a pull request with some updated calculations for compound interest calculations. Unfortunately, my c-sharp IDE is on the fritz just now and I can't check it myself. Use with caution - but you can check out the math, though I'm almost positive c# doesn't like my notation for taking powers (^)... Sorry - will try to fix my stuff Monday.

Link to comment
Share on other sites

Given it another test. New button looks lovely! The wages are working again. It still doesn't correctly recognise their mission status: if I send Jeb on one mission and then recover him, the next wage alert will have paid him double for the entire period and will show him as "on mission" when he isn't.

Link to comment
Share on other sites

Given it another test. New button looks lovely! The wages are working again. It still doesn't correctly recognise their mission status: if I send Jeb on one mission and then recover him, the next wage alert will have paid him double for the entire period and will show him as "on mission" when he isn't.

Grab a screenshot of that and post it here.

Link to comment
Share on other sites

I got the Jeb's on a mission when he isn't, and double pay bug as well.

http://i.imgur.com/1dl4BOL.jpg

And a link to my output log too:

https://www.dropbox.com/s/tuonoxr1abkw55u/output_log.txt?dl=0

Excellent, I'll dig in further. Thank you!

I just sent you a pull request with some updated calculations for compound interest calculations. Unfortunately, my c-sharp IDE is on the fritz just now and I can't check it myself. Use with caution - but you can check out the math, though I'm almost positive c# doesn't like my notation for taking powers (^)... Sorry - will try to fix my stuff Monday.

Was a bit disconnected this weekend. I've approved this pull now, and I'm going to be doing a rewrite this week to clean up the code and and a few things people have asked about. Since multiple loans seems to be a popular idea, I'll let you guys borrow yourselves into oblivion :D

Along with a few other things....

Link to comment
Share on other sites

It'd be better if the borrower needed to provide collateral to borrow against. I'd recommend putting upgraded buildings up for collateral. That is, if the players falls too far behind then the loan gets recalled and the chosen building gets demoted 1 level. I'd recommend reputation hits as well.

Link to comment
Share on other sites

Hey Johnqevil, could you check that the master repo on github is, in fact, the 0.1.2 that's supposed to have fixed the payroll issue? I'm pretty new to github, but I may have forked the wrong thing as all of my builds don't seem to calculate the correct "available" payrates and seem to clear loans without making any payments. Thanks.

Link to comment
Share on other sites

Hey Johnqevil, could you check that the master repo on github is, in fact, the 0.1.2 that's supposed to have fixed the payroll issue? I'm pretty new to github, but I may have forked the wrong thing as all of my builds don't seem to calculate the correct "available" payrates and seem to clear loans without making any payments. Thanks.

Just uploaded 0.1.3, point of fact. Changelog is on Github already, I'm uploading binaries now. I corrected a bunch of calculations and cleaned it up some.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...