View Full Version : What will the AI research next?


alexman
Feb 24, 2003, 11:47 AM
It has happened to all of us. We go full-speed to get a tech so we can sell it to all the AIs and get rich, only to find that some AI is also researching the same tech, gets it before us, and sells it to everyone. Wouldn't it be nice to be able to predict what technology the AI will research next?

Well, after reading this post, you can at least have an idea of the AI priorities.

The AI places a value on each technology it can research next. The values depend on the various things allowed by each technology, as well as on the turns needed by that AI civ to complete the research. Here are the values:

SS Component: 261/turns
Government: 259/turns
Conscription: 259/turns
Mobilization: 259/turns
Defender (no resource): 198
Attacker (no resource): 134
No trade: 149/turns
Defender (resource reqd): 70
Naval Transport: 34
Resource (lux, strat, bonus): 16
Double Worker Speed: 8
Allows Diplomats: 8
MPPs: 8
ROPs: 8
Alliances: 8
Embargoes: 8
Trade Over Ocean: 8
Attacker (resource reqd): 6
Wonder: 6
Irrigation: 4
No Disease: 4
Trade Over Sea: 4
Bridges: 2
Double Wealth: 2
Map Trades: 2
Communications Trade: 2
Small Wonder: 2
Specialist: 2
Unit (no A/D/NT): 2
Improvement: 2
Other tech: 1
Recycling: 1
Prec. Bombing: 1
Worker Job: 1
Bonus Tech: 0
Reveal Map: 0
Sacrifices: 0
Empty Tech Cost: 256/turns
Optional: divide by 1.5

These values are cumulative. For example, Iron Working allows swordsmen and iron, so it has a value of 22 more than if it were just an empty tech. Furthermore, for the Romans who build Legionaries (attacker and defender), Iron Working is worth an additional 70 points!

When playing the game, you don't know exactly the value of each technology because you don't know how many turns it would take the AI to complete it. However, you can often estimate that number based on your own research.

By the way, I got these results by stripping all technologies from their benefits, adding them back one by one, and assuming that the next technology that the science advisor suggests is the same as what the AI would do in my situation.

[I actually posted this list a while back, but a recent post by DaveMcW reminded me to post it again here]

Bamspeedy
Feb 24, 2003, 02:26 PM
Great study, Alexman!

Just 1 questions. I see that resources has a value of 16. In normal Civ3, this of course would obviously mean strategic resources. However, in some mods they have bonus resources and luxuries appear with techs. Could you test to see if these are treated the same as strategics? I haven't played the DyP mod in several months, but they did have a problem with some AI avoiding an optional tech that allowed a luxury to appear (weaving was the tech I think). But the calculation that optional techs divide the numbers by 1.5 could explain the main cause of the AI avoiding that tech.

alexman
Feb 24, 2003, 02:33 PM
That's a good question, and I do not have the answer. I tested only strategic resources. I will look into luxury and bonus resources again when I find the time (unless someone else does that for us in the meantime ;) )

[GoD]Toxic
Feb 24, 2003, 03:03 PM
Is the worth of a "naval unit" reduced on a panenga (i know i spelled it wrong)?

Grey Fox
Feb 24, 2003, 04:36 PM
Good Work Alexman.

