[BTS] AI Strategy - war

5b) AI production: In the industrial era, my production absolutely skyrocketed until it was several times as large as that of the next best AI. Many factors contributed to this (playing Frederick, having Assembly Plants, managing to build the Three Gorges Dam, having a large empire), but I still got the impression that the AI didn't give production a high priority. Due to this, they were never able to build a meaningful amount of tanks - tanks are a very powerful unit which can't be gotten by upgrading others, so tanks are the point where having high production translates directly into military power. However, the only two enemies I fought that had Industrialism managed to field exactly one tank each (Gilgamesh may have had some more since he had this war against his neighbors before I reached him).

*nod*, the AI still doesn't go exponential enough in the modern era. I find that I tend to have a handful of specialized high-production cities (that use mines and the like), which then build wonders that leverage that high production to make it ridiculous production (national epic for a unit factory, ironworks for a wonder factory, etc).

The AI is horrid at city specialization.

5c) Tech Trades: The AI doesn't see that making a lot of "bad" trades can add up to a substantial advantage. Example: An AI could trade a technology to five other AIs, but doesn't do so because none of those have anything to offer except 1000 gold each, and the technology is worth much more. So the AI won't trade its tech. Then the human player comes along, researches the same tech, and trades it to all five AIs for 1000 gold each. As a result, the human player now has 5,000 gold more, and probably better diplomatic modifiers with five other civs, whereas the AI who researched the tech first has neither.

Part of this is that the 5th AI shouldn't value the tech that highly any more.

The value of trading away a tech to an infinite number of clients should be roughly the value of researching the tech. But that isn't how the AI values technology.

Suppose we revalued technology to be worth (1/2^n) times it's lightbulb value, where n is the number of empires that have the technology.

So if you research a technology worth 1000, you can trade it away for 500 gold to the first person, 250 to the 2nd person, 125 to the 3rd person, etc.

With a large number of other players "on side", you could tech up using only their gold paying for it -- they would also get the technology, however.

In the case that two civilizations know different sets, we could use the average of what each civilization thinks it is worth.

Dunno.

5d) Resource trades and Corporations: How does the AI value resources that it trades to me for use in my corporations? I get the impression that the AI gives such resources very little value. They usually give me several resources for one of mine, or they add gold per turn to the deal. This is not in proportion to the use I get from these resources when I have an empire with well-spread corporations - or am I missing something?

Yes -- I think the AI's resource value code is still stuck in the pre-corporation model, where a 2nd resource isn't worth as much as the 1st by orders of magnitude.
 
Yes -- I think the AI's resource value code is still stuck in the pre-corporation model, where a 2nd resource isn't worth as much as the 1st by orders of magnitude.

I'm not sure about that. The AI does seem to value resources that offer a lot for your corporation higher. I have experienced that an AI would ask more for a resource once I have more cities with the corporation that benefits from that resource. The AI would renegotiate the deal and I'd have to pay more.

It could of course be a coincidence, but I really expect there to be some valuation formula for the AI where the value is dependent on the number of cities that hold a corporation that benefits from the resource.

I'm not sure whether the valuation is correct, but do remember that there are many costs to a corporation: a great person, various technologies that need to be beelined, gold and production for spreading the corporation and most of all gold per turn for maintaining the corporation.

Of course, once you've installed the corporation(s), there can be great benefits, but there is a significant investment. If buying resources from the AI's is expensive, then that cost plus the corporation maintenance could become too much to make it interesting. Now there is a benefit for the seller of the resource (gold per turn) and a benefit for the buyer (more corporation benefits). It would require a significant analysis whether both parties benefit similarly.

By the way, the rest of Psyringe account of his game is interesting to read. I never use the vassal option myself because I don't like how it is implemented in the game (hard to get rid of a vassal) and also because I don't like the way the AI handles it. It seems that the AI cannot really adjust its empire for the extra maintenance cost of the vassals. I don't think it understands that an empire cannot maintain an unlimited number of vassal cities without going bankrupt. Also a single humongous army from a huge AI would be far more effective that 6 small armies from an AI + 5 vassals. There is no coordination of forces in the second case. And I guess that it is really too hard even for the betterAI team to make the various AI's coordinate their forces.
 
Regardind the resource valuation: It's definitely difficulr to design a resource valuation formula that is working well. If there already is one in effect, I'm curious about its workings.

