Is BetterAI really better? Let's find out

dizzygreen

Chieftain
Joined
Feb 8, 2008
Messages
20
Location
New York, NY
Let's play a BetterAI game together! Yes some parts of it are already in 3.19 but there are some exciting new developments:

Spoiler :

Code optimizations that reduce between-turn waiting by ~20% (not just for BetterAI, similiar code optimizations are available for regular BTS 3.19, search for "CAR mod" if you're interested)

Two BIG BTS bugs are fixed:
1. Workshop/cottage endless cycling by AI workers
2. Fixed major bug where AI only builds HALF of the # of workers that it calculates it needs.

if (iNeededWorkers < iExistingWorkers)

is changed to

if (iNeededWorkers > iExistingWorkers)

No kidding!

Because the AI techs faster now, some moderate global tech throttling has been implemented. Basically, all medieval techs are 4% more expensive, industrial techs are 8% more expensive, modern techs 12%, future techs 12%. This applies to everybody (human and AI). If you don't like that you can turn it off easily but let's leave it on for the purpose of comparison.

Of course, the soul of BetterAI is war strategy. I won't say it's improved because that is up to debate, but it is certainly different and worth experiencing.

The settings are:

Big and Small (islands mixed in)
Standard size
Normal speed
Monarch difficulty
All victories

And we will be playing as Victoria of England. I think this is a fairly strong leader that most players are probably familiar with, good at warmongering or peaceful playing. The difficulty is Monarch because I hope this will attract the greatest number of players.

EDIT There is an Immortal version of the save posted by Soirana below.

The goal is to have fun, learn a little, and most importantly to answer the question: "Is BetterAI really better?" Clearly one game is not enough to come to any conclusions, but I do think it'll be interesting to hear if people find the game to be more or less difficult than the typical Monarch game.

BetterAI can be found here.

For those not familiar with mods, the download is a ZIP file that you extract to your Beyond The Sword/Mods folder. It won't affect your regular installation. Just start BTS up normally and chose "Load A Mod" at the title screen.

Good luck and have fun! I'll be weighing in at the standard 1 AD, 1000 AD checkpoints but anyone is welcome to post whatever they like.

And the start position...
 

Attachments

  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    88.7 KB · Views: 334
  • betterAI_victoria_4000BC.CivBeyondSwordSave
    42 KB · Views: 56
I was a little harsh on betterAI at first, but then I found out that the reason they didn't seem too impressive was that the people who actually writing it weren't in the thread yet :lol:. I'm actually going to try this. Jdog's work on the code and his activity in that subforum has really impressed me. I want to see how far along this project has come in about a year since I've played...and if it has CAR it might actually tax my system less so it's worth a try.
 
The AI doing quite well in 1200 AD. Do you have raging barbarians on? The barbarans have been destroying all of my work boats so I haven't been able to grab the crab resource. The AI's doing quite well there doing better than me in technology and possibly military but I'm catching up.
 

Attachments

  • BBAI AD-1200.CivBeyondSwordSave
    274.7 KB · Views: 57
Since I've been wanting to start a better AI game series I'm definitely in on this. I've been waiting for this release after the cottages thing got fixed and after reading jdog's post about the workers I realize it does hamper the AI - though it also allows them to expand faster.

I think war is considerably improved and enjoyed the mod simply from naval warfare.
 
Well, I've played 24 turns and I tried a common tactic used to "game" the standard AI because A) In a normal game, it would be a good move and B) Testing out the "better" AI's behavior is kinda the point of this game, isn't it?

Spoiler :
I worker stole from Hannibal. He reacted in exactly the way they normally do. I was moving my warrior to a forest to hunker down and stasis him, but Hannibal finished a third archer while he was still on a hill adjacent to the city. He has 3 to 1, so he attacked, just like the regular AI does, and he lost by a fluke (should have had favorable odds). My warrior was badly damaged (10 HP) and if another archer attacked they would have certainly won. Even if there was another fluke, the city would still have had a defender. But no... the remaining archers stayed right were they were, just like the normal AI does. Two healthy archers covering in the face of a single strength 0.2 warrior. I could have promoted the warrior and stasissed him for a while but I wanted to explore south of him and Hannibal had another archer was blocking the safe return of my captured worker (yes, he has as many archers as I have warriors, yet he won't attack), so I asked for peace and *Dun*Dun*Dunnnnnn* I got it. He lost two units and I lost none, so he was loosing, right? If he had been taken over by a human player the turn before that peace treaty, he could have destroyed me in 20 turns. As far as I can tell, he did exactly what the regular AI does.


I know I'm being a little harsh - this is after all just a microcosm of the problems plaguing the normal AI, but I have another non game-spoiling gripe. I saw I was loosing money and went to check my Financial Adviser to see what my free unit cap was, and it wouldn't open. Domestic, Financial and Military adviser screens are a no go. What is up with that? Did the new AI steal my advisers from me to level the playing field? Not really what I was expecting, but it will help them a little bit. I'm going to have a hard enough time playing without BUG. BTW, are you BUG compatible?

Am I missing some kind of replacement adviser screen built into the mod? If there is one, why are the regular buttons still there and non-functional?

I'll keep playing, and post snapshots, but it looks like there are some kinks to work out.
 
The most noticeable improvement in BetterAI is naval invasion AI.
 
Sounds like fun. So I shouldn't expect my neighbor to the east to react much differently to what is about to come his way? He doesn't like... know... already does he? Not sure how he'd prepare for it even if he did know.

And what is with these adviser screens? Please... advise.
 
I've been using Better AI ever since Blake started the project, years ago.

It's an amazing difference. Just playing on Monarch can be challenging, if the AI gets a good enough start. I suppose the human will always win every war, but the AI plays a very good peaceful game.
 
I've been using Better AI ever since Blake started the project, years ago.

It's an amazing difference. Just playing on Monarch can be challenging, if the AI gets a good enough start. I suppose the human will always win every war, but the AI plays a very good peaceful game.

I don't know, there are some pretty good "screw you" canned strategies that could allow the AI to compensate for its lack of tactical thinking:

1. A row of 10-20 horse archers that don't stop at all (or not until the stack is sufficiently weakened), and raze every city captured.
2. Amphibious razing invasions, that out-run inland troops and only attack when city capture is likely.
3. Large amounts of units to which you have no counter due to lacking a resource
4. Increased dogpile chances (would also work against other AIs).
5. A built-in choke+pillage DoW.

Even executed poorly, it would be hard to fully prepare for these and if they caught one by surprise they'd be total screw jobs.
 
maybe i will try [if i can live without BUG that is]

reconverted save to immortal level as i do not think AI can be smart enough to cause problems at monarch.
 

Attachments

  • luyu BC-4000.CivBeyondSwordSave
    30.8 KB · Views: 61
@civ editor11 Raging barbs is off

@izmir Do you have BUG installed in \customassets? I haven't noticed the advisor screens issue. betterAI can be used with BUG but they need to be merged (someone is usually nice enough to post a merged copy of the mods but there isn't one yet for 0.81M)

@soirana Thanks, I had originally wanted to post a save where people could pick what difficulty level they wanted but wasn't sure how to do that. Seeing as there is somewhat of an all-star lineup playing along, it would be cool (if you haven't started yet) for the advanced players to play at their regular difficulty level.
 