Bamspeedy
Mar 22, 2003, 02:12 AM
There is indeed a random factor (I thought you said there was a possiblity of this, you probably said this at Apolyton, because I can't find that statement here, but oh well...).

If you use the Civ3 Multi-Tool (save-game editor), you can find out what each civ is currently researching.

Both tests were with 16 civs (Civ3 1.29f)

First test: Every civ started with absolutely no techs. Everyone started on bronze working, except for Babylon. Ok, so with this test it looked like there wasn't a random factor and Babylon went with warrior code to get their UU.

Second test: Every civ started with Bronze working, Iron Working, Wheel, and warrior code.
Masonry:Aztecs, Zulu, Babylon, Germany, England
Ceremonial Burial: Iroquois, Greece, Japan, France
Horseback Riding: Persia
Pottery:Egypt, Rome, India, China, Russia

1. Persia and Iroquois confuses me. Why Persia goes for horseback Riding and the Iroquois avoid it, I don't know.
2. Everyone avoided Alphabet. Probably because it doesn't offer any city improvements, military units, or Wonders like the other techs do.

Edit: Aztecs must have got pottery from a hut when they founded their city, so they couldn't have researched pottery, if that makes much difference.

alexman
Mar 23, 2003, 09:22 AM
Thanks for the test Bamspeedy! Good idea to use the multi-tool to see what they are actually researching.

It seems that the values I posted above are relevant in that they weight the AI random choice in some way.

Assuming a standard map with each civ producing 4 beakers per turn, here are the values for each technology:

Bronze Working - 218 (352 for Zulu)
Masonry - 22
Alphabet - 9
Pottery - 23
Wheel - 33
Warrior Code - 148 (346 for Babylon)
Ceremonial Burial - 23
Iron Working - 29 (99 for Rome)
Horseback Riding - 15

In the first test, we can see why everyone but the Babs chose Bronze Working. It's heavily favored, and there weren't enough tests to catch the less likely choices.

In the second test, we can see that Masonry, Pottery, and Burial have approximately the same value, and the AI chooses among them with about equal probability. Horseback has a lesser value than those three, and we see the AI chose it with less frequency. With more tests, I would expect Alphabet to be chosen also, but with even less frequency than HBR.

Note that Persia and the Iroquois do not get any additional incentive to choose Iron Working and Horseback Riding, respectively. Civs get an additional incentive only if their UU has different properties than the unit it replaces. For example, Bowmen are both an attacker and defender, so it's as if they get Spearmen and Archers from the same tech. Similarly, Impi are flagged both for offense and defense, so the Zulu value Broze even more. India would value Chivalry because it makes their Knight-level unit not require resources, but China would place no additional value to that same tech.

TheNiceOne
Mar 26, 2003, 05:03 AM
alexman: Just a wild guess from me: It may be that there is a random factor involved (should be able to check it by recreating the same scenario and see whether the same civ always started on the same tech or not), but my wild guess is that maybe units and improvements have different value for different civs absed on whether this improvement/units can be combined with the civ's "build often" or "build never" settings. I.e., is it possible that a civ which has wealth as build often will value a tech that allows it to build banks higher than other civs?

alexman
Mar 26, 2003, 09:39 AM
Good guess. Actually, that was one of the first things I suspected as well, as the reason for doing this test in the first place was to try and improve the AI.

Unfortunately, that's not the case. It seems there is a random factor that doesn't depend on the build-often list. After Bamspeedy's test, I did repeat the same scenario many times, and different civs indeed choose different techs.

Of course even with the random factor, techs with higher value were chosen more often, given enough tests.

Bamspeedy
Apr 04, 2003, 06:25 AM
I think having multiples of the same thing is also cumulative. In the DyP mod, Weaving used to only allow 1 luxury to appear on the map and the AI sometimes avoided this tech. But now with the newest version of the mod, there are like 4 resources that appear with that tech and from what I've seen, the AI pick up that tech rather quickly.

I know in your example of a cumulative effect, you listed an attacker and a defender. But I think if there are 2 attackers this would also be worth more than if it was just 1 attacker. I know, this applies more to mods than regular Civ3, so I'll shut up now....

Dr Elmer Jiggle
Apr 09, 2003, 04:58 PM
Originally posted by alexman
Assuming a standard map with each civ producing 4 beakers per turn, here are the values for each technology:

Bronze Working - 218 (352 for Zulu)
Masonry - 22
Alphabet - 9
Pottery - 23
Wheel - 33
Warrior Code - 148 (346 for Babylon)
Ceremonial Burial - 23
Iron Working - 29 (99 for Rome)
Horseback Riding - 15


Can you elaborate on how you got these numbers? I must be completely misunderstanding the formula, because here's what I got. I didn't worry about unique units, so these are just the general non-civilization specific numbers.

Bronze Working - 204
Defender (no resource): 198 (Spearman)
Wonder: 6 (Colossus)

Masonry - 10 or 11
Wonder: 6 (Pyramids)
Improvement: 2*2 = 4 (Palace, Walls)
Worker Job: 1 (Outpost/PTW)

Alphabet - ?
Empty Tech Cost: 256 / ?

Pottery - 2
Improvement: 2 (Granary)

Wheel - 22
Attacker (resource reqd): 6 (Chariot)
Resource: 16 (Horses)

Warrior Code - 134 (346 for Babylon)
Attacker (no resource): 134 (Archer)

Ceremonial Burial - 2
Improvement: 2 (Temple)

Iron Working - 22
Attacker (resource reqd): 6 (Swordsman)
Resource: 16 (Iron)

Horseback Riding - 6
Attacker (resource reqd): 6 (Horseman)

Not one of these matches your numbers. What am I missing?

alexman
Apr 10, 2003, 06:39 PM
You are missing the factor for number of turns that it takes to research those technologies.

For a standard map (tech rate = 240), the AI needs 24 times the base cost of each technology in beakers. For example, Bronze Working costs 72 beakers (3 times 24), so an AI producing 4 beakers per turn would need 72/4=18 turns to complete it.

So if Bronze Working were an empty tech, it would have a value of 256/18=14. Add this value to your calculation of 204, which is the added value for the Colossus and spearmen, and you get 218. :)

Dr Elmer Jiggle
Apr 10, 2003, 09:05 PM
Thanks. I was thinking that factor only applied to truly "empty" techs like Alphabet that don't do anything on their own except enable the next technology in the line. My numbers seem to agree now.

I'm trying to work up a spreadsheet that will show the ratings for each technology, so it will be easier to figure out which is going to be next.

