A Better AI.

Great handicap changes Blake! I will wait untill next version to use, but I think now I can come back to Noble! :crazyeye:
 
I've been playing a long game with the 1-1 build. I say long for two reasons: First, nobody killed me in the Ancient Era. Second, the time it takes between turns is incredibly long and painful. Known problem, but the best build available, so I'm soldiering on, as one might say.

My goal in this game was to stay alive long enough to see whether someone could build the Space Ship. In that, I've been successful. It's a Terra map, so I was able to go over and conquer some indigenous peoples and establish a large presence in the New World. Doing so, I've put myself into second place on the score chart (though nowhere on the power chart). It's 1967 and the game is still going.

Here's what I've noticed. The changes that reduce long distance attacks make a big difference in the game. Because I had two peaceful immediate neighbors, Cyrus and Frederick, I didn't get attacked at all. I was free to turn down demands of Alexander, Montezuma and Tokugawa; they all got annoyed with me, but I guess was too far away to declare war, even though I was dead-last on the power chart for much of the game.

Long-distance wars were never a great threat. However, there was some respect one had to pay to these distant agressive types, otherwise, they could send enough force to cause a serious distraction. They might even enlist others in a war against you. Now they can be ignored with impunity if they aren't on your border, even if they have vassals that border you. (Of course, if they are on your border, they try to kill you in the Ancient Era.)

On a different note, I've seen some interesting AI-AI behavior. There haven't been many wars in this game, but those have resulted in lots of vassalization. I think the strong defenses that the AIs now put up make it unlikely that one AI will obliterate another in war; capitulation is the end of each war. What I've seen is vassals switching back and forth between the two strongest AIs. Most interesting, Frederick, who was for a long time a vassal of Cyrus, suddenly broke off and took Montezuma as a vassal (he'd been offering himself up to any taker). It has been entertaining -- everybody was at war but me for a while -- but not definitive. I don't think anybody will see an AI win a Domination victory under this build.

I should have sent somebody into Frederick land, so that I can observe what's going on there fully. From my border position, I can see tons of City Garrison I units in his cities -- 7 Marines and 6 Infantry in Cologne. What I don't see are any Panzers. He has oil and iron. It appears to be a strong bias toward defense that's causing this odd allocation.

Finally, with regard to Cuture Victory. It does seem to be the new Space Race. Only Cyrus is building the Space Ship in this game, but I don't think he's going to make it by 2050. Frederick and (I think) Mansa are doing the Culture thing. Although they've been involved in a number of wars, I don't think anybody has tried to go in and raze one of their culture cities. I think the AI needs to know that it should try to do that. I'm going to have to knock out one of Frederick's or he'll win soon. (EDIT: Frederick won in 1978.)

The game strategy that presents itself to me: 1) kill any agressive neighbors; 2) raze top cultural cities; 3) win any way you like. Not that I'm saying this is necessarily easy...

All-in-all, the 1-1 build is a very interesting build. However, even pending bug fixes aside, I don't think it's quite the definitive build that some have suggested it is. Still, it is great work!
 