Well, I've played 24 turns and I tried a common tactic used to "game" the standard AI because A) In a normal game, it would be a good move and B) Testing out the "better" AI's behavior is kinda the point of this game, isn't it?

Spoiler :
I worker stole from Hannibal. He reacted in exactly the way they normally do. I was moving my warrior to a forest to hunker down and stasis him, but Hannibal finished a third archer while he was still on a hill adjacent to the city. He has 3 to 1, so he attacked, just like the regular AI does, and he lost by a fluke (should have had favorable odds). My warrior was badly damaged (10 HP) and if another archer attacked they would have certainly won. Even if there was another fluke, the city would still have had a defender. But no... the remaining archers stayed right were they were, just like the normal AI does. Two healthy archers covering in the face of a single strength 0.2 warrior. I could have promoted the warrior and stasissed him for a while but I wanted to explore south of him and Hannibal had another archer was blocking the safe return of my captured worker (yes, he has as many archers as I have warriors, yet he won't attack), so I asked for peace and *Dun*Dun*Dunnnnnn* I got it. He lost two units and I lost none, so he was loosing, right? If he had been taken over by a human player the turn before that peace treaty, he could have destroyed me in 20 turns. As far as I can tell, he did exactly what the regular AI does.


I know I'm being a little harsh - this is after all just a microcosm of the problems plaguing the normal AI, but I have another non game-spoiling gripe. I saw I was loosing money and went to check my Financial Adviser to see what my free unit cap was, and it wouldn't open. Domestic, Financial and Military adviser screens are a no go. What is up with that? Did the new AI steal my advisers from me to level the playing field? Not really what I was expecting, but it will help them a little bit. I'm going to have a hard enough time playing without BUG. BTW, are you BUG compatible?

Am I missing some kind of replacement adviser screen built into the mod? If there is one, why are the regular buttons still there and non-functional?

I'll keep playing, and post snapshots, but it looks like there are some kinks to work out.
Well in defense of the developers of BBAI I need to post some wise and informed words of other posters, one of them being a well known beta tester of civ IV ( among other things he actually made the drafting charts for the game ) and other a very good player with a high degree of code knowledge ( ppl with both skills aren't so easy to find :p )
I can't ever forget the discussion we had back in pre-release testing, where Soren Johnson ( note: Soren was the chief of the Civ IV team in Firaxis until Warlords, in case you don't know ) explained that he could program the AI to defend against early rushes, but he would have to break the game for normal play in order to do so. We agreed at the time that it was better to leave things alone, and trust players not to exploit the AI's shortcomings in this regard. (The AI has been deliberately programmed not to "see" an early rush coming; it will always give you peace in the first ~80 turns of the game, and assumes you will do the same.)

IIUC in order to actually start a total war, an AI needs a "Stack of Doom" = a group of units lead by a unit with UnitAI ATTACK_CITY. (...)

In the early game the minimum number of units in a SoD is 4 -- only then a stack is "ready to attack" so that the head unit can run the AI_targetCity-mission and the selection group starts moving towards the enemy, triggering the DoW when it crosses the borders. With a lower unit count the group will run the AI_moveToStagingCity-mission = move to the most threatened city and wait there.

My point with this quotes is to enlighten a little the debates that always appear regarding AI behaviour in early warfare. Bolded and underlined for emphasis: the fact that the AI can't awnser well to early rushes is a game design decision of the coders and not laziness or bad coding because ( this is my part of speculation ) allowing the AI to attack with less than 4 units built, one being CITY_ATTACK would probably bork the warfare in later eras . Regardless of my speculation, the fact is that the original coder wanted things to be this way ( with probably good reasons ) makes the option of changing it also a game design decision, a thing that BBAI coders had not done as much as that ( and to add, most likely trying to make things work both in early and less early warfare is not a easy thing to do ). And, to say the truth, if Soren was really right ( I would not discard that ) and you can't have both a AI that acts inteligent in terms of war before t80 and a AI that acts inteligent in terms of warfare after t80, i definitely prefer the latter ;)
 