Dr Elmer Jiggle
Apr 10, 2003, 09:52 PM
One more question (OK, looks like it's going to be 2).

1. Am I correct that only the direct effects of the technology are considered? For example, Sanitation directly enables building hospitals which indirectly enables the Battlefield Medicine small wonder if you build 5 of them. I'm assuming that Sanitation only gets credit for an improvement (2) and no disease (4) but not a small wonder (another 2). Similarly, Democracy wouldn't receive 8 points for doubling worker speed even though if you switch governments after learning the technology, your workers do double their speed.

2. I'm also assuming that it doesn't matter if you've already received one of the technology's benefits. That is, Magnetism would get the 8 points for trade over ocean squares regardless of whether the AI has already learned Navigation. Similarly, Greeks would assign points to Fuedalism for pikemen even though Greeks don't make pikemen.

alexman
Apr 10, 2003, 11:37 PM
1. You are correct. Only direct effects add to tech value.

2. Magnetism indeed adds 8 points even if you already know navigation. But I believe that the value of units is civ-specific, so Greece would not value Feudalism for Pikemen, just as Rome places more value on Iron Working for Legionaries.

Strider
Apr 13, 2003, 10:30 AM
I did some research on this subject once (alittle while ago).

I found that the AI's current sitution also takes effect. IE: If the AI is at war etc. it is more likely to go for monarchy than republic.

denyd
Jun 04, 2003, 04:40 PM
Dr Elmer Jiggle,

Did you ever get that spreadsheet completed?

I was beginning to make one for myself when I found this thread.

If you completed the spreadsheet, would you post / e-mail me a copy of it.

Thanks

:worshp:

RufRydyr
Jun 25, 2003, 08:09 AM
Very interesting thread. I hate it when I spend a lot of time researching the tech I think nobody will be researching and then everyone has it the turn before I finish it!

OTOH, I'm no math/stat wiz. How bout a cheat sheet?! I'd like to see a spreadsheet with All the civs in column A and beside them the most likely order they'll research. I could erase the unused civs (F10 screen) and then I could erase techs as they get them and try to go for what nobody else is researching! (Of course a utility to automatically do all that would be pretty cool, too......)

anarres
Jun 25, 2003, 08:40 AM
Looking at who is posting here, maybe one of you can answer my question:

If you have a very high tech cost does the AI carry on plugging in 30 or 40% (or even more) in to science, even though it is doing the minimum 40-turn research?

I have an intuitive answer, was wondering if anyone had anything more concrete.

thanks :)

Bamspeedy
Jun 25, 2003, 09:07 AM
My guess would be that they keep running the high science rate, even if it is still taking them 40 turns/tech. I don't think I've ever seen the AI run at 10% science. In fact, when I've milked a game and left the AI with just 1 little city in tundra/desert and gift them up to tech parity, they still run at 100% science (or very high), even though obviously with just one population 1 or 2 city they aren't going to learn modern age techs any faster than 40 turns.

PattonTwo
Jun 28, 2003, 08:18 AM
Originally posted by Bamspeedy
If you use the Civ3 Multi-Tool (save-game editor), you can find out what each civ is currently researching.


Where do you find the "save game editor"? My civ game only has a scenario editor.

Thanks.

--------------------------------------------------------------

Answered my own question. Here's the link if anyone else needs it.

http://forums.civfanatics.com/showthread.php?threadid=54689

anarres
Jun 28, 2003, 09:02 AM
Thanks Bamspeedy, that is what I assumed. A crazy piece of AI programming...

WillJ
Jun 28, 2003, 12:17 PM
Very useful thread. :goodjob:

Hmm, so the AI doesn't value techs leading to other techs? For example, steel and refining leading to combustion, and writing leading to literature, map making, code of laws, and philosophy? Interesting.

And I'm assuming that these numbers don't mean anything besides relating to the others? For example, worker job has a value of 1 because it has the lowest value, and small wonder has a value of 2 becasue it's twice as valuable as worker job (etc.)?

Also, do you know if a civ always researches the tech that has the highest value of all available techs, or do they sometimes decide to research a slightly less valuable one?

alexman
Jun 28, 2003, 02:32 PM
Yes, the numbers are relative, because the AI doesn't use them for anything but to compare one tech to another.

I initially thought that the AI always chooses the tech with the highest value (with variations between two AI civs being due to difference in the sizes of their economies and any UU), but it seems that there is a random factor involved. Still, the higher the AI value of a tech, the more likely it will be chosen.

For example, since Bronze Working has a value so much greater than all the other first tier techs, the AI almost always researches that tech first.

WillJ
Jun 28, 2003, 03:19 PM
Okay, thanks for clearing it up. :)

Ribannah
Jun 28, 2003, 05:03 PM
Originally posted by WillJ
Also, do you know if a civ always researches the tech that has the highest value of all available techs, or do they sometimes decide to research a slightly less valuable one?

There is a random factor involved in the decision.
What I do not know is whether there is a difference between AI civs as well. I could imagine it to depend on aggresiveness, favoured/shunned government etc.
But there are those times that all the AI civs are researching the exact same tech. :mad:

Ambiorix
Jun 29, 2003, 10:16 AM
Disclaimer : I've only just started to dig into the information that is revealed in the editor, so bare with me if these questions seem trivial.

- the era-advancement flag isn't listed in alexman's post. Is this not a factor for the AI then ?
- The example given of Bronze Working valued at 218 - doesn't this value also depend on the difficulty level (different cost factors) and map size (different tech rates) ?
- Strider mentions the factor of a civ being at war/peace. Did anyone look into that ?
- related to the above : is the shunned/favored government of influence ?
- the 'optional : divide by 1.5' isn't explained. Why divide by 1.5 ? It doesn't change the relative value of the techs, right ?

Thanks for the thread, alexman ! :)

