What will the AI research next?

alexman

Ancient Geek
Joined
Feb 28, 2002
Messages
792
Location
Mohawk
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]
 
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.
 
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 ;) )
 
Is the worth of a "naval unit" reduced on a panenga (i know i spelled it wrong)?
 
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.
 
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.
 
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?
 
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.
 
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....
 
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?
 
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. :)
 
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.
 
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.
 
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.
 
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.
 
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:
 
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......)
 
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 :)
 
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.
 
Top Bottom