A Better AI.

I apologize if this question has already been addressed in this thread. I have read about 30 of the 80ish pages with no luck as of yet and thought maybe someone could more easily direct me to the answer.

After loading the mod as directed, I do not see the "=== Better AI ===" text when scrolling over my name in the game point breakdown, thus I do not know if the improved AI (or the handicap balancing) is running.

I am running the Vanilla version of Civ4.

I copied both the CvGameCoreDLL.dll and the CIV4HandicapInfo.xml to C:\Documents and Settings\[admin account]\My Documents\My Games\Civilization IV\CustomAssets

After this, I also tried overwriting the original CvGameCoreDLL.dll in the real Civ4 folder with the new one (after backing up the original, of course). I still did not see the "=== Better AI ===" text.


I would appreciate any suggestions. Thanks!

I'm one of the many users of this mod and answered this same question in post 1617. I see that you have copied the CIV4HandicapInfo.xml in the wrong directory. You will still see the text while holding the ALT key and mousing over the scores, but you will have the normal handicaps for the AI.
 
The game isn't any fun if there isn't at least one idiot playing, even if it's not the human.

For me the game is fun only if there is no idiot at all.

I like to be challenged when I play. If there's only one idiot AI, I kill it and I use this advantage to win, which is bad for the game. It's not fun to win vs an idiot. I think most people think like me on that point (?)

I agree with you that AIs should show different personnalities though. It's something Blake and Iustus already plan to do if I remember correctly.
 
Well, one person's 'idiot' is another man's 'genius' IMO. For example, if the game is relatively peaceful due to geography or religions or whatnot, continuing with an arms race is pretty idiotic when you could be teching or growing the econ. So is a builder Civ being an 'idiot' if he starts to pull ahead in tech and econ due to not spamming military?

Similarly, isnt it pretty idiotic to continually build obsolete military that barely delays more advanced enemy units rather than trying desperately to catch up in tech? Of course trying to catch up runs the risk of being attacked while they are weaker and killed off, but would building another pile of obsolete units really have prevented it?

The point is, that its hard to define what is or isnt idiotic behavior because its going to vary based on the situation. What I dont want to see happen is that every AI goes balls to the walls trying to build defenses at the expense of other aspects (teching and development). And I think the 1/8 build is dangerously close to that situation. Some times being relatively peaceful WILL work (even for an AI), particularly when they have warfighting potential in the form of superior tech or production capabilities.
 
For what it's worth, I think the handicap changes will be a necessary pre-requisite to forming a competent Domination-oriented AI. In my most recent game, with the updated handicaps, Shaka was able to Vassalize two of his neighbors and seriously weaken a third. That wasn't possible earlier; without the new handicaps, the computer players would auto-upgrade all their units and wars would result in massive defensive slogs.

With the new handicaps, computer players with better resources, tech, and production are better able to dominate their neighbors. It weakens them against human players, of course, but I think it's going to be necessary before we see any AI Domination wins.
 
I have posted a new build for testing purposes only on sourceforge



In particular I would like those who were getting OOS errors to try this build. Anyone can use it, the more the better, but it may run a bit slower.

If you get an assert, please post the info here. There still might be a few that are not really a problem (Blake and I have squashed most of those from the regular 2.08 release), but it is most likely that any asserts you see are actual bugs we need to fix.

Thanks to anyone who takes the time to try this build!

I will get a real release posted in the next few days, after getting some feedback on this release.

Bonus points to the first person to mention the new 'feature' I snuck into this release.

-Iustus
Iustus, the city governor seems to be acting oddly in the 16th Jan build, when compared to the previous release and the stock game.

At the start of a brand new game using this test release, I founded my city next to some floodplains and a hill with gold in it. With the 8th Jan build and the stock game, the city gov automatically chooses to work the floodplain square. However, with the 16th Jan build, the gov chooses to work the unmined goldy hill, so the city doesn't grow at all.

This can't be right.
 
At the start of a brand new game using this test release, I founded my city next to some floodplains and a hill with gold in it. With the 8th Jan build and the stock game, the city gov automatically chooses to work the floodplain square. However, with the 16th Jan build, the gov chooses to work the unmined goldy hill, so the city doesn't grow at all.

Are you building a worker with an Expansive Civ or Settler with Imperialistic Civ? Thats the only thing I can think of unless you accidentally hit 'emphasize Commerce' or something.
 
For what it's worth, I think the handicap changes will be a necessary pre-requisite to forming a competent Domination-oriented AI.

That is a really great point. And its in line with what I had commented on above. Anything that makes it harder for the Human player to attack the AIs is also making it harder for the AIs to attack each other.

I think at some point efforts to make the AIs more difficult to attack have to be curtailed unless the AIs attack efficiency can be boosted to the same level. Otherwise its going be an awful lot of mighty peaceful games.
 
There will be changes to the number of defenders trained though, it will vary on difficulty level, it will vary by leader, it will vary more by relationships.