If you had not been able to get peace BetterAI would have built archers only until it killed you. This is my experience so I think the peace no peace is different per AI at that point. But if we keep the series going we'll see someone try everything.

I'm also playing immortal and looking forward to a better AI tech rate. Hoping if I have a crappy start I'll be forced to try out some of TMITs strategies to even the playing field.
 
Wow, better AI at Monarch. I have trouble with the dumb AI at Monarch. Perhaps I should start a better human thread.
 
@civ editor11 Raging barbs is off

Spoiler :
The island chains near your starting location provide a huge number of coastal tiles for barbarian galleys to spawn on. That's why you are seeing heavy barb naval activity.


@izmir Do you have BUG installed in \customassets? I haven't noticed the advisor screens issue. betterAI can be used with BUG but they need to be merged (someone is usually nice enough to post a merged copy of the mods but there isn't one yet for 0.81M)

Gah! This was the problem. I apparently didn't get a clean uninstall of BUG 3.6 from custom assets when I installed BUG 4.0 as a mod. I probably would have had problems with FFHII as well, but I haven't been playing any mods except BUG since 4.0 came out. Thanks for the tip.
 
Immortal/Normal 425 BC
Spoiler :

I went Agriculture, AH, sailing, masonry, writing then alphabet. Built a workboat and sent it east first thing. Found a 2 fish site south of Hannibal and settled it 2nd. Built the GLh, then the pyramids and no one had built the oracle at ~800 BC. I was 7 turns from the oracle and 7 from MC since I wanted colossus so I built it and grabbed machinery. I had trade routes with 4 civs very early, but a barb city must have formed blocking me from everyone but Hannibal unfortunately and I am still blocked or GLh would have been ridiculous here. Its so far and so much land I can't justify 2 galleys and 4 axe to go looking for it.