WillJ
Jun 29, 2003, 10:28 AM
Originally posted by Ambiorix
- the era-advancement flag isn't listed in alexman's post. Is this not a factor for the AI then ?Originally posted by Ambiorix
- the 'optional : divide by 1.5' isn't explained. Why divide by 1.5 ? It doesn't change the relative value of the techs, right ?When alexman says "optional," he means the techs that are optional to research to get to the next age. That should explain both of these questions. (And I was confused by the optional part at first too. :))Originally posted by Ambiorix
- The example given of Bronze Working valued at 218 - doesn't this value also depend on the difficulty level (different cost factors) and map size (different tech rates) ?Maybe I'm mistaken, but I don't think the difficulty level has anything to do with tech values. As for map size, yes, that does affect the value, and alexman said it's 218 on a standard map (and with each civ producing 4 beakers per turn).Originally posted by Ambiorix
- related to the above : is the shunned/favored government of influence ?I doubt it, because I'm pretty sure the s/f government doesn't affect which governments are the favorite and least favorite of each civ to choose for themselves, but instead it affects their attitude towards other civs with that government.

Ambiorix
Jun 29, 2003, 10:52 AM
Thanks for the fast reply, WillJ, that indeed answers most of my questions.

I was thinking difficulty level plays a role in the presumption that research cost at Deity level (for example) is only 60% of what it is on Regent level. (Using the cost rates of 20, 12, 10, 9, 8 and 6 for the different levels). Not sure this presumption is correct, though. Can anyone confirm or reject this ?

If (or when) I understand the topic fully, I might have a go at that spreadsheet.

WillJ
Jun 29, 2003, 08:54 PM
Originally posted by Ambiorix
I was thinking difficulty level plays a role in the presumption that research cost at Deity level (for example) is only 60% of what it is on Regent level. (Using the cost rates of 20, 12, 10, 9, 8 and 6 for the different levels). Not sure this presumption is correct, though. Can anyone confirm or reject this ?I looked in the Editor, and you're right about that. :)

Even though difficulty level seems to affect the cost of techs for the AI, I don't think that really matters, since each tech still has the same cost value in comparison with the others, and the numbers alexman gives are only relative (meaning they don't mean anything unless compared to others). So, for example, if I'm not mistaken, Bronze Working might have a value of 109 in some situations. If it did, then Masonry would have a value of 11. So it all means the same thing, basically. If that makes any sense.

alexman
Jun 30, 2003, 12:11 AM
Nice to see a discussion going on here! :)
I have two comments:

1) As of a few patches ago, the research cost of each tech for the AI is the same for all difficulty levels. The AI gets a production bonus (or penalty) which exactly cancels the increase (or decrease) in cost due to difficulty level. As a result, in PTW, research cost for the human is different at each difficulty level. In vanilla Civ3, the research cost is constant for the human and changes for the AI though.

2) Remember, the tech values given in the first post do not depend on the actual AI research cost, but on the number of turns required for completion. That takes into account technology cost, map size, the economy of the AI civilization, and for vanilla Civ3, difficulty level.

Qitai
Jun 30, 2003, 12:37 AM
Alexman, the research cost changes is effective vanilla civ3 1.29, not PTW.

Ambiorix
Jun 30, 2003, 02:10 AM
@WillJ : actually, it does make a difference, since some techs use the #turns parameter and others don't.
Meanwhile, I also remembered that the actual tech cost also depends on the number of civ's that already discovered that tech.

If you'd want to create an exact prediction of the tech sequence in a spreadsheet, you'd have to take all that into account. To keep it simple, I'd suggest using a 'base #turns' as input. This would be the number of turns required (for the AI) to research a tech if this tech had a base cost factor of 1.
So if you see during a game that a civ discovers bronze working in 30 turns (std map, regent, ...) you'd have to divide this by the base cost factor (3) to get a 'base #turns' of 10, and use that as input parameter for further calculations.

Uhm, am I still making sense (It's early on Monday here) ? :sleep:

Qitai
Jun 30, 2003, 02:26 AM
There is no exact prediction. There is a RNG involve in the choosing of what the AI research. This article only helps to determine the probable tech that AI will research.

Ambiorix
Jun 30, 2003, 03:57 AM
I know, I meant "exact, except for the RNG". :)

Concerning the RNG, just an intuitive remark : suppose you can research two techs. One has a value of 200, while the other has a value of 50. Would it make sense to say that the chance of tech one being chosen would be 200/(200+50) ?
I suppose that could only be verified by very extensive tests, as happened for the battle-percentages. Don't see myself doing 6 million tech-research tests though. :(

Qitai
Jun 30, 2003, 04:01 AM
Well, I like to see those result myself. Because, although my impression on what the AI will research next fits quite well with Alexman's research, there are times when I think AI seems to favour certain tech which do not seems to be explained above. Of course, my sample size is only as large as the number of games I played which isn't really that large a sample size.

WillJ
Jun 30, 2003, 09:18 AM
Originally posted by Ambiorix
@WillJ : actually, it does make a difference, since some techs use the #turns parameter and others don't.:confused: It seems to me like all the things alexman listed are either constant, or are #/turns.Originally posted by Ambiorix
One has a value of 200, while the other has a value of 50. Would it make sense to say that the chance of tech one being chosen would be 200/(200+50) ?Hmm, interesting idea...

