Sort of a BUMP + comments on workings of patch.
It would be nice if it were included in nightly already.
1.) Farm patch:
Code: Select all
if (i->type == IT_FARM || i->type == IT_FARM_2)
MaybePlantFarmField(i);
Comment: Both - ordinary and sub-tropical (maize) farm will plant new fields, if the old ones get
destroyed by building railways etc. around the farm.
2.) Smooth_economy patch (increase/decrease conditions)
The industry in O/TTD gives cargo out to station 8 or 9 times per month (depends on DAY_TICKS
in ttd.h). These amounts of cargo are called production_rate (in the game - the production, that
is displayed in an industry window is the total_production).
Conditions for changes of production_rate (new = old = i->production_rate[j]):
A) Increase of production:
Code: Select all
if ((i->pct_transported[j] > 153) && CHANCE16I(1,50,r))
new += ((RandomRange(50) + 10)*old) >> 8;
Comment: There is 2% chance of increase (from 10 to 22%) if industry gives out (to stations)
over 60% of its monthly production (pct_transported = percent of total production,
that ranges from 0-255, i.e. 255 = 100%).
B) Decrease of production:
Code: Select all
if ((i->pct_transported[j] < 153) && (i->pct_transported[j] > 0) && CHANCE16I(1,50,r) && (old > 5))
new -= ((RandomRange(50) + 10)*old) >> 8;
Comment: There is 2% chance of decrease (from 10 to 22%) if industry gives out less than 60%
and more than 0% of its monthly production.
"Safety switch" (old > 5):
Old production_rate has to be more than 5 or the industry will no longer
increase with new production_rate being 4 or less than 4.
C) The industry is not used by anyone (waiting for better times

)
Code: Select all
if ((i->pct_transported[j] == 0) && CHANCE16I(1,10,r) && (old > 6))
new += 2-(RandomRange(5));
Comment: There is a 10% chance, that production_rate changes each month [-3, +2] (units),
if noone uses the industry. Decrease is a bit more favoured over the increase, though in game
it works quite randomly and also quite balanced.
Again - there is a "safety switch" (old > 6) - if old production was under 6 and production_rate
decreased to 4 or below (units), it would - again - not increase anymore.