I settled the 2 fish/stone city first, and that gave me good commerce running the coast tiles which helped an early alphabet. No one had alphabet at 600 BC so I gifted it to everyone for the heck of it.

I'm thinking of trading for monarchy then going feudalism-guilds switching to caste and building workshops all over.

I was thinking the worker fix might slow AI expansion and it seems like Hannibal is getting out cities slow, but perhaps they just aren't on the trade network yet.


 
So, I'm going to playthrough with periodic snapshots. I think I am a good candidate player for this showcase. Everyone knows TMIT and Ignorant Teacher are going to win, but I am an Emperor player. I am virtually guaranteed to win on Monarch vs. normal AI and can win on Emperor with my favorite leaders, but I struggle with unfavorable situations on that difficulty level. If I can't win this game, that will be pretty solid evidence that Better AI really is better, as this same set-up without better AI is only a moderately difficult game for me (I don't know the mapscript and rarely play IMP leaders). If I win decisively, I'll be convinced better AI doesn't have much to offer. Things will be more ambiguous if I eek out a narrow victory.

After some headaches with an old, partially uninstalled version of BUG interfering with this mod (thanks Dizzygreen), I am ready to go:

Spoiler :
I don't settle in place; way too much water in the capital's grid. Coast isn't terrible when financial, but quite a few tiles were ocean if I settle in place, so I decided to go north. I debate which plains hill to settle on. Do I want London to be coastal, or have more workable land? Is there seafood hidden to the NW? I decide to go landlocked, and as there as no seafood is revealed, I feel vindicated by my decision.

I start researching agriculture and I start a warrior. No, this isn't evidence of my newbishness; I don't have wheel or agriculture, so if I went worker first I'd have a bunch of idle worker turns on my hand. I toyed with the idea of going BW first to prevent idle worker turns, but there isn't much to chop and that would delay Agri and AH even longer and I don't like going without food resources for so long, plus I may want those trees for a wonder or a rush (ooh... foreshadowing). In retrospect I had the option of going settler first - Imperialistic might make this feasible (especially with a 2H city square) but I am not experienced with IMP leaders, and that's why I didn't think of it. Tech order is Agri, AH, BW, Wheel, Myst, pottery, writing.

My explorers reveal that I am sharing with Carthage either the western edge of a northern peninsula of a larger land mass visible to the south, or a small continent with islands near by, or some variation on this theme. I have never used the Big and Small script or its cousins, so I don't know. "Islands mixed in?" Does that mean the land I can see across the straits (which I hereby dub, The English Channel) is probably a small archipelago? I won't know for a few dozen more turns because Carthage blocks access to the rest of the land mass. The land that I have discovered between us so far is marginal at best. This means I have 3 expansion options:

A) Block him as well as I can and spread to the islands when I run out of decent city sites, or
B) Kill him quickly, or
C) Kill him slowly and have my fun with him while doing so, and dance on his grave when I'm finished.

