The Number Crunching Thread

Something new to investigate. A given player (AI or human) will research a tech faster based upon how many civs that player knows who also have the tech.

cool, nice find... finally a solid explanation of why you can go from 2 turns left to done on techs.

this sort of makes early exploration more important, especially on higher levels where the AI is gifted some early techs
 
yep, I'm glad that there is at least an explanation for it. That does my head in no end sometimes! I have this really intricate sequence of RA's signed to get me astronomy and steel after currency, chivalry and education and it's been buggered up a number of times because the UI indicates there are 2 or 3 (I've even seen 4) turns remaining to be researched on a specific tech only for it to be finished next turn. Many thanks for the reason, don't see why the discount can't be taken into account for the displayed info.
 
Now that the UI properly displays the adjusted tech cost, the research formula is easier to test. Civ5 does indeed divide by the total # of civs like DaveMcW suggested, but it also uses a 1/(1+x) relationship.

Given the following:
  • B is the base cost of a tech; i.e. the XML cost with map size, handicap, and gamespeed modifiers already applied
  • K is the number of known, living civs who have the tech.
  • T is the total number of living civs in the game.
  • M is the TECH_COST_TOTAL_KNOWN_TEAM_MODIFIER global define (30 in unmodded game)
The adjusted tech cost, C is:
C = ceiling( B / ( 1 + floor( M * K / T ) / 100 ) )

or, prettier:


Some further examples are spoiled below.
Spoiler :

Prince, Huge, Standard speed game (1.3 modifier) with 12 civs.
Researching Gunpowder (B = 840 * 1.3 = 1092)
All civs still alive so T = 12.
Unmodded, so M = 30.

Here are the different costs for various numbers of known civs who have the tech:
Code:
K    C
--  ----
0   1092
1   1071
2   1040
3   1021
4    993
5    975
6    950
7    934
8    910
9    896
10   874
11   860
12   840

Note that the last entry doesn't really matter since at 
this point everyone in the game knows the tech.

Now for a similar game but with a total of 22 civs instead of 12:
Code:
K    C
--  ----
0  1092
1  1082
2  1071
3  1050
4  1040
5  1031
6  1012
7  1002
8   993
9   975
10  967
11  950
12  942
13  934
14  918
15  910
16  903
17  888
18  881
19  874
20  860
21  854
22  840

Finally, in that same 22 Civ game researching Chemistry (B = 1404)
C is 1338 if everyone's alive and 4 known civs have it (K = 4 and T = 22)
C drops to 1325 if 3 of the civs that don't have it are killed (K=4 and T=19)
C increases back to 1338 if one of the civs that did have it is killed (K=3 and T=18)
 
i wonder if that was intended only for teams, given that it is called team modifier.


simplified an approximation is the tech cost multiplied by 1 / (1 + .3 * percent of known civs with tech)
if all civs are known and have it, it costs 23% less, if half know it costs 13% less... with standard's 8 civs, if 7 know, it's about 21% less
 
I have something for you math buffs to look at :)

Continued from this thread: Can anyone figure out what determines a City State's beakers per turn?
 
it's the same as before, the multiplier changed to 3, the exponent 2.01

floor( 25 + ( 3 * ( policy number - 1 ) ) ^ 2.01 * (1 + number of cities policy cost mod * ( number of cities - 1 ) / 100 ) * policy percent handicap modifier * game speed culture percent * (100 - cristo redentor + piety finisher reductions) / 100 / 5 ) * 5

number of cities policy cost mod is 15 base, 10 with representation, lower with larger than standard map sizes
policy percent handicap modifier is .5 on settler, .67 on chieftain, .85 on warlord
game speed is .67 on quick, 2 on epic, 3 on marathon
cristo + piety finisher are 10 each if you have them

the floor( x / 5) * 5 is just to round down to the nearest 5
 
I'd like to understand food growth better so here's an attempt at analysing it a bit.


Food Cost

Let's start by repeating the food cost function. When your city has n citizens, the amount of food required to grow to n+1 is

g(n) = 15 + 6 (n - 1) + (n - 1)^1.8

?

Is that still current?
 
it's based on some numbers in the defines.xml file which have changed
the base city growth is still 15,
city growth multiplier is 8,
city growth exponent is 1.5
 