Ambiorix
Jun 30, 2003, 10:25 AM
@WillJ : what I mean is that for instance the governement factor (259/turns) will fluctuate, while for instance the Defender factor (198) will remain constant. Depending on the # of turns, government and defender factors may swap places on the wishlist of the AI.

Still think I'll use this concept of 'base number of turns'.

WillJ
Jun 30, 2003, 11:43 AM
Originally posted by Ambiorix
@WillJ : what I mean is that for instance the governement factor (259/turns) will fluctuate, while for instance the Defender factor (198) will remain constant. Depending on the # of turns, government and defender factors may swap places on the wishlist of the AI.

Still think I'll use this concept of 'base number of turns'. Oh yeah, you're right about that.

denyd
Jun 30, 2003, 11:53 AM
This is a very tough worksheet to build. I tried to do this a couple of months ago and gave up.

I decided that when I had the time, I'd try again using a VB program. That way I could use lookup tables for the UU, Civ and Game Level portions of the equation.

I wish you good luck.

denyd

Ambiorix
Jun 30, 2003, 02:32 PM
Actually, the spreadsheet is coming along quite nicely. Probably be able to finish it this week, although I'll probably give priority to my QSC-submission.

The only real obstacle left is that I'm not really familiar with all the implications of UU's. Things like 'Greeks don't build pikemen since they have the Hoplite'.
The UU is the only thing that differenciates civ's research-preferences from one another (right ?), so it would be really, really helpfull if someone could list all consequences of the UU as in the example above.

Edit : never mind, I think I can see this in the editor... Great ! :)

I'll post the spreadsheet here when it's ready - it'll take some tough debugging though, I guess.

alexman
Jun 30, 2003, 03:05 PM
Rome: Iron Working gives resource defender
Greece: Feudalism does not give resource defender (pikeman)
Babylon: Warrior Code gives non-resource defender
Persia: Feudalism does not give resource attacker (med. infantry)
Zulu: Bronze Working gives non-resource atatcker
India: Chivalry does not give resource attacker (Knight), Chivalry gives non-resource attacker
France: Gunpowder gives resource attacker
Spain: Navigation gives resource attacker, Navigation does not give unit (explorer)
Carthage: Bronze gives non-resource attacker, Feudalism does not give resource defender (pikeman)
Mongols: No change
Egypt: No change
China: No change
Japan: No change
America: No change
Iroquois: No change
Aztecs: No change
Germany: No change
England: No change
Russia: No change
Ottomans: No change
Arabs: No change
Korea: No change
Celts: No change
Vikings: No change

All this is from memory, so did I miss anything?

Doshin
Jun 30, 2003, 03:17 PM
Good work alex :) A very interesting read

One question though. Does a tech's 'value' decrease if its primary purpose becomes irrelevant. For example, if Shakespeare's Theatre has already been built is the 'wonder' value removed from Free Artistry?

alexman
Jun 30, 2003, 03:28 PM
No, as far as I could tell an obsolete Wonder does not decrease the value of the technology. However, it definitely decreases the AI's desire to trade for that tech.

The AI places a value on each tech for trading purposes, which (according to Soren) is actually different than the values listed above, but this is a whole new can of worms! :) )

Ambiorix
Jun 30, 2003, 04:42 PM
Alexman,
thanks for the list, I'll check it with what I got from the editor.

I'm having some problems classifying some of the units : a lot of units have their own flag in the editor (naval power, cruise missile, ..) and don't have the 'offensive' or 'defensive' attribute. Do all of these count as 'no attacker, no defender, no naval transport' ? I find it hard to believe that an ICBM is only valued as 2. :D Another example : it would seem logical that a helicopter (air transport) is valued the same as naval transport.
Just asking.

alexman
Jun 30, 2003, 04:57 PM
I know it doesn't seem logical, but that's what I found in my tests. It's possible I missed something, but I don't think so.

MrWhereItsAt
Jul 01, 2003, 12:13 AM
Originally posted by alexman
No, as far as I could tell an obsolete Wonder does not decrease the value of the technology. However, it definitely decreases the AI's desire to trade for that tech.

The AI places a value on each tech for trading purposes, which (according to Soren) is actually different than the values listed above, but this is a whole new can of worms! :) )

:eek: Curse that Soren and his mystical repository of information I can never find!

I was just about to ask whether the research priorities discovered here amounted to trade priorities as well.... This would help not only to choose a tech the AI was unlikely to be researching, but a tech that the AI would pay the most for!

Ambiorix
Jul 01, 2003, 04:54 PM
Decided to wait a day to unleash my Greek Hoplites, and finish this project first. :D


The resulting spreadsheet can be found below. Here's how to use it (it's quite a lengthy explanation, but the usage is quite straightforward - I hope) :

First of all, I decided NOT to work with an exact calculation of the number of turns needed for researching a tech, since that wouldn't be practical (map size, contacts, difficulty level, ...). Instead I'm assuming that you have a vague idea of how long it took the AI to research a previous tech. Let's say you think it took the Americans about 20 turns to researh philosophy, for example.

That's the start, now let's look at the spreadsheet :
column A : the tech
column B : the base cost of the tech
columns C through AJ : the factors that influence research-priority. Row 2 contains the weight of the factor.
columns AK through CH : the different civs, starting with a fictuous 'neutral civ'. This is a civ that has no starting techs and no unique unit. I just added that one if you want to see the influence of these factors on an existing civ's preferences.