FWIW, my vote would be NOT to vary the number of defenders on the difficulty level. Let the different handicaps make the differences in the difficulties, not the strategies.

IMO, vary it based on personality and relationship (and situation), but dont make Noble or Prince 'worse' than Monarch or Emperor. If the algorithms are 'correct' for one level, they should be correct for all levels IMO.
 
Vary it based on resources available... and if that in turn is dependent on difficulty level (due to handicaps, etc), then so be it. But don't tie it do difficulty level directly. I'm in complete agreement with Uncle_Joe.
 
I personally like the better defence of the AI. It not only means that a domination/conquest victory is more difficult. It also means that war is not the only or the best option to defeat the AI.

An often heard complaint about civ4 is that the best way to defeat the AI in this game is by going to war with it. You can easily capture some cities and thus improve your research speed (more cities means more research after you have some buildings like courthouses and marketplaces) and improve the number of cities that can build units. It means that after the capture of the cities, your empire is in a better shape to win the space race or conquer the rest of the world. By making a conquest war more difficult, the game might reach a balance where war is not always the best option to win the game. I like that for a game called civilization.

It has the side consequence that the AI will also be less capable in winning a conquest or domintation victory. But I still see large and powerful AI nations in my game. In my present game, the Egyptians have one vassal and are about to defeat another nation. Their power graph is about twice as high as the second strongest AI nation. I'm quite happy that they are on the other continent (before astronomy, but with caravels) because I wouldn't like to have to fight them. I'm playing a game with the aggressive AI option and I see constant wars and cities are being captured. Wars will not result in the quick victory for one side, especially if both nations are roughly the same strength. But that would also not be that great. So I don't see the peaceful game with no wars and no cities captured as described in one of the previous posts. It probably has to do with the aggressive AI setting.

I would like to see the best possible AI in war, offensive and defensive.

I do think that the barbarians shouldn't turtle in their cities. They should be murderous, pillaging maniacs that use a few defenders in their cities and use the rest to pillage and attack.


I can see why the AI would use more defenders at the higher difficulty levels. At the higher difficulty levels, the AI can build units cheaper and units have lower upkeep costs and thus the AI will have more units. It's a logical consequence of the difficulty level modifiers. It should spread those units over the attack force and the defence force and thus cities will have more defenders.
 
I have posted a new build for testing purposes only on sourceforge



In particular I would like those who were getting OOS errors to try this build. Anyone can use it, the more the better, but it may run a bit slower.

If you get an assert, please post the info here. There still might be a few that are not really a problem (Blake and I have squashed most of those from the regular 2.08 release), but it is most likely that any asserts you see are actual bugs we need to fix.

Thanks to anyone who takes the time to try this build!

I will get a real release posted in the next few days, after getting some feedback on this release.

Bonus points to the first person to mention the new 'feature' I snuck into this release.

-Iustus

Thank You for this build!

We will try it out this weekend. We usually play 3 Human and 15 AI's. I will Install the new AI and post any errors we receive.

Thanks again for looking into the OOS Error.
 
I can see why the AI would use more defenders at the higher difficulty levels. At the higher difficulty levels, the AI can build units cheaper and units have lower upkeep costs and thus the AI will have more units. It's a logical consequence of the difficulty level modifiers. It should spread those units over the attack force and the defence force and thus cities will have more defenders.

If its a capacity thing, there sure, I agree. Thats what I meant by allowing the handicaps to dictate the difficulty. But purposely 'weakening' the algorithms at lower difficulty settings is what I wouldnt want to see.
 
If its a capacity thing, there sure, I agree. Thats what I meant by allowing the handicaps to dictate the difficulty. But purposely 'weakening' the algorithms at lower difficulty settings is what I wouldnt want to see.

Ok, I agree. But I don't think that Blake ment it that way. He just doesn't want the AI's to build too many defenders on low difficulty levels because that would stifle their economy. And the AI at higher difficulty levels needs more defenders because its opponents have bigger armies that would crush a weaker defence. I think it is all related to the production and commercial advantage of the AI's at the higher difficulty levels.

For the human it of course means that he meets a stiffer military resistance (in numbers) at the higher difficulty levels. But that seems logical to me. That's why you give the AI a handicap.
 
ok two crashes from the same game, but no OOS errors so far.
First on is when I "zulu" ask napoleon what he wants to stop trading with saladin and it crashes, the second 600ad's save is when napoleon declares war on the aztecs other humnan player with a possible declare war on Ai or something like that in the assert.. i forgot to copy what it said. I upload the save when it crashed and the turn before so hope that helps..
 
Should the AI's ability rise enough that it can do without handicaps on Monarch for example, weakening it at lower difficulty levels would definitely be good.
First goal is of course to get the AI to a level where hidden bonuses can be removed and overall bonuses lowered. I'm waiting for the day when the AI doesn't have bonuses on deity and thus has to be crippled (without giving bonuses to humans) by choosing weaker algorithms at lower levels :)

