subchannel13 / Stareater

4X turn based strategy
GNU General Public License v3.0
32 stars 7 forks source link

Spicing up food production #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Proposition for following:

In current model, percentage of farmers is directly proportional with farmer 
productivity which in turn depends only on technologies and employment rate. 
Idea is to make farmer productivity (and consequently percentage of farmers) 
dependent upon population size. Larger population would require 
disproportionaly more farming effort.

Let's say that dropoff starts when number of farmers is greater then 1/10 of 
colony's base max. pop. Farmers working in second 1/10 would suffer penalty to 
their productivity, those working in third 1/10 would suffer even greater 
penalty and so on.

Example:
Let's chose something like 2^-x as dropoff function, let colony population and 
population limit be 100 and farmers initial productivity be 3 units of food per 
farmer. Current model would require 34 farmers.

In proposed model first group of farmers would be producing 3 units (1 + 2), 
second 2 units (1 + 2/2), third 1.5 (1 + 2/4), forth 1.25 units and so on. That 
specially treated one unit production is there to prevent starvation. This 
model would require about 60 farmers on colony from example. That is quite 
steep but with some balancing, it won't be so crippling and yet production 
penalty will matter. 

Original issue reported on code.google.com by subchann...@gmail.com on 12 Sep 2011 at 11:14

GoogleCodeExporter commented 9 years ago
After some thinking and experimenting I've finally found the function that fits 
the bill (limit when x -> inf = constant, integral has inverse, etc.):

f(x) = a + b/(x+1)^2

where
x - dropoff distance (see below)
f(x) - food per farmer at dropoff distance of x
a - minimal food per farmer
b - maximal food per farmer minus "a"

Let's denotate with D population that can work as farmers without penalty. D + 
1st farmer has dropoff distance of 1/D, D + 2nd has distance of 2/D, etc. Now, 
how to calculate number of necessary farmers (excluding first D farmers)? Well, 
that's why I was looking for inverse of integral function.

Integral (with condition F(0) = 0) of the function above is 

F(x) = ax + b/(x+1) + b

Inverse of that integral is

F^-1(y) = (sqrt(g^2 + 4ay) + g) / 2a

where
y - food units demand (excluding demand covered by first D farmers) divided by D
g = y - a - b
a, b - same as above

Original comment by subchann...@gmail.com on 15 Nov 2011 at 2:16

GoogleCodeExporter commented 9 years ago

Original comment by subchann...@gmail.com on 15 Nov 2011 at 10:42

GoogleCodeExporter commented 9 years ago
Forumal correction:

F(x) = ax - b/(x+1) + b

F^-1(y) = (sqrt(g^2 + 4ay) + g) / 2a
where
y - food units demand (excluding demand covered by first D farmers) divided by D
g = a + b - y
a, b, x, D - same as above

Original comment by subchann...@gmail.com on 23 Aug 2013 at 2:10