Per civilization there are two columns. For instance for Americans :
column AM, row 2 : this is the 'base number of turns' - you need to fill this in, here's how : remember the example above ? Americans got philosophy in 20 turns. in column B you see the base cost factor of philosophy is 6. This means that the base number of turns is 20/6 = 3.33. Fill this in in AM2.
column AN, row 3 and further : if you want to calculate the probability of this tech, fill in 1, otherwise fill in 0.
column AM, row 3 and further : if column AN contains '1', the probability factor is displayed here.

So basically it's very simple : to stick with the example above, let's say that you want to see whether the Americans will be going for mapmaking or polytheism : open the spreadsheet, calculate the '3.33' as explained above (or just make a wild guess if you wish, this factor doesn't actually change the calculations that much), fill in the '1' for the mapmaking and polytheism rows (AN20 and AN21), et voilą : the magic numbers appear (50.41 for mapmaking and 6.41 for polytheism). :)

Now I just hope I didn't make any mistakes. If anybody wants to check the formula's, go ahead. I can provide more info on those, if they're not very clear (they're huge, but not too complicated).

All feedback welcome !

drewshark
Jul 03, 2003, 01:49 PM
@Amorbix
Thanks so much for all the work you have put into this spreadsheet. I just was playing around with it and it should be a big help. The only thing that confuses me is the base turns. Is it simply a guess as to how many turns it will take the AI civ to complete? Is the best way to guess this to click on the same tech advance and see how many turns it will take me? How do I know at what rate he will be spending on science? I realize it will not change the results too much but I was just curious if there were other ways to find out his science rate?

Ambiorix
Jul 03, 2003, 03:46 PM
Originally posted by drewshark
...only thing that confuses me is the base turns. Is it simply a guess as to how many turns it will take the AI civ to complete? Is the best way to guess this to click on the same tech advance and see how many turns it will take me? How do I know at what rate he will be spending on science? ...
Glad you like it.
Guessing the pace of the AI is the weak link. Perhaps early on in the game it's not really possible, since the AI's will be trading amongst each other, and even if you monitor them very closely, you can't really be certain whether they've just discovered a tech or traded for it. Well, maybe sometimes you can.
But later on when things have polarised a bit more, you may be in the race with one or two other civs, and then it's probably more doable to monitor how many turns there are between two tech discoveries of one civ.
Remember that the 'base number of turns' is the number of turns it would take to research a tech with base cost factor 1 (column B in the spreadsheet). so if you've monitored a civ, you still need to divide the number of turns through the base cost factor.


I'm still thinking about that RNG. Would it be possible to set up a scenario where the AI has, say, three research possibilities of about equal value, and where reloading the game would guarantee a different RNG, and so perhaps a different research choice ? With a demo-version of WinRunner or similar tool, it should be doable to automate a load& save sequence of that game, and check the research path with some other tool (thinking of Spiderzord's PTL).

denyd
Jul 03, 2003, 05:33 PM
Ambiorix,

Great table,

:worship:

I downloaded the raw numbers to a database and used the tech table to come up with a projected research order for each Civ based upon required techs and the tech value. I'm posting Spain for people to review. If it looks good to the number crunchers out there, I'll complete the rankings and post it for usage by everyone who wants it.

Since beaker production (turns to research) and the RNG aren't constant they are excluded from the calculation. It would seem that the beaker production wouldn't impact the ranking and the RNG is impossible to estimate.

:beer:

Spain
Ceremonial Burial 0.00
Alphabet 0.00
Bronze working 212.53
Warrior Code 142.53
Writing 29.20
The Wheel 28.40
Iron Working 26.27
Masonry 17.40
Pottery 14.80
Map Making 46.13
Mysticism 12.40
Horseback Riding 11.12
Literature 10.56
Mathematics 5.20
Construction 12.28
Code of Laws 4.56
Philosophy 4.27
Currency 3.60
Polytheism 2.13
Monarchy 5.43
Republic 1.23

alexman
Jul 03, 2003, 06:46 PM
Originally posted by denyd
Since beaker production (turns to research) and the RNG aren't constant they are excluded from the calculation. It would seem that the beaker production wouldn't impact the ranking and the RNG is impossible to estimate.


Actually, turns to research makes a relatively big difference. As an example, take the two extremes: 40 turns for everything, and 4 turns for everything. Here are the rankings and values of ancient-age techs for a civ without a UU in the ancient age:

4-turn rate

Bronze working 268
Warrior Code 198
Map Making 108
Monarchy 90
Writing 90
Republic 86
The Wheel 86
Iron Working 86
Masonry 75
Construction 75
Horseback Riding 70
Mysticism 70
Code of Laws 66
Currency 66
Mathematics 66
Ceremonial Burial 66
Pottery 66
Alphabet 64
Philosophy 64
Polytheism 64
Literature 48

40-turn rate

Bronze working 210
Warrior Code 140
Map Making 50
Writing 32
The Wheel 28
Iron Working 28
Masonry 17
Construction 17
Monarchy 13
Horseback Riding 12
Mysticism 12
Literature 10
Republic 9
Code of Laws 8
Currency 8
Mathematics 8
Ceremonial Burial 8
Pottery 8
Alphabet 6
Philosophy 6
Polytheism 6

