Blkbird
King
- Joined
- Oct 29, 2005
- Messages
- 860
After spending way to much time manually calculating whether the production overflow of one build will be enough to speed up the next build by one turn, I've finally decided to write a calculator for it. Of course, there are other calculations I'm spending too much time on as well, so I'm planning to expand the functionality of this calculator in time to come. Suggestions welcome!
Edit: A second function calculating unit healing has been added, see #10 below.
Download: in the download database
This is a Python 3 script (incompatible with Python 2.x, but both Python versions can be installed side-by-side without problems) with interactive command line. The syntax of the production calculation is:
Full documentation of the syntax is available via "help p".
Starting with a trivial example, a Library (90) in a city with 20 base production, no overflow from previous build and no production boost whatsoever:
And if the city has a Forge (+25%) and 5 production overflow from previous build:
Note it's "5>20" because that is the order these numbers are shown in the city screen.
Now for something few people can calculate quickly in their heads, what if the city is expecting the spread of the State Religion, which gives +25% under Organized Religion, and 10 extra production from forest chopping, both in 2 turns?
And if the chopping finishes 1 turn earlier (which is bad because it misses the state religion boost), while the base production increases to 21 at the same time as State Religion arrives:
There is also a verbose version, "prod" instead of "p":
I hope a few people here will find this calculator useful, for I believe there are quite a number of anal-retentive perfectionists among us Civ fanatics.
Edit: A second function calculating unit healing has been added, see #10 below.
Download: in the download database
This is a Python 3 script (incompatible with Python 2.x, but both Python versions can be installed side-by-side without problems) with interactive command line. The syntax of the production calculation is:
Code:
p [built/]build: [over>][base][@rate][+plus][*turns], ...
Full documentation of the syntax is available via "help p".
Starting with a trivial example, a Library (90) in a city with 20 base production, no overflow from previous build and no production boost whatsoever:
Code:
> p 90: 20
Finishing in 5 turn(s) with an overflow of 10.
And if the city has a Forge (+25%) and 5 production overflow from previous build:
Code:
> p 90: 5>20@125
Finishing in 4 turn(s) with an overflow of 12.
Note it's "5>20" because that is the order these numbers are shown in the city screen.
Now for something few people can calculate quickly in their heads, what if the city is expecting the spread of the State Religion, which gives +25% under Organized Religion, and 10 extra production from forest chopping, both in 2 turns?
Code:
> p 90: 5>20@125*2, 10>@150
Finishing in 3 turn(s) with an overflow of 7.
And if the chopping finishes 1 turn earlier (which is bad because it misses the state religion boost), while the base production increases to 21 at the same time as State Religion arrives:
Code:
> p 90: 5>20@125*1, 10>*1, 21@150
Finishing in 3 turn(s) with an overflow of 6.
There is also a verbose version, "prod" instead of "p":
Code:
> prod 90: 5>20@125*1, 10>*1, 21@150
In 1 turn(s): 31/90...
In 2 turn(s): 68/90...
In 3 turn(s): 99/90...
Finishing in 3 turn(s) with an overflow of 6.
I hope a few people here will find this calculator useful, for I believe there are quite a number of anal-retentive perfectionists among us Civ fanatics.
