Page 1 of 1
Industry production annoyance...
Posted: 25 May 2004 10:47
by DjArcas
Just looking at the code for whether an industry grows or shrinks...
Seems to be fairly straightforwards, if a bit random...
If there was more than 153 transported (in the last month?) then the industry has a chance of growing - if not then it has a chance of shrinking.
There really should be some extra code here, I feel, to say 'unless an industry is new' - I've had it many times where a sawmill has been lying idle for 50 years, I start using it, and it goes bust 2 months later.
That '153' seems like a totally arbitrary number, too - why isn't is a percentage? Or even better, why isn't it a value, so the industry actually has to make a profit, or go bust? (it would be great to have it so that you could see the money an industry has made, and help it from going bust)
function MaybeCloseIndustry in industry_cmd.c
Re: Industry production annoyance...
Posted: 25 May 2004 13:59
by ucho
DjArcas wrote:That '153' seems like a totally arbitrary number, too - why isn't is a percentage?
But it _is_ a percentage

. 153/255= 60% . And it seems realistic for me. I changed it only a bit becouse i like to have much to transport
Code: Select all
if (type == IT_OIL_WELL && _opt.landscape == LT_NORMAL) goto decrease_production;
if ((i->pct_transported[0] > 170)&&(_economy.fluct > 0)) {
if (((i->pct_transported[0] > 230))||
((i->pct_transported[0] > 200) ^ CHANCE16I(2,3,r=Random()))||
(CHANCE16I(1,3,r=Random())))
{
/* Increase production */
Posted: 28 May 2004 00:21
by Csaboka
I've just made something like that:
http://sourceforge.net/tracker/index.ph ... tid=636367
This patch tries to make industry production more realistic. First, newly generated industries have randomized starting productions (between 50% and 200% of the old starting production). Second, the productions change much smoother than the old +100% -50% system: every month, an industry has two percent chance to decrease its production by a random amount between 5% and 25%. At the same time, it has by default 2% chance to increase production by a random amount between 5% and 25%, but this chance can be increased up to 4% by transporting the products from the industry. You get news messages about changes bigger than 10%. An industry announces closure if its production
drops below one quarter of the old default production.
I haven't tested this new system for longer periods, but it seemed to work fine for a few months. I plan extending this patch later to allow saving industries from "imminent closure", and allow power plants, banks and water towers to close down.
What do you think of this system? I hope it can make TTD more challenging and realistic by removing the usual 120 tons of coal, 90 tons of iron ore etc. Farms don't have their two cargo linked anymore, either.
Posted: 28 May 2004 09:03
by DjArcas
Is the '2% to decrease' chance regardless of goods transported?
Posted: 28 May 2004 09:14
by Csaboka
Yes, it is. We've discussed it on #openttd yesterday: whatever causes decrease of production, it's independent of how well the workers try to do their job. For example, an insect infestation has the same chance no matter how much grain is produced there. On the other hand, if a farm is going well (much transported from there), farmers will have a motivation to try to increase production (try out new, more productive farming methods).
Posted: 28 May 2004 09:18
by DjArcas
*nods*
Is there a cap on the maximum production rate? (or merely how much you can squeeze in a byte?)
Posted: 28 May 2004 09:27
by Csaboka
The base value for production is the amount the industry produces in one step. Since a primary industry produces cargo 8 or 9 times a month, the monthly production is 8 or 9 times this base value. For example, the base value for a coal mine is 15 tons, so the monthly production is 120 or 135 tons. This base value is capped at 255, so the maximum possible monthly production for any industry is 2040 or 2295.
Posted: 28 May 2004 09:39
by DjArcas
*nods*
So I have max'd out industries before, ace.
It might be an idea, in the future, to look at different types of industries differently. For instance, a mine has a very finite life, although it would tend to increase rapidly during it's life, then drop off sharply as the seams are exhausted, whereas a forest is (or should be

sustainable, but not likely to increase or decrease production.
Still, there's plenty of time. I look forwards to trying the new, smoother, industry production changes.
Posted: 28 May 2004 09:52
by Csaboka
I'm open to any suggestions, but all these changes should be tested much. I don't know how my changes modify the balance of gameplay yet, and we should test these basic changes before fine-tuning them.
Posted: 28 May 2004 10:45
by Csaboka
BTW the current implementation doesn't contain the "oil wells can't increase production on temperate" rule. Should I add it?
Posted: 28 May 2004 14:49
by School
Csaboka wrote:BTW the current implementation doesn't contain the "oil wells can't increase production on temperate" rule. Should I add it?
That should be kept since there are oil rigs with much more production.