What seemed odd to me was that the AI would continually offer gold together with the corporation-relevant resources, for one resource of mine. Since I already had 12 spare dye resources, and was trading dye to anyone who wanted it, the resource had about zero value for me. Of course, the resources that the AI traded to me had about zero value for the AI too. So I was trading something that wasn't worth much for me for something that wasn't worth much for the AI that traded it away. The "seller-value" of both resources was almost zero - seen from this perspective, the trade appears fair, and there's no need for the AI to throw in extra gold (something that the AI really *could* make use of instead of trading it to me).

Of course, this "seller-value" isn't the only relevant factor in the equation, there's also the point of "buyer-value": How much is the traded resource worth for the civ that gets it? Personally I'm still uncertain how these *should* be valued though, it's certainly complicated.

Side note: Keep in mind that I was playing a gigantic game with 34 civs - the size of the map and the number of resources might influence the availability and actual value of resources to a point where formulas that work well in stock setups can't adjust to it any more.

Regarding the coordination of AI war efforts: There is this "We would like you to attack city x" option in diplomacy. If this is actually working, then it might be possible to hook into the respective functions in order to have an AI master coordinate war plans with his vassals. That's, however, supposing that the feature *does* indeed work, and I'm not so sure about that.
 
Regardind the resource valuation: It's definitely difficulr to design a resource valuation formula that is working well. If there already is one in effect, I'm curious about its workings.

What seemed odd to me was that the AI would continually offer gold together with the corporation-relevant resources, for one resource of mine. Since I already had 12 spare dye resources, and was trading dye to anyone who wanted it, the resource had about zero value for me. Of course, the resources that the AI traded to me had about zero value for the AI too. So I was trading something that wasn't worth much for me for something that wasn't worth much for the AI that traded it away. The "seller-value" of both resources was almost zero - seen from this perspective, the trade appears fair, and there's no need for the AI to throw in extra gold (something that the AI really *could* make use of instead of trading it to me).

Of course, this "seller-value" isn't the only relevant factor in the equation, there's also the point of "buyer-value": How much is the traded resource worth for the civ that gets it? Personally I'm still uncertain how these *should* be valued though, it's certainly complicated.

As far as I know, Civ uses a purely buyer-based valuation. So the value of a resource is purely based on the use it has for the buyer. I guess, the AI didn't have your dyes yet, so they were very valuable to them as a luxury resource. Resources used purely for corporations (which is true for any 'second' version of a resource) aren't valued by the game as highly as a happiness increasing resource. So that's why the game values the first version of a resource higher than the second for the buyer.

Side note: Keep in mind that I was playing a gigantic game with 34 civs - the size of the map and the number of resources might influence the availability and actual value of resources to a point where formulas that work well in stock setups can't adjust to it any more.

I don't know if the xml-values for various variables were adjusted for this gigantic map. Many, many things in civ are map size dependent. The increase in production/money/research/culture per corporation-resource for instance is also map size dependent.

Regarding the coordination of AI war efforts: There is this "We would like you to attack city x" option in diplomacy. If this is actually working, then it might be possible to hook into the respective functions in order to have an AI master coordinate war plans with his vassals. That's, however, supposing that the feature *does* indeed work, and I'm not so sure about that.

Even if this would work well, then still 6 independently controlled forces don't work as well as 1 centrally controlled force. Even if they were controlled with human intelligence. That's one reason why one strong army is better than 6 weaker forces.

For example: one strong force might lead to three dangerous 30-unit SOD's. The six individual armies would individually only hold 15 units which might also be divided over several groups making them easy to defeat individually. Next to that 4 of these 6 groups hold obsolete units because these AI's haven't upgraded there troops yet because of lack of money while other civilisations in the vassal-group have left over money.

The AI just doesn't go for optimal individual power. It always accepts a surrender even if the rest of the conquest could make it a lot stronger in the long run.

It's all just the result of the increase in efficiency with size.
 
As far as I know, Civ uses a purely buyer-based valuation. So the value of a resource is purely based on the use it has for the buyer. I guess, the AI didn't have your dyes yet, so they were very valuable to them as a luxury resource. Resources used purely for corporations (which is true for any 'second' version of a resource) aren't valued by the game as highly as a happiness increasing resource. So that's why the game values the first version of a resource higher than the second for the buyer.
Yep, but I'm not sure whether the valuation is working well. As an extreme example: Let's say I'm trading cows to a civ that doesn't have them yet, but that also has no unhealthiness in its cities. In return I want silver (which I already have) for my Mining Inc corporation, which I spread to five cities, all of which have a fotge, factory, power plant, and throw an ironworks and hero epic for good measure (actually it just occurred to me that I don't know whether hammers gained through corporations are affected by those buildings, I'll have to check that). Asuming the AI trades as I expect it to, is it really a fair trade if the AI gives me the silver and some gold per turn on top of it for my health resource that currently changes nothing in its empire?