this isn't really appropriate for number crunching thread, and there is a post on it in bug reports. it's 2^31 / 10000 = 214748 beakers, standard integer overflow.
if you're making a mod i'd just lower all research costs and gains considerably, since fractional parts are kept
 
Here is a mathematical question.

In real life, if you flipped a coin 5 times and the first 4 flips got you a heads what would be the chance of getting tails on the next flip?
Commonly Accepted Answer: 1/2,50%

But, Rene Descartes mentioned in one of his books that you are more likely to get a tails on the next flip.
Cartesian Answer: +1/2,>50

How does this relate to civ?

If you get super lucky with your capital and have 4 different luxuries, are you less likely to find resources further away from your capital?
This was mentioned in one of wainy's Bab2lon LPs.
 
Here is a mathematical question.

In real life, if you flipped a coin 5 times and the first 4 flips got you a heads what would be the chance of getting tails on the next flip?
Commonly Accepted Answer: 1/2,50%

But, Rene Descartes mentioned in one of his books that you are more likely to get a tails on the next flip.
Cartesian Answer: +1/2,>50

How does this relate to civ?

If you get super lucky with your capital and have 4 different luxuries, are you less likely to find resources further away from your capital?
This was mentioned in one of wainy's Bab2lon LPs.

Well Decartes was wrong about coins... BUT he would be right about civ, because AFAIK the game doesn't treat each tile individually (like coin flips)
 
Here is a mathematical question.

In real life, if you flipped a coin 5 times and the first 4 flips got you a heads what would be the chance of getting tails on the next flip?
Commonly Accepted Answer: 1/2,50%

But, Rene Descartes mentioned in one of his books that you are more likely to get a tails on the next flip.
Cartesian Answer: +1/2,>50

How does this relate to civ?

If you get super lucky with your capital and have 4 different luxuries, are you less likely to find resources further away from your capital?
This was mentioned in one of wainy's Bab2lon LPs.

When you flip coin, you suppose the indepandance of the 5th times compare to the 4 previous flip, which is correct.

With Civ, I bet "Find resources further away from your capital" is not independant from "have 4 different luxuries in your cap". I don't know how they distribute lux in space, but it cant be totaly random.

BTW, i never had 4 lux in my cap in random map.
 
Well Decartes was wrong about coins... BUT he would be right about civ, because AFAIK the game doesn't treat each tile individually (like coin flips)

it depends on your inference point.

If you're saying that you'd flip a coin 5 times and get heads the first four times, THEN flip the coin and get tails - of course it's less than 50%. H*H*H*H*T

If however, you took it at the point of "What will the next flip give?" there's only 2 answers, and every flip before it didn't count, so it's 50%.

As per the actual question:

Yes it's more like to see 'more of the same' lux's, if you had a 4 unique lux start, than many new ones. Especially if they were calendar or trapping resources, which tend to come in clusters spread over a wide area.

You can find more 'unique' luxs, but they'd be few and far between. (the game seems to 'spray' an area with a lux type)
 
it depends on your inference point.

If you're saying that you'd flip a coin 5 times and get heads the first four times, THEN flip the coin and get tails - of course it's less than 50%. H*H*H*H*T

If however, you took it at the point of "What will the next flip give?" there's only 2 answers, and every flip before it didn't count, so it's 50%.

As per the actual question:

Yes it's more like to see 'more of the same' lux's, if you had a 4 unique lux start, than many new ones. Especially if they were calendar or trapping resources, which tend to come in clusters spread over a wide area.

You can find more 'unique' luxs, but they'd be few and far between. (the game seems to 'spray' an area with a lux type)

Well chance of H*H*H*H*T is Exactly equal to the chance of H*H*H*H*H

but Both of those are less than 50% [/tangent]
 
Do you know the formula for the city strenght?
Or at least what and in what way affects the city strenght?
I've read in manual that
Each city has a “Combat Strength” stat which is determined by the city’s location, its size, whether any military units are “garrisoned” in that city, and whether defensive buildings such as walls have been constructed in the city.

Do you know how exactly the location affects the value of city's strenght?

Thx :)
 
Top Bottom