As you can see, the rankings are considerably different in these two extreme cases, especially for optional and government techs.

EdwardTking
Jul 13, 2003, 11:58 AM
I have the Oracle and the Hanging Gardens so I held off researching Music Theory and Steam Power that would
obsolete these wonders.

Does the AI similarly consider the obsoleting factor
of technology?

alexman
Jul 13, 2003, 12:35 PM
No, the AI with the Great Library gladly researches Education. :(

Qitai
Jul 15, 2003, 10:52 PM
Throw in the variable that you research different tech at different rate and that complictes things!!!!

DaviddesJ
Jul 22, 2003, 02:32 AM
Does it matter whether the AI can actually build the unit? E.g., if the AI has Iron Working, but no source of Iron, will it still place a high value on Feudalism for Pikemen?

alexman
Jul 22, 2003, 09:18 AM
No, it does not matter.
Will you come up with an RCP-like strat using this article too now?
;)

Nor Me
Jul 22, 2003, 11:42 AM
Originally posted by alexman
No, it does not matter.
Will you come up with an RCP-like strat using this article too now?
;)

I've been wondering how to make the best use of unbuildable UUs for weeks now.

I take it you, of all people, would interested in only religious AIs beelining to Monarchy.

alexman
Jul 23, 2003, 10:34 AM
That's a great idea, Nor Me. A "priest" unit, available only to Religious civs with Polytheism, for example?

It would be flagged as a defender, would require uranium, and would upgrade to the Guerilla, to ensure that the unit is never actually buildable.

Religious civs with Mysticism would almost certainly go for Polytheism then. Nice thinking! :)

SirPleb
Jul 24, 2003, 06:07 PM
Originally posted by Ambiorix
The resulting spreadsheet can be found below.
Ambiorix, I used your spreadsheet while playing GOTM21 and it is a great help, thank you!!!

Ambiorix
Jul 26, 2003, 03:35 PM
Originally posted by SirPleb
Ambiorix, I used your spreadsheet while playing GOTM21 and it is a great help, thank you!!!
It's just a little in return for the wisdom you keep spreading around.
Let's just say you can use it for free as long as you don't demand tribute for all the things I learned since Gotm18. :D

Qitai
Jul 27, 2003, 06:08 AM
Ambiorix>I just checked the spreadsheet. Did you factor in the fact that the min research rate is 4 and max is 40 by default? Or does it matter at all?

Ambiorix
Jul 27, 2003, 07:15 AM
Originally posted by Qitai
Ambiorix>I just checked the spreadsheet. Did you factor in the fact that the min research rate is 4 and max is 40 by default? Or does it matter at all?
No, it's not factored in. I don't think it matters much.
It might change the 'base number of turns' (BNT) factor a bit, but not that much, and the BNT will only influence the priorities if it swings wide (like 30 instead of 3).

Since the min and max rate is adjustable in the editor anyways, I'd like to keep this out of the spreadsheet.

Ambiorix
Jul 27, 2003, 08:07 AM
I've added a second page to the spreadsheet that contains a graphic comparison of how the relative importance of some techs change when going from a slow research to a fast research scenario. It shows how some techs dive bomb in importance compared to others.
First page remained unchanged.

It just makes me wonder what goes on in the minds of the programmers at Firaxis. I mean, who thinks of creating that kind of priority-relativity ? Why not something lineair ? :confused:

anarres
Jul 27, 2003, 09:38 AM
Looks good Ambiorix. :thumbsup:

One small point: Robotics has a circular reference (cell F86).

Ambiorix
Jul 28, 2003, 03:38 PM
Originally posted by anarres
One small point: Robotics has a circular reference (cell F86).
On the second page ? I also get a warning when opening the file, but F86 is empty. Do you mean F84 ?
In any case, I wanted to copy just the numbers from the first to the second page, but the formula's came along.
Anyone know how I can copy-paste just the result of a calculation, losing the formula ?

Snaproll
Jul 28, 2003, 03:51 PM
Edit->Paste Special->Paste Values

Ambiorix
Jul 29, 2003, 12:37 PM
Thanks Snaproll,

here's the version with that little annoyance fixed.

alexman
Nov 21, 2003, 08:29 PM
A small update with new values for Conquests:

Cannot be traded: 149/turns
Bonus tech: 0
Reveal Map: 0
Sacrifices: 0

And for Bamspeedy: luxury, bonus, and strategic resources have the same value (16), even if these are required by units and improvements.

alexman
Nov 30, 2003, 11:45 PM
Another C3C update:

Units that require resources are now valued by the AI as much as units that don't require resources. This has a major effect on the research preferences of the AI in C3C compared to PTW.

Edit: Nevermind. My C3C test was flawed

JimmyNeutron
Dec 08, 2003, 06:09 AM
This is great for some but when i open the spread sheet all i see is numbers on a page. I guess I should ask my kids how to use these spread sheets...LOL

TimBentley
Oct 28, 2004, 07:36 PM
I just noticed that the spreadsheet never has a value higher than 1 for the spaceship components. I assume that's a mistake? And while I'm considering updating it to Conquests, what does "Other tech" mean? And I don't see any mention of flavors. What effect do they have?

