Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Always apply inflation from 1920 to 2090, no matter the game start year. #7589

Open
wants to merge 1 commit into
base: master
from

Conversation

@michicc
Copy link
Member

michicc commented May 12, 2019

Discuss!

@PeterN

This comment has been minimized.

Copy link
Member

PeterN commented May 13, 2019

I think this changes the default game too drastically to be always-on. A standard 1950 start now begins with 30 years of inflation already applied.

@michicc

This comment has been minimized.

Copy link
Member Author

michicc commented May 13, 2019

If it's not always on, then there is absolutely no point except providing a third incompatible variant for NewGRF authors to gripe about.

@@ -938,6 +938,14 @@ void StartupEconomy()
_economy.infl_amount_pr = max(0, _settings_game.difficulty.initial_interest - 1);
_economy.fluct = GB(Random(), 0, 8) + 168;

if (_settings_game.economy.inflation) {
/* Apply inflation that happened before our game start year. */
int months = (_cur_year - ORIGINAL_BASE_YEAR) * 12;

This comment has been minimized.

Copy link
@Eddi-z

Eddi-z May 13, 2019

Contributor

probably the least important question on this topic, but shouldn't this be const?

@Eddi-z

This comment has been minimized.

Copy link
Contributor

Eddi-z commented May 13, 2019

While i generally think this is a step in the right direction, i think it falls short on so many levels.

Inflation is meant as a factor that drives the difficulty forward as the game goes on, so that the player is forced to adapt to new technologies and optimize the network to stay profitable.

But forcing this divergence of income vs costs onto a newly started game makes it unnecessarily difficult.

A better approach IMHO would be to always apply the same inflation to costs, but make the difficulty setting about the income divergence. the divergence then would start being applied after game start only, while the price inflation would be consistently applied at the base game year, perhaps even further back, if we introduce fractional currency?

Also, i think applying the divergence should stop at the moment no new vehicles get introduced (the point where the reliability curve gets frozen), not at the "original" end year. maybe even a more dynamic inflation divergence based on the vehicle progression

@James103

This comment has been minimized.

Copy link
Contributor

James103 commented Jul 27, 2019

Would it be possible to separate the inflation rate setting into as much as 7 different settings? If so, here are my proposed settings:

  1. Loan interest rate: 0% to 255%.
  2. Inflation rate for company expenses: 0% to 255%.
  3. Inflation rate for cargo income 0% to 255%.
  4. Initial inflation factor for company expenses: 1/16 to 1024 in steps of 1/16.
  5. Initial inflation factor for cargo income: 1/16 to 1024 in steps of 1/16.
  6. Maximum inflation factor for company expenses: 1 to 1024 in steps of 1/16.
  7. Maximum inflation factor for cargo income: 1 to 1024 in steps of 1/16.

This would separate loan interest from inflation and provide customization about the income divergence and initial inflation, on top of the existing inflation rate customizability. This would allow you to make the game easier or harder at the start with finer cost adjustments then what even the Basecosts NewGRF can provide, as well as allow you to simulate deflation (such as during recessions), high inflation (like in the USA during the 1970's), or even mild hyperinflation by changing the inflation rates and therefore financial difficulty curve.

Note that splitting the settings like this would make the inflation toggle obsolete, as instead the inflation rate could be set to 0 to disable inflation (or loan interest to 0 to disable that, if you will).

When converting old savegames, the settings should be set as follows.

  1. Loan interest rate: Same as before (same as the old loan interest setting)
  2. Inflation rate (company expenses): Same as before.
  3. Inflation rate (cargo income): Same as before, then subtract 1 percentage point.
    Note that if inflation is off, then both values will be zeroed on conversion.
  4. Initial inflation factor (both sides): Always equal to 1.
  5. Maximum inflation factor: Calculated as (inflation rate in percent / 100 + 1)^170, rounded to the nearest 16th and capped at 1024.

Note that you could still increase the maximum value for the initial/maximum inflation factor another 32 times, up to 32767. This "inflation cap" value is defined in

static const uint64 MAX_INFLATION = (1ull << (63 - 32)) - 1;
and is is checked for in these lines.

OpenTTD/src/economy.cpp

Lines 759 to 760 in 2e686ad

if (_economy.inflation_prices > MAX_INFLATION) _economy.inflation_prices = MAX_INFLATION;
if (_economy.inflation_payment > MAX_INFLATION) _economy.inflation_payment = MAX_INFLATION;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.