Granted, that's an extreme example and I don't even know whether it actually reflect current AI behavior. And I didn't yet take into account the costs to establish and maintain a corporation (a good point that you raised). But it shows that resource valuation may be worth discussing. :) However, we should probably do that in another thread, since it's not really on-topic here ... (my fault, I kind of got carried away when I wrote my report).


I don't know if the xml-values for various variables were adjusted for this gigantic map. Many, many things in civ are map size dependent. The increase in production/money/research/culture per corporation-resource for instance is also map size dependent.
The map size definitions are from a mod which, as far as I can see, extrapolated the values from those of other map size. Some may have been missed though and yet some might need some tweaking. For example, I already tweaked the research speed - in my previous games on XXL maps with 34 civs, space ships were regularly built in the 1700s. The scaling of the research speed simply didn't take into account that with 34 civs, there is a lot more tech trading (even without tech brokering) - it's much more likely that an AI can trade it's new tech for three or four others, which basically multiplies the benefit of each beaker put into researching it.

Anyway, I'm digressing again. ;) What I'm saying is that my game setup is a work in progress and that it's very possible that some values still have to be adapted. I'd be very grateful for suggestions. :)

Many values autoscale (for example, I think I got only 10% of the standard effect of corporation resources ... which might actually explain why the AI gave them so little value ...), but the autoscaling isn't always perfect.
 
Yep, but I'm not sure whether the valuation is working well. As an extreme example: Let's say I'm trading cows to a civ that doesn't have them yet, but that also has no unhealthiness in its cities. In return I want silver (which I already have) for my Mining Inc corporation, which I spread to five cities, all of which have a fotge, factory, power plant, and throw an ironworks and hero epic for good measure (actually it just occurred to me that I don't know whether hammers gained through corporations are affected by those buildings, I'll have to check that). Asuming the AI trades as I expect it to, is it really a fair trade if the AI gives me the silver and some gold per turn on top of it for my health resource that currently changes nothing in its empire?

Granted, that's an extreme example and I don't even know whether it actually reflect current AI behavior. And I didn't yet take into account the costs to establish and maintain a corporation (a good point that you raised). But it shows that resource valuation may be worth discussing. :) However, we should probably do that in another thread, since it's not really on-topic here ... (my fault, I kind of got carried away when I wrote my report).

I also don't know whether the BetterAI programmers wish to improve the valuation algorithms for the resources. It could be considered an AI-issue...

I just made a remark on this issue because it's just not so clear on how to improve them. Your other issues are much clearer as it is for instance clear that an AI shouldn't take another vassal when it would bankrupt it. Resource valuation is more subjective and I wanted to make that clear. For example, in civ3 resource valuation by the AI was based on the amount of usefulness the resources offered to the nations that were trading. This meant that a civilisation with 3 times as many cities had to pay three times as much for a resource because the usefulness of the resource effected 3 times as many citizens. While I consider this a perfectly fair mechanism, it was frowned upon by a majority (or a loud minority) of the community. Typically the human player was the one with the bigger empire and didn't think it was fair that they had to pay 3 resources to get 1.

What is fair? It's very hard to answer that, not only because it's hard to calculate the values of all the effects of a corporate resource, but also because people don't have the same notion of fair.

The map size definitions are from a mod which, as far as I can see, extrapolated the values from those of other map size. Some may have been missed though and yet some might need some tweaking. For example, I already tweaked the research speed - in my previous games on XXL maps with 34 civs, space ships were regularly built in the 1700s. The scaling of the research speed simply didn't take into account that with 34 civs, there is a lot more tech trading (even without tech brokering) - it's much more likely that an AI can trade it's new tech for three or four others, which basically multiplies the benefit of each beaker put into researching it.

Anyway, I'm digressing again. ;) What I'm saying is that my game setup is a work in progress and that it's very possible that some values still have to be adapted. I'd be very grateful for suggestions. :)

Many values autoscale (for example, I think I got only 10% of the standard effect of corporation resources ... which might actually explain why the AI gave them so little value ...), but the autoscaling isn't always perfect.

I think I have seen that mod, but wasn't it created before the BTS expansion was created? Maybe it was later updated. I don't know exactly what you mean with autoscale. I do know that various modifiers are based on the same xml-values, so if you change the value to balance some element in the game, then you're immediately balancing some other elements too. Sometimes that is a good idea, sometimes these modifiers shouldn't be exactly the same. But it is a known fact that this game doesn't perfectly scale with map size (and game speed).