I've made a new set of handicaps, these are actually tuned for the NEXT build rather than the 1/1 build but I'm going to attach them to this post now (I'll upload separately to Sourceforge after the next build is out which should be today or early tomorrow).

AI combat bonus against Animals reduced from 70% to 40% on all levels.
AI combat bonus against barbs reduced from 40% to 25% on all levels.

AI pays 50% for unit upgrades on all levels (vs decreasing to 5% at Deity)
AI pays 50% for unit supply on all levels (vs decreasing to 10% at Deity).
AI pays 80% inflation on all levels (vs decreasing to 20% at Deity)
War Weariness increased (on Deity now 50% War Weariness instead of 20%).
Growth bonuses reduced (on Deity requires 80% to grow instead of 60%).

Prince: Free explore unit removed.
Monarch: Free worker removed.
Emperor: Free worker removed.
Immortal: One less free worker.
Deity: One less free worker.



If you wonder at taking away the free worker - the AI is now very good at training an early worker (including going worker first when appropriate) so it really doesn't need the freebie worker and this will also make early wonders less unattainable for the human.

Other bonuses are left alone, for now anyway. The aim is eliminating the worst exploits of the AI which a human simply cannot do (ie super early wonders, massive unit upgrades, endless war etc).

I don't think these handicap changes are necessarily a good idea. Just saying that will of course impress no one so I'll try to explain what I mean.

First a point of reference.

In civ3 a guy once tried a game at a super deity level where the cost factor of the AI for research, building and growth was reduced to 10%. So AI cities grew every turn, could build buildings in one to three turns and units in one turn, technologies were developed at a frantic pace. Really ridiculous and completely unwinnable, right? Wrong!

The AI had quickly finished building all of the buildings in its cities and then started building units. And it got many units, huge amounts of units. So many units as you've never seen before, each map spot was filled with dozens and dozens of them. And then, its research halted under the massive upkeep costs of these units.

The player playing under these conditions was an accomplished civ3 veteran and knew about all of the tricks and managed to slaughter through the hundreds and thousands of AI units to finally win a conquest (or domination, I forgot) victory.

Now, such a crazy and dramatic result will not be the result of these changes. But on the other hand, the AI will build far more units at deity level than at noble level. The unit upkeep costs are lower at deity level, so it will probably not kill its economy by buildings units. But when the AI reaches a certain point of development, say feudalism, it will have to upgrade its larger number of archers to longbowmen. And there will be no cost reduction compared to noble level for this upgrade. Also, the deity level economy will not be really better when it reaches feudalism than the noble level economy. It will have researched feudalism a lot faster, but when you compare the moment in both games where the AI reaches feudalism, then the economic development of its lands and cities will not be really better at deity level (exception city and civic upkeep costs are lower at deity level resulting in a better economy). So if the deity AI has to upgrade 4 times as many archers to longbowmen, then it will take the deity AI far longer to do so than the noble level economy. I don't think you want an AI opponent that takes longer to upgrade its army at higher difficulty levels.

The larger AI armies of deity level will also move into enemy territory during wars. Because of equal unit supply costs per unit of deity and noble levels, this will result in a situation where wars will slow down the AI far more at deity level than at noble level. Its units abroad will cost the deity level AI a lot more just because it has more units abroad. I don't think you would want a situation where wars slow down the AI more at the higher difficulty levels.

The deity level AI will fight battles with far more units than the noble level AI. As war weariness is linked to losing units and killing units in foreign territory (and some other things of lesser importance), the diety level AI will suffer a lot more war weariness if it goes to war than the noble level AI if you keep the AI war weariness modifiers the same at all difficulty levels.

I personally think that the unit supply cost, the unit upgrade cost and the war weariness modifier should be scaled to the size of AI armies at the various difficulty levels. If not, the large armies of the AI at high difficulty levels will hurt its economy a lot when upgrading or when going to war and the AI will get war weariness a lot sooner at the high difficulty levels.
This means that they could be scaled down somewhat from the extremes seen in the original Warlords 2.08 CIV4HandicapInfo.xml file. However, if the AI bonus on these modifiers doesn't scale with army size, then the AI will suffer at the higher difficulty levels.

I have a neutral opinion about the other changes to the AI handicaps at various difficulty levels.
 
While I would generally be on soooo's side with that general arguement, Ive got to disagree in this case.

In years past, game developers gave the AI production bonuses to correct thier inability to code a smart AI.

In this case, as the AI is smarter, to keep balance, there is a need to reduce the bonuses, as the AI no longer needs so many as before to still compete at the same game level.

So, instead of Diety war being "kill horder," it now "kill lots, but be smart about it."
 
I have to agree with roland that at higher difficulty level changing bonus to AI will seriously criple them. Especially those 3

AI pays 50% for unit upgrades on all levels (vs decreasing to 5% at Deity)
AI pays 50% for unit supply on all levels (vs decreasing to 10% at Deity).
AI pays 80% inflation on all levels (vs decreasing to 20% at Deity)

I haven't played 1-1 build yet, don't know how smarter AI got. But under 12-21 build if those effects went in. I can actually dominate AI on tech research on Deity so I can have more advanced units than AI coupled with the fact AI can support less units, its alot easier to win. In my previous game, It was a tough game all the way through renaissance, because I was 3 or 4 techs behind leading civs. But I still managed to catch up and become #1 in industrial age. IF the ugrade and supply cost is increased, I probably could dominate AI around late medieval age.

The war weariness change is definately a welcome change though. It was extremly annoying at times where AI loss a dozen units to you and they don't have any attacking force to threaten you. yet they just refuse peace.

I would suggest to leave the 3 above AI bonus as it was on higher difficulty levels (emperor and up). If the game is too tough because AI got alot smarter, we can just play at lower difficulty thats all.
 
I have only two complaints with the standard AI bonuses. My complaints are based on trying to play at Monarch level with the Better AI 1-1 build. YMMV.

First, I strongly dislike the AI unit upgrade bonus. This results in the AI building 10-15 defenders in every city and keeping them up-to-date. I think a side-effect is that the AI doesn't build attack units because it already has a huge military -- composed almost entirely of strong defenders. (Before the game ended that I wrote about in an earlier post, this thread, I checked eventual-winner Frederick and power/score-leader Cyrus. Both had almost no attack units.) I agree that this bonus needs to be tuned down, though I don't know by how much.

Second, I dislike the extra military that the AI starts the game with. What this advantage means is that you're going to be last in the power chart for hundreds of years. This is long enough for somebody's dagger to be launched, and most certainly launched at you, if you are near. The extra Archers are my beef, not the extra Workers.

I don't mind the production bonuses the AI is given, nor how the AI has an advantage over Barbarians. No strong feeling about the other bonuses Blake has suggested changing, other than I think changing too many things at once could result in confusion.
 
Regardless of the upgrade bonus, I think the AI builds entirely too many 'defensive' units and probably too much siege as well. Strength 4 and 5 units arent threatening in the Gunpowder Age and yet the AIs are rife with them for a long time. The only time those units (Trebs) are really good is if the AI is attacking cities yes the AIs will stack them into their own cities as defenders.

I think the huge numbers of defenders are choking the AI's upkeep (depending on difficulty level) and more importantly, production. And in many cases they arent really providing all that much added benefit. Isnt there some way to have the AIs maintain a 'field army' or two rather than huge hordes of city defenders all along its borders?
 
I think the huge numbers of defenders are choking the AI's upkeep (depending on difficulty level) and more importantly, production. And in many cases they arent really providing all that much added benefit. Isnt there some way to have the AIs maintain a 'field army' or two rather than huge hordes of city defenders all along its borders?

I've also asked for a field army before. It would be great if the AI could have a few offensive units that would remain inside its own territory (not be added to an AI dagger stack) and can perform counterattacks against attacking forces or can be used to defend cities.

It is apparently difficult. Probably there is no such thing in the normal civ4 AI, thus complicating Blake's and Iustus's work.
 
Regardless of the upgrade bonus, I think the AI builds entirely too many 'defensive' units and probably too much siege as well. Strength 4 and 5 units arent threatening in the Gunpowder Age and yet the AIs are rife with them for a long time. The only time those units (Trebs) are really good is if the AI is attacking cities yes the AIs will stack them into their own cities as defenders.

I think the huge numbers of defenders are choking the AI's upkeep (depending on difficulty level) and more importantly, production. And in many cases they arent really providing all that much added benefit. Isnt there some way to have the AIs maintain a 'field army' or two rather than huge hordes of city defenders all along its borders?

Is there anyway to program the AI to have offensive defensive units? For example, most human players have a barebone defensive army an archer here longbowman there etc. Our main force is normally an offensive army that attacks the enemy before they siege our cities, or in some cases stays sieged in while sallying out regularly. Would something like this just muck everything up for the AI, and lead to very easy conquests for us? I really feel hordes of defensive units are useless.
 
I don't understand exactly what these mean. What is it that changes, given these changes, as difficulty level increases now?

For example, does this say that the AI always pays 50% for upgrades? That's what I'm reading. Why shouldn't it pay less at higher levels? What gets harder at higher levels?

AI combat bonus against Animals reduced from 70% to 40% on all levels.
AI combat bonus against barbs reduced from 40% to 25% on all levels.

AI pays 50% for unit upgrades on all levels (vs decreasing to 5% at Deity)
AI pays 50% for unit supply on all levels (vs decreasing to 10% at Deity).
AI pays 80% inflation on all levels (vs decreasing to 20% at Deity)
War Weariness increased (on Deity now 50% War Weariness instead of 20%).
Growth bonuses reduced (on Deity requires 80% to grow instead of 60%).
 
Here are a few screenshots where the emphasize hammers + commerce resulted in a suboptimal tile selection. The first screenshot is the governor selection. The second one is my personal handpicked better selection. The second screenshot produces 4 extra commerce (and the same amount of food and hammers).

Wrong tiles with emphasize.JPG
Better tiles.JPG
 

Attachments

  • Wrong tiles with emphasize.JPG
    Wrong tiles with emphasize.JPG
    197.8 KB · Views: 127
  • Better tiles.JPG
    Better tiles.JPG
    198.7 KB · Views: 123
My complaint is that the AI's are all much to defensive now, they all build stacks of 10-15 defensive units in their cities, so none of the AI's can ever take each other out.

Also the AI's priority when using ships, is always to pillage fishing boats rather than to save the ships up to build an invasion force. I think the priority for pillaging fishing boats should be drastically turned down so the AI has more ships for landing troops.
 
I'm all for reducing the AI boni after it has gotten so competent, but I agree with Roland Johansen and the others which think that a flat reduction isn't a good idea.I think the discount should scale with difficulty, f.e. for upgrade costs (numbers are just exemplaric):

AI pays 100% at Settler
AI pays 90% at Chieftain
AI pays 80% at Warlord
AI pays 70% at Noble
AI pays 60% at Prince
AI pays 50% at Monarch
AI pays 40% at Emperor
AI pays 30% at Immortal
AI pays 20% at Deity
 
I'm experiencing a repeatable CTD in my current game. I started the game with a build from revision 241 and continued it today after updating to revision 247 (as I've merged your code with that of other mods BetterAI may not be the cause of course).