I've done some testing now, playing with 07-01-08 build and handicaps. I've played at Prince, with chipotle on so that I can observe the AI (thus these games aren't normal competitive games).

To begin from the later part of the game: the number of units is staggering. I think this is good, as I needed way bigger army than before to go around waging wars. And the number of units meant higher WW too. I let the slider go up to 70% culture before going to Police State - and that was not with mechs and modern armor but with arties and infantry. Essentially later wars can be fought by human player only with Police State or the WW will be crippling.

Requiring more units from the human player, as well as the related higher WW, actually means that peaceful game by skillfull diplomacy is reasonable choice. The keyword there is of course diplomacy. When one can't keep up in the power game (and no, it's simply not possible with eg. Ragnar around), the way to keep out of unplanned wars is to choose friends and enemies carefully, then make sure the friends are friends and the enemies are fighting someone else all the time.
I did go peaceful rexing to see how that works, and it was just fine. Of course I could say that I lucked with Bismarck being the only one I shared borders with, not eg. Monty.. But even if the AIs seemed to keep me on the list of war targets, they always found a better target and thus I could keep out of wars.

Any AI going cultural seems doomed. Unless he's bordered by peaceful AIs only that is.. Liz went cultural and Alex smelled an easy target. Another time Mansa went cultural, and Mehmed (who I didn't think of as aggressive guy) decided that there was someone without army to take on. In both cases, the AI was low in power and lacking diplomatic skill (which is how the human survives) just didn't have a chance anymore. But who am I to complain - Mansa built a nice bunch of wonders and even a double-holy city for me, ripe for picking when Mehmed asked for a buddy to a war :)


Some questions about what I can observe:
When mousing the AI area with Alt pressed, I can see the AI strategy information. I've seen the following at least:
- Dagger
- Production
- Cultural1
- Cultural2
- Missionary
Out of these, Dagger has been discussed extensively here, and I'm assuming the culturals refer to different methods of going for cultural victory. Missionary has been adopted by those with shrines, and looks fine. But what is Production?

Other code on the area has been:
- NEUTRAL
- DEFENSIVE
- OFFENSIVE
- ASSAULT
- MASSING
This seems to relate to state of war. Offensive when the AI has decided to attack, defensive when being under attack, neutral most of the time. Assault and Massing I'm not sure about - what would these mean?

Also, I like the new city governor. This has taken a lot of microing off my hands - I can let the build governors handle the minor cities knowing that even if they might not develop the city the way I would, they will make it useful still. One gripe about that comes to mind though: they did not care about building jails even when I had WW up the wazoo and was running the slider high on culture. Those I had to force myself. In several cases, building Jail would've been worth as much happiness (or rather reduction of unhappiness) as all the happy-buildings they could build together.
 
A question about the BetterAI's memory within the game:

Does the BetterAI create and use historical memory such that it will be smarter if it runs continually, versus saving and reloading?

I am assuming that the BetterAI creates new memory objects to store its data and its previous decisions, and I am assuming that you cannot store some or all of these in the save file and still maintain save compatibility. If my assumptions are correct, then the BetterAI would be smarter if it runs continually for the game, and not quite as smart if you save (losing this data) and restart.

I ask because I have not seen noticeable differences with BetterAI, but this may be because I only get to play here and there when I have the time, and usually do not play more than about a half-hour at a time.
 
Someone in an earlier post mentioned that the AI seems to hoard money while at war. I seem to see the same behaviour in my game where the money pile of Washington is going up each turn while at war. Now its about 1000 gold. But other AI have been at war for a while too and they don't have these large hoards of money. Maybe they can still upgrade units, I don't know.

A guess: maybe the AI still has a unit somewhere that it wants to upgrade but it can't do so because it is outside the cultural borders. But the AI keeps saving money to upgrade that unit. Just a guess, nothing more.


And another screenshot about the same subject I discussed earlier with Iustus: the AI doesn't like happiness resources. ;) ;)

Situation: Emperor level, huge map, epic speed, aggressive AI, BetterAI version 8 jan 2007, year 1424. We've discovered gunpowder and printing press (to give you an idea of the level of technological development). Roosevelt has not been at war continuously but has had long periods of peace (allthough he is at war now for a turn or 20-30).

Here's the screenshot of the AI not claiming the silver. The best spot near the silver according to the AI is on top of the 1 tile island (I gave it a sign: city). I guess the AI prefers the tile because of the many coastal tiles surrounding it. It's the only silver on the continent. The information is up to date as I just traded maps with Roosevelt.

AI doesn't like luxuries.JPG
 

Attachments

  • AI doesn't like luxuries.JPG
    AI doesn't like luxuries.JPG
    123.5 KB · Views: 145
Had an 'Assert' pop up in my current game.

Here was the message:

File: .\Cvteam.cpp
Line: 1612
Expression: iCount>Setatwarcount(bIgnoreMinors)

Saves are attached.

Hope it helps.
 
Back
Top Bottom