For the corporate resources: If in your game on the superhuge map with 34 civilisations, you'd expect that the corporation founding civilisations would control twice as many resources as on a huge map (at the moment of founding corporations which is a moment when some civilisations have already been destroyed), then I'd think that the effect of a single entity of a resource should be halved both in production (hammers, culture, gold, science) and in upkeep (gold upkeep in the cities). The valuation by the AI should also be halved (as the effect is halved).
 
Psyringe:

Thanks for the very detailed report and analysis! It's very helpful to get that kind of detailed report back and you highlighted several important questions.

On the question of stranded units on small islands, there are two related issues both surrounding the behavior of transports:

1. Picking up surplus troops stranded on islands: My idea here is that if the AI has many idle transports hanging around, some of these transports could search for stranded troops. The AI will send empty transports to cities with enough extra troops to pick up, but it can take a long time for them to get around to it. The AI simply doesn't pick up troops off empty islands yet at all.

2. Large transport flotillas stuck on islands: The AI is programmed to pull all its transports back to its main area, but there are a couple of ways they can get stuck. This one is tricky, I believe what is happening is that the AI ships are staying to try to pick up a unit that isn't getting on the ship because it's filling in on city defense. I'm still not sure yet though.
 
Is there a special code for units in recently captured cities in resistance? It apppears that the attacking stack in a resisting city moves out of the city only after the resistance ends, which can be not the optimal behaviour.
 
Good point. The AI is indeed waiting too long to conquer the next city.

edit: ...but I think it is some sort of healing behavior.
 
Well, here's some suspicious stuff (nothing modded except the terrain graphics and a custom Japanese leader).

I am at war with Qin. My slightly outdated Rifles are advancing to Nanjing. The situation on the previous move was the same as now:

Spoiler :
attachment.php


His defences at Nanjing, as you can see, are weak (12 str Grenadier, Infantry at 7.2, Knight at 5.7 and a cat to be exact); meanwhile, here's his troops at recently conquered from the (weak) Khmer Angkor Thom:

Spoiler :
attachment.php


Ankgor Thom had been captured not on the previous turn, so Qin's Infantries should have some movement points yet.

He can reach Nanjing with his infantries and reinforce it - Angkor Thom is in no danger - yet on the previous IBT he made no movements, and I razed the city. He agrees to peace next turn.
 

Attachments

  • Civ4ScreenShot0559.JPG
    Civ4ScreenShot0559.JPG
    322.4 KB · Views: 452
  • Civ4ScreenShot0560.JPG
    Civ4ScreenShot0560.JPG
    323.6 KB · Views: 447
There is something I've never understood in the AI behaviour when it is in defense.
When the AI is completely inferior in power, sometimes the AI has all it cities gladly in research as if it don't care of what it will happen to it.
In those conditions does the optimal behavior is not to change all cities in producing troops?

Armand.
 
In those conditions does the optimal behavior is not to change all cities in producing troops? Armand.

It so much depends on context. Sometimes the AI needs to race to a required defensive tech like machine guns. If you have save's of this behaviour you have seen, it would be great to post them.

Cheers.
 
Turn on cheat code. Alt and mouse over the territory.

The AI strategy is probably "catchup" (I think that is the name) -- it considers itself so far behind, tech-wise, that it's only chance is to pump out research and hope not to be attacked until it catches up.
 
I was thinking, humans have that "Why don't you attack..." option for AIs in a mutual military struggle. Do the AIs make use of this amongst themselves? It could be useful to have the AI coordinate attacks with other AIs, but it might be difficult to say which cities should be attacked by whom (if there's a city in a good spot, one AI might not want the other to get it). Same goes for research and vassals, I guess (why don't you research...).
 
I was thinking, humans have that "Why don't you attack..." option for AIs in a mutual military struggle.

Yeah that is really high level stuff. That "why don't you attack" option actually works? It never has for me but could be wrong.
At this stage what exactly happens in the AI's mind? Once the warplan is in effect and war declared, units form into stack's and other AI missions, and they decide an appropriate target location from a unit perspective. This is information is not fed up the chain to a "higher brain" is it?

In the case where other AI allies or vassals join in, they will help the master with the war but not strategically. Units will flow into the area of warfare and decide targets locally. Occasionally, these cooperative efforts actually do coordinate quite well, but there is no "high level" commitment to it.

In other war games like "Rise Of Nations" a few years ago, you could point and click a location on the map, then go and tell your AI partners to move troops to that location. They would do that without question and then begin attacking at that spot whatever they could find. Unfortunately, it didn't work well because the AI troops would get distracted along the way with other threats, and the whole initiative would dissolve away and very few if any troops would arrive at the scene.

Cheers.
 
Back
Top Bottom