Ambiorix
Nov 04, 2004, 06:11 PM
I just noticed that the spreadsheet never has a value higher than 1 for the spaceship components. I assume that's a mistake?
Oops, that's a bug indeed - fortunately it's not a factor with big impact. :blush:
And while I'm considering updating it to Conquests,
Too late - I've updated it myself ! :D See attachment below. :)
I'm assuming Alexman's values from his first post are stil valid. I've used the editor to track all features that changed. I'm pretty sure I've covered all changes for C3C, but if anyone wants to do some checks, it'd be much appreciated.
An interesting sidenote : although the AI values wonders like the Temple of Artemis, they don't take into account the extra unit that they make possible to build.
what does "Other tech" mean?
I don't know what you mean. where do you see 'other tech' ?
And I don't see any mention of flavors. What effect do they have?
'Flavors' are explained in the Help file of the editor. Since they're not used in a standard game, I haven't included them in the calculations.

Enjoy the update ! :)

Edit 06/11/2004 : removed the attachment, since there's a newer version a few posts further below.

Grille
Nov 04, 2004, 06:16 PM
Enjoy the update ! :)

:drool:
Yay!

TimBentley
Nov 04, 2004, 06:31 PM
I don't know what you mean. where do you see 'other tech' ?
On Alexman's first post, right under improvements.

Thanks for the update! :goodjob:

I decided to test the spreadsheet, and I realized how strange it is that Korea has cannons available, but can't build them, that the javelin thrower is considered both offensive and defensive and the bowman is only offensive, and other similar things.

Ambiorix
Nov 05, 2004, 10:03 AM
On Alexman's first post, right under improvements.

You're right - I overlooked that before. :hmm: Don't see anything in the editor that corresponds to it... Alexman, can you explain ?
I think I remember vaguely something about a scenario where you first need to research one tech before being able to research a certain other one... so it might be something scenario-related only. Does this make sense to anyone or am I dreaming ? :confused:
In any way, it's currently not in the spreadsheet - shouldn't matter too much because the weight of 'other tech' is only 1, apparantly. Still, if someone can tell me to which civ-advances it relates, I'll gladly put it in.

alexman
Nov 05, 2004, 10:23 AM
A tech gets 1 point for each 'other tech' of which it is a direct prerequisite.

Flavors are more complicated than other things in the list, so I have not included them here. However, if you want more information, you might want to take a look at the AU AI research thread (http://apolyton.net/forums/showthread.php?s=&threadid=103616).

Ambiorix
Nov 06, 2004, 05:15 AM
Thanks, that clears it up.
Update below ! :)
(Interesting link you gave, btw).

Edit : added the file to the Tools forum as well.

WackenOpenAir
Jan 05, 2005, 06:50 PM
Does anyone know what is still true of this in the latest version of C3C ?

Slax
Jan 14, 2005, 04:55 PM
Anyone know why I get no calculated values under the civ names? The formulas are there, but they don't calculate any values. I tried Calculate Now button in the Options window, but this did not work. I also tried two other versions of this spreadsheet. No values are calculated.

Ambiorix
Jan 15, 2005, 08:53 AM
Anyone know why I get no calculated values under the civ names? The formulas are there, but they don't calculate any values. I tried Calculate Now button in the Options window, but this did not work. I also tried two other versions of this spreadsheet. No values are calculated.
Did you fill in the necessary fields ? (See post #48 in this thread).

WackenOpenAir
Jan 15, 2005, 09:32 AM
This spreadsheet has served me well in my space race. :goodjob:

Slax
Jan 16, 2005, 08:53 AM
Did you fill in the necessary fields ? (See post #48 in this thread).

Ah-ha! Thats must be the problem! I never read that message.

Thank-you.

mikezang
Mar 31, 2005, 10:57 PM
Does anyone give me some User's guide for using this file? I downloaded it, but I don't know how to use it, where should I input and which I can know the next reserach by AI?

Ambiorix
Apr 02, 2005, 09:43 AM
Does anyone give me some User's guide for using this file? I downloaded it, but I don't know how to use it, where should I input and which I can know the next reserach by AI?
Ahem... read a few posts back... ;)

mikezang
Apr 04, 2005, 03:14 AM
What difference is it if I input 1 or 2 in AS3, thought the probability will be double.

TimBentley
Aug 27, 2005, 08:08 PM
If a technology allows an improvement or wonder that allows city size 2 or 3 (ie aqueduct, hospital, Shakespeare's), it adds a value of 16 (in addition to the 2 or 6 from the improvement or wonder). If one improvement allows city size 2 and size 3, it will still add only 16, but two improvements would add 32.

AutomatedTeller
May 15, 2006, 10:35 AM
There is something else here - I have been playing some low level games against persia and ottomans, and ottomans *always* beeline to monarchy, CB->Mysticism->Polytheism and persia seems to go for Iron Working much sooner. And they start with the same techs and have the same characteristics

WackenOpenAir
May 15, 2006, 05:59 PM
Ottomans for monarchy is probably coincidence.
Persians go for Iron working because it enables their special unit.

DaveMcW
May 16, 2006, 12:42 PM
I noticed the Ottoman monarchy beeline too. I think it's hard-coded into the Ottoman AI.

Iron working is a pretty valuable tech according to the spreadsheet, so it's not surprising Persia picked it.