News: Portal
Our Simutrans site. You can find everything about Simutrans from here.

Credit & Solvency limits

Started by AP, February 01, 2014, 12:16:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Can anyone explain how the credit limit and solvency limit is calculated please
In the current online game, my company is making a regular monthly profit (granted not every month, due to shipping arrival schedules) and has a reliably positive and growing bank balance. And a credit /solvency limits of around -£150k/-£280k respectively

Another company, losing money every month (although hopefully that will be turned around) and with a negative bank balance, has limits of -£1,300k / -£3,100k.

Why is one 3 orders of magnitude larger than the other?


I'd be curious to know how it is calculated as well.  I know it's based on asset value and recent profitability, but I'm not sure how far back profits are included and how that factors in.  You may be referring to my company (Pacific Transport), which I have borrowed over 100k against my credit limit to fuel expansive growth with the expectation of a 3-6 month payback period.  I'd go further in to my credit line if I knew how the calculations were performed but I was afraid of a drastic recalculation raising my credit limit suddenly and making me bankrupt.

EDIT: It must be taking a trailing 6-12 months earnings or more because the credit limit calculation/curve is quite smooth and doesn't waver too much from month to month.  As long as you have a good amount of assets built up and are fairly profitable over the last half year to year, your borrowing capacity seems quite solid.  This means that I could probably go 500-1,000k or more in to debt to finance growth and be just fine over the long run.
Current projects: Pak128 Trees, blender graphics


The credit limit calculation function was written by Neroden, and, for reference, I reproduce the code below:

void finance_t::calc_credit_limits() {
sint64 hard_limit_by_profits = credit_limit_by_profits();
sint64 hard_limit_by_assets = credit_limit_by_assets();

// The player gets the better of the two credit limits.  Remember that they are negative.
sint64 hard_credit_limit = min(hard_limit_by_profits, hard_limit_by_assets);
assert(hard_credit_limit <= 0);

// Soft credit limit is a percentage of the hard credit limit
// This percentage will be set by settings -- FIXME LATER
uint8 soft_credit_limit_percent = 50;

// Don't worry about exact computations here.
sint64 soft_credit_limit = (hard_credit_limit / 100) * soft_credit_limit_percent;
assert(soft_credit_limit <= 0);

com_month[0][ATC_HARD_CREDIT_LIMIT] = hard_credit_limit;
com_month[0][ATC_SOFT_CREDIT_LIMIT] = soft_credit_limit;

if(world->get_last_month()==0) {
// New year, record new starting credit limit
com_year[0][ATC_HARD_CREDIT_LIMIT] = hard_credit_limit;
com_year[0][ATC_SOFT_CREDIT_LIMIT] = soft_credit_limit;
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


So it's a % of assets calculated yearly, do I read that right?


Quote from: jamespetts on February 01, 2014, 11:20:35 AM
The credit limit calculation function was written by Neroden, and, for reference, I reproduce the code below:

The more interesting stuff is down in the routines  credit_limit_by_profits() and credit_limit_by_assets().  The first returns the amount of borrowing that would require all your operational profits over the last 12 months to cover the annual interest; the second just returns the value of your assets.

Best wishes,