Easy decision. Plus we want to test the Better AI, so using a trick the normal AI has no defense against is called for. I worker steal. Ah, fond memories. Learning this trick from lurking these forums helped propel me from Prince to Monarch. Now lets see if Better AI has any new tricks up his sleeve. I move my warrior around to set up shop on the forest and stasis him (assuming that works on Better AI) but something unexpected happens. He built a third archer that turn and attacked my warrior as he passed on a hill. I won (fluke) but was heavily damaged. As I already mentioned, he should have followed up with one of the other archers who almost certainly would have won, but he didn't because of whatever weird code makes early cities with huge stacks of archers terrified of a lone fortified warrior. So, no change here. I get peace, a free worker, and a lifelong enemy. As I already mentioned, he thinks he is loosing the war, so he accepts peace. Sucker.

England, 2000 BC (50 turns):



I had copper in my capital BFC and a decent production city site nearby, so Operation Behead Carthaginian Dogs is a go. Two of the axemen required for OBCD are done, and more will be coming off the line quickly thanks to a few chops, a few whips, and some strong production tiles. Ample early warriors (none of which have died to animals - this never happens to me) have revealed the whole peninsula/continent NW of Carthage and the one that initiated the war is exploring SE of Carthage. The situation is grim. OBCD must succeed or England will become a small nation of herders and miners playing second fiddle to a commercial seafaring power. It is a long way to Carthage, so once the workers have finished the infrastructure for OBCD, they start building the road to perdition Carthage.

Oh, and I met Saladin. His scout met mine on the far side of Carthage. He is a devout Hindu and likes Hannibal for some reason, so he is a little miffed I declared war on his friend. Unless Hannibal does something to piss Saladin off like found a religion (which would be double sweet, cause I could take the holy city) that modifier is going to go up to -2 or -3 by the time this is done, which is a little worrisome. Saladin is a pretty good balance between unit building and empire building, IIRC, and can be a formidable opponent. I also have no idea where he is so can't really plan his demise at this point. Of course, my assumptions about how he will behave are all based on standard AI, but I can only operate on the principles I know until I see something different, and I haven't yet. Oh well, if he is nearby I will probably adopt Hinduism when he starts spreading it, and if he isn't then who cares.

I do some recon with my warrior that made it past Carthage and an axeman on the other side. I figure flaunting my axemen before axe rushing him will either be a good joke or a clue to the Better AI that he needs to get his rear in gear. Good news, my scouts report Hannibal lacks access to copper and horses, so we will face only archers, and it will be glorious. No diversion to hunting is necessary because I won't need spearman. I am about to finish writing, and debate what to research next. I decide on sailing, as I am about to found a coastal city (London switches to settler after OBCD production was finished), and capture one or two more, including one with a freshwater lake. I will need commerce for my economy to recover from OBCD; my distance and unit maintenance costs will be high. The map also looks like GLH could be a real help.

Saladin converts to Judaism. He has two holy cities. I wish to conquer him. But lets not get ahead of ourselves.

Carthage, 1080 BC, Second English-Carthaginian War (73 turns):



Two archers! You have got to be kidding me. The city is large enough to whip 2 more by the time I can attack, but Utica is too far away to send reinforcements in time. Not that normal AI would, but "Better AI" might.

Another thing I didn't notice until I looked at the screen shots just now: The workers are building a mine in the flatlands. This could have clued me in to the fact that Hannibal has IW and there is iron on that tile. Had I been a little slower on my rush, I could have been facing Axes (bad) and spears (good). Would "Better AI" have skipped the spearmen because I, his worst enemy, am incapable of building chariots/HAs? Again, we will never know (unless one of the Better AI team members tells us).

40 years (1 turn) later:



Ah hah! Hannibal had just dispatched a settler, like, the turn before I arrived. He sent one or two archers with it, which accounts for the shabby state of Carthage's defenses. As expected, he whips an archer. He also tried to recall that scout and leaves it parked next to the stack. I destroy it contemptuously (which is why that one axeman isn't in the stack). Was he heroically sacrificing himself to buy Carthage more time? The world will never know.

One interesting thing to note, those two workers that were next to the stack did not retreat into the city. They just moved one tile away and started another improvement. Does the normal AI do this? I'm not sure. If Carthage was to survive, this is wise conservation of worker turns.

The fall of Carthage, 1000 BC (75 turns):



The population of Carthage dropped again, but he did not gain an archer. What is he whipping, a monument? Wouldn't surprise me. Also doesn't help him.

9 axemen
vs.
3 archers in a hill city with 40% culture defense.

Two are fortified and have (oddly) the guerrilla promotion. One is too new and level 1. All my axemen are level 2. I promote them to city raider before the attack. How many do you think will die?

Phase 2 of OBCD, 925 BC (78 turns):



Would you believe only 4? Most of my troops are level 3 now and proceeding to Hardrumetum. It has 3 archers. I don't think it could have built one by itself in 4 or 5 turns, so that means these archers left Carthage. Probably while my SOD was visible on their borders. Also, if they had connected it with roads - which those two workers we saw could have done in a single turn in reaction to my DOW - they could have reinforced Carthage, if Better AI does that kind of thing.

This has been a typical axe rush. I don't know if he was pursuing IW specifically to defend against me and was just too slow, or if that was his normal tech path and he just got unlucky. I do know he whipped something other than an archer in his capital while the SOD was approaching and missed an opportunity to reinforce with nearby archers. These sorts of tactical considerations are apparently not what Better AI is about.


So far it seems Better AI doesn't have any tricks up its sleeve to deal with the two cheapest tricks human players hold over them, the worker-steal and the axe-rush. Granted, my victim was ill equipped to deal with it anyway, lacking important resources, but there are many things he could have done to survive or even beat me. So far, I have not noticed any definite improvement from Better AI.

This is not surprising. The goodies hinted at in this thread include better naval invasion forces and something ominous about vassal collectors. Perhaps they coordinate their wars with their vassals? Can they use their allies' transports? Coordinate the attacks of two stacks? We shall see.

Spoiler :
I have some hard decisions to make. Finish off Hannibal or milk him for techs? Settle the islands or consolidate my hold on the continent? How will I handle raising my happy cap? What techs to pursue? As for the latter, I messed up a little. I went Poly after writing, intending an Oracle->CoL slingshot. Been a while since I've done one of those; they are harder on Emperor. Someone else finishes the Oracle while I am researching Priesthood. And someone founds Confucianism not to long after that, anyway, though I was really after the courthouses. If I'd gone Alphabet, I could have demanded exorbitant techs from Hannibal already, but he's just been spamming archers this whole time and appears to be trying to counterattack with them.



Good luck with that. I go Alpha after Priest and get IW and HBR from him in exchange for his unconditional surrender. Why did he waste his time researching HBR. There are no horses on this side of the continent! Saladin has started spreading Judaism to my lands, and I convert so our relations improve. I would have traded with him for some other stuff, but luckily I meet Ramesses II the turn before I get Alpha. He doesn't have a Diplo penalty with me (and is also Jewish) so I get a sweet deal: Monarchy, Meditation, Monotheism and Hunting for Alphabet and HBR. He apparently does have horses, because I see a War Chariot exploring my territory, but I am not afraid of this guy, he's a pushover. And a wonder-whore, maybe he stole GLH and Oracle from me. Perhaps I can capture the GLH. Also, getting Monarchy and Monotheism on the same turn allows a "magic number" revolt to OR and HR. I need to start spamming missionaries in my production city.

I need to explore, I don't know where anybody except the Carthaginians are. Now that I have IW, I can slash and burn the food rich jungle south of Carthage for my GP farm. The islands have promising looking space for more commerce cities. I have stone and am setting my sights on the Hanging Gardens. After picking up calendar, and maybe literature for Great Library in my GP farm, start the Lib race. I wonder if the AI will make that harder on me. I have already diverted a little from it to pick up other stuff, but this is Monarch, so I thought it was OK. We'll see.
 

Attachments

  • Izmir Stinger AD-0001.CivBeyondSwordSave
    161.5 KB · Views: 48
Top Bottom