I think it is war related as this is the 2nd crash I've had since restarting this game, both have come several turns after starting an attack. I have saves from the dozen or so turns, let me know if you want any.

I've just downloaded revision 248, I'll rebuild the .dll and see if it makes a difference.

Please always post any saves which cause a crash or hang. You do not even have to ask. I was about to make a build to post today, but I will wait a few hours to see if you can post the crash. I would prefer to fix this before posting a build.

-Iustus
 
I think the main problem with the "computer player" is that it is expected to do two or three sometimes mutually exclusive things all at once: (1) play according to his "character" and "circumstances" like religion, etc (2) try to win (3) prevent the human player from winning easily. Suppose you are playing an MP game of civ but you cannot attack unless your opponent has a different religion and you are expected to attack the leading player no matter what. How frustrating would that be?
The AI is expected to do so many silly things like refusing an advantageus offer just because the other player "has the wrong religion" and it is also expected to play "smart". You just can't be stupid and smart at the same time.
Perhaps, it is best to have 2 different builds of this AI, one historic AI and another human-like AI that just ignores religion, gifts, borders, etc.
 
If I want human-like opponents, which are completely unpredictable bastards, I would play a multiplayer game in the first place.
 
@solanacea
Out of the three goals you mentioned, I think #1 is the most important, #3 the second. For SP games, the computer civs are meant to provide an obstacle for the human player. The game is meant to be challenging, so that the human player has to work hard to win. #2 - trying to win (and #3 if taken to the extreme of active victory prevention regardless of other considerations) are bound to make the game harder for sure, but then the computer is no longer so much "an obstacle meant to make the game hard" but an active competitor like another human player would be. Some people certainly will find the active competitor aspect in SP games good (hasn't that been the holy grail of SP strategy games for a long time? A computer opponent just as good as a human opponent, with the same goals?) but there are lots of people who want to play a challenging SP game, not an MP game where the opponents are AI-powered.

I won't even try to comment on the revised bonuses - comments on those seem to relate mainly to high difficulty levels (Emperor to Deity), and I'm nowehere near that caliber. I'm fine if they work on Noble to Monarch range. Moving towards stable builds means I'm finally going to install the mod in the near future and expect to play at Prince for the most part leaving the ideas of moving to Monarch alone.
 
Back
Top Bottom