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

Default / non-smooth economy decrease prod_rate calculation #2772

Closed
DorpsGek opened this issue Mar 29, 2009 · 2 comments
Closed

Default / non-smooth economy decrease prod_rate calculation #2772

DorpsGek opened this issue Mar 29, 2009 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

SirkoZ opened the ticket and wrote:

Version: 0.7.0-RC2 (and before) and nightlies since quite some time (I haven't used default economy to see it before now).

The two decreased productions/production levels (the lowest and one higher than the lowest) of default economy are currently calculated wrongly with this formula:
i->production_rate[0] = min(indspec->production_rate[0] * i->prod_level / PRODLEVEL_DEFAULT, 0xFF);

E.g. Coal Mine -> TTD calculation for decrease: (prod_rate >> 1) + 1 so we get 15/2 + 1 = 7 * 8 or 9 = production of 64 or 72 tonnes of coal per month. At the same time the lowest production would be 32 or 40 tonnes per month.

With this new formula, production is 56 or 63 and if it decreases once more, it's only 24 or 30 per month which is totally wrong/as low as the oil wells which start at 96/108.

It should be coded (as it's in TTD) that industries gain one unit of production when they decrease (if of course production rate isn't cleanly divisible with 2).

Reported version: 0.7.0-RC2
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2772
@DorpsGek
Copy link
Member Author

frosch wrote:

I changed it so, production rate is rounded up. That way e.g. oilrigs produce some passengers even on lowest production level.

However. TTD ended up with a different production rates when halfing the production and then doubling again. This inconsistency will not be introduced again. You will have to play TTDP, if you want to play unmodified TTD.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2772#comment5858

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r15888


This comment was imported from FlySpray: https://bugs.openttd.org/task/2772

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant