1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

The Number Crunching Thread

Discussion in 'Civ5 - Strategy & Tips' started by alpaca, Oct 8, 2010.

  1. Ulti_mecia

    Ulti_mecia Chieftain

    Joined:
    Sep 22, 2010
    Messages:
    35
    Location:
    Belgium
    25 percent increase
     
  2. zzzz

    zzzz Chieftain

    Joined:
    Nov 5, 2001
    Messages:
    21
    That's not much and somewhat of a disappointment. Certainly will not change the numbers much.
     
  3. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    Yeah it has little influence. The +25% increase is applied to excess food only so to fit it into the analysis, just multiply the whole food formula by 1.25. Hospitals work slightly differently but you can get a good approximation by simply halving g (it's not quite perfect because what you will actually keep when going to level n+1 is g(n)/2, not g(n+1)/2)
     
  4. Dizzy75

    Dizzy75 Chieftain

    Joined:
    Mar 22, 2006
    Messages:
    245
    Yes, you're right - in my example, if you're getting just 1 culture per city and no city states, that's an abysmally slow speed, so I suppose it does make intuitive sense that any additional culture from a new city would help speed it up.
     
  5. Ulti_mecia

    Ulti_mecia Chieftain

    Joined:
    Sep 22, 2010
    Messages:
    35
    Location:
    Belgium
    Basically yes, if you invest (the correct amount can be found throughout this thread :) )

    @ alpaca,

    I was thinking the same thing about the WLTKD, but I wasn't sure anymore.
    Can we assume the same goes for the Floating Gardens bonus then ?
     
  6. Bibor

    Bibor Doomsday Machine

    Joined:
    Jun 6, 2004
    Messages:
    2,302
    Location:
    Zagreb, Croatia
    You mean:

    Napoleon only takes care of the "number of cities inflation" part of policy prices and you still need buildings to counter the "number of policies inflation".
     
  7. Bibor

    Bibor Doomsday Machine

    Joined:
    Jun 6, 2004
    Messages:
    2,302
    Location:
    Zagreb, Croatia
    Floating gardens are amazing as long as you have a lake(s) around and pretty good as long as you want your city to actually grow. It also costs just 1 not 2 GPT, compared to the building it replaces. It's also ridiculous if you have a 4-5 hex lake that you can put your city near to.

    However, I realised painfully that a Lighthouse does not improve lake food as it used to in CIV4.
     
  8. jaldaen

    jaldaen Chieftain

    Joined:
    Feb 19, 2006
    Messages:
    467
    Here's a link that might be of interest for the culture/city analysis. I just posted it in its own thread, but that was before I saw this one.
     
  9. Ulti_mecia

    Ulti_mecia Chieftain

    Joined:
    Sep 22, 2010
    Messages:
    35
    Location:
    Belgium
    At least they added the extremely handy Seaports now.
    As a small point in favor of the Lighthouse: it increases The Great Barrier Reef tiles with 1 food :)

    Absolutely correct.
     
  10. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    I don't know, I never played the Aztecs yet. However, if that is the case the floating gardens are very lame compared to a watermill because 15% of your growth will rarely even match a flat +2 food per turn (would require a food surplus > 13)
     
  11. Sumendar

    Sumendar Chieftain

    Joined:
    Sep 20, 2010
    Messages:
    26
    I noticed today that when you conquer a city, nT gets reset to 0. I have no idea what happens on re-conquest though.
     
  12. Ulti_mecia

    Ulti_mecia Chieftain

    Joined:
    Sep 22, 2010
    Messages:
    35
    Location:
    Belgium
    Wow, just noticed a huge oversight on my part: representation isn't "+1 culture to all cities connected to the capital"; but instead "+1 culture per city". This makes it slightly better than I thought as it applies both instantly and to the capital as well :)

    "Assumptions are the mother of all :):):):)-ups". I assumed it was, and therefore was wrong
     
  13. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    The same. Quite stupid if you ask me. I'm ok with the city keeping the tiles but afterwards the growth speed is fairly high. Of course, all cultural buildings are razed on conquest.
     
  14. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    Unit Maintenance

    Unit maintenance is calculated as follows:

    c(t,n) = ((j n)//100 (1 + 2t m/1000))^(1 + 2t/(1000*d))

    where n = number of units and t = number of turns. // denotes an integer division. j, m and d are constants from GlobalDefines.xml, j = INITIAL_GOLD_PER_UNIT_TIMES_100, m = UNIT_MAINTENANCE_GAME_MULTIPLIER, d = UNIT_MAINTENANCE_GAME_EXPONENT_DIVISOR

    With the vanilla settings, the formula then is

    c(t,n) = floor(floor(0.5 n) (1 + 16/1000 t))^(1 + 2/7000 t))


    Since there's no easy "each unit in turn t will cost this much" here's a table you can use as a rough reference. The first row is the number of turns, the first column the number of units

    Code:
    					Turns
    Units	1	20	50	100	150	200	250	300	350	400
    4	2	2	3	5	7	9	11	14	17	20
    8	4	5	7	11	15	19	24	30	36	43
    12	6	8	11	16	23	30	38	47	57	68
    16	8	10	14	22	31	41	52	64	78	94
    20	10	13	18	28	39	52	66	82	100	121
    24	12	16	22	34	47	63	80	100	122	148
    28	14	18	26	40	56	74	94	118	145	176
    32	16	21	30	46	64	85	109	136	168	204
    36	18	24	34	52	73	96	124	155	191	232
    40	20	26	37	58	81	108	138	174	215	261
    44	22	29	41	64	89	119	153	193	238	291
    48	24	32	45	70	98	131	168	212	262	321
    52	26	35	49	76	107	142	184	231	287	350
    56	28	37	53	82	115	154	199	251	311	381
    60	30	40	57	88	124	166	214	270	335	411
    64	32	43	61	94	133	177	229	290	360	442
    68	34	45	64	100	141	189	245	310	385	473
    72	36	48	68	106	150	201	260	330	410	504
    76	38	51	72	112	159	213	276	349	435	535
    80	40	54	76	118	167	225	292	370	461	567
    84	42	56	80	124	176	237	307	390	486	598
    88	44	59	84	130	185	249	323	410	512	630
    92	46	62	88	137	194	260	339	430	537	662
    96	48	64	92	143	203	273	354	451	563	694
    100	50	67	95	149	211	285	370	471	589	727
    
    Here's an equivalent table detailing the cost per unit

    Code:
    					Turns
    Units	1	20	50	100	150	200	250	300	350	400
    4	0.50	0.50	0.75	1.3	1.8	2.3	2.8	3.5	4.3	5.0
    8	0.50	0.63	0.88	1.4	1.9	2.4	3.0	3.8	4.5	5.4
    12	0.50	0.67	0.92	1.3	1.9	2.5	3.2	3.9	4.8	5.7
    16	0.50	0.63	0.88	1.4	1.9	2.6	3.3	4.0	4.9	5.9
    20	0.50	0.65	0.90	1.4	2.0	2.6	3.3	4.1	5.0	6.1
    24	0.50	0.67	0.92	1.4	2.0	2.6	3.3	4.2	5.1	6.2
    28	0.50	0.64	0.93	1.4	2.0	2.6	3.4	4.2	5.2	6.3
    32	0.50	0.66	0.94	1.4	2.0	2.7	3.4	4.3	5.3	6.4
    36	0.50	0.67	0.94	1.4	2.0	2.7	3.4	4.3	5.3	6.4
    40	0.50	0.65	0.93	1.5	2.0	2.7	3.5	4.4	5.4	6.5
    44	0.50	0.66	0.93	1.5	2.0	2.7	3.5	4.4	5.4	6.6
    48	0.50	0.67	0.94	1.5	2.0	2.7	3.5	4.4	5.5	6.7
    52	0.50	0.67	0.94	1.5	2.1	2.7	3.5	4.4	5.5	6.7
    56	0.50	0.66	0.95	1.5	2.1	2.8	3.6	4.5	5.6	6.8
    60	0.50	0.67	0.95	1.5	2.1	2.8	3.6	4.5	5.6	6.9
    64	0.50	0.67	0.95	1.5	2.1	2.8	3.6	4.5	5.6	6.9
    68	0.50	0.66	0.94	1.5	2.1	2.8	3.6	4.6	5.7	7.0
    72	0.50	0.67	0.94	1.5	2.1	2.8	3.6	4.6	5.7	7.0
    76	0.50	0.67	0.95	1.5	2.1	2.8	3.6	4.6	5.7	7.0
    80	0.50	0.68	0.95	1.5	2.1	2.8	3.7	4.6	5.8	7.1
    84	0.50	0.67	0.95	1.5	2.1	2.8	3.7	4.6	5.8	7.1
    88	0.50	0.67	0.95	1.5	2.1	2.8	3.7	4.7	5.8	7.2
    92	0.50	0.67	0.96	1.5	2.1	2.8	3.7	4.7	5.8	7.2
    96	0.50	0.67	0.96	1.5	2.1	2.8	3.7	4.7	5.9	7.2
    100	0.50	0.67	0.95	1.5	2.1	2.9	3.7	4.7	5.9	7.3
    
    
    
    Edit: Small caveat, I still have to check if the game floors or rounds the values after calculating the function.

    Edit2: Ok, the game floors so I updated the tables
     
  15. KrikkitTwo

    KrikkitTwo Immortal

    Joined:
    Apr 3, 2004
    Messages:
    12,296
    Does that include 'gold bought tiles'?
    and what is the formula for the cost of those tiles?
     
  16. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    No, gold tiles don't increase culture-cost, but the reverse is true. As far as I know, every tile the city has in excess of it's inner ring adds 5 to the gold buy cost for the next tile, no matter whether it was claimed by culture or bought. I don't know how the base cost is calculated, but it seems like flat terrain and the tiles your city would culturally claim next are cheaper than hills and forests.
     
  17. ccubed

    ccubed Chieftain

    Joined:
    Nov 21, 2005
    Messages:
    61
    Disclaimer: I'm horrible at math and have next to zero skill with spreadsheets.

    That said, I was wondering if anyone could put some of these calculations together into spreadsheets for relative ease of use to calculate some of the costs. I'm specifically thinking about something where you could input or just cross-reference the number of social policies you have with the number of cities you have founded/annexed to determine when you'll next be getting an additional SP.

    I usually hold off for quite awhile to get Renaissance and Industrial age SPs, but I'm never quite sure how many I'll be able to get all at once when I qualify. I'd love to just type in 2 purchased SPs and 5 cities and get a number. Is that possible?
     
  18. Sumendar

    Sumendar Chieftain

    Joined:
    Sep 20, 2010
    Messages:
    26
    Alpaca, are you sure the unit maintenance tables correspond to the current formula listed? Shouldn't the total cost go up linearly with the amount of units, with just a +-1 for rounding as the number of units is only included as a final multiplier? Instead, looking at, say, the turn 300 column at 20 unit intervals, the cost goes up by 82, 92, 96, 100, 101. Quickly checking with a calculator I get ~67.432 per 20 units from the formula listed (0.5n=10).


    Ceterum censeo, this is a horribly kludgy way of defining unit maintenance costs. It's the only thing in game affected by inflation, and if it's supposed to model more modern units requiring more maintenance, that would be better done by raising the costs either by the amount of techs or defining it separately for each unit type.
     
  19. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    No, it doesn't increase linearly in the amount of units. The formula for a fixed number of turns is c = k*n^k' where k and k'>1 are constants for each turn. This means the formula increases in a higher-than-linear fashion with the number of units, the more strongly the further you are in the timeline. For turn 300, k' = 1.085 approximately so if you go to high unit number you'll definitely notice the non-linearity. The tables were created using the formula, by the way, they are not in-game values. I think they match, but didn't check a huge number of them (instead, I conducted controlled experiments to figure out the parameters).

    I agree that this solution for maintenance isn't great.
     
  20. Sumendar

    Sumendar Chieftain

    Joined:
    Sep 20, 2010
    Messages:
    26
    Ah yes, just noticed that it's (n*k)^(k') , not (n)*(k^k') as I first read.
     

Share This Page