Better AI

noto2

Emperor
Joined
Jul 11, 2008
Messages
1,715
Hey, all, just wondering about the Better AI mod. I downloaded it and played 2 games with it, I didn't notice a big difference, except that in war the AI would send its SOD to counterattack my land instead of fighting my SOD in its land. At first I thought, wow, that's cool and smart, but then after I adjusted my strategy I realized that the AI was even easier to defeat since there was nothing standing in my way while I was ravaging their land. Can people with more experience with this mod shed some light on it, please? Does it really work? Does it really make the AI more challenging? Forcing the AI to abondon its cities and suicide its SOD in my land does nothing really...except lower my war weariness. What else is this mod supposed to do ?
 
The main warfare improvements that have been made to Better AI is in the use of air units and naval invasions (AI regarding use of tranports, escorts etc.). Issues like positioning of SoDs etc. are not going to be much different yet.

Better AI at the moment sort of tries to make the AI better through lots of important logic improvements. For example, AIs were previously not picking the right civs to declare war on because of a bug in the closeness calculation, causing AIs to declare pointless wars on civs on the other side of the world and the like. So Better AI AIs hopefully make better decisions in that regard.

Another example is that in Better AI the AIs can now actually build privateers because of the removal of a bug that caused them never to be built. IMO the AIs don't use privateers very well yet but the very fact I've seen them pillage the trade routes outside my city shocked me because I'd never seen a normal AI do it.

It's a work in progress, basically. ;)
 
I've used the mod myself and have seen the changes described; privateers built and used when I don't remember seeing them before, there are fewer instances where some civ on the opposite side of the continent declares war and marches across desert and mountains to teach me a lesson. It does seem to do a better job with invasions, escorting the transports, and actually landing troops (and plenty of 'em).

But if I hadn't looked for the changes, I probably wouldnt have noticed them much. It's not a shocking improvment yet but at the very least some skilled interested people are working on making something not prettier but smarter.
 
Yes I've been going through the files now and I see the changes are subtle ones. I suppose they are mostly good changes, like getting the AI to save its ships and air units from destruction. I'll give it another go.
 
The main warfare improvements that have been made to Better AI is in the use of air units and naval invasions (AI regarding use of tranports, escorts etc.). Issues like positioning of SoDs etc. are not going to be much different yet.

Better AI at the moment sort of tries to make the AI better through lots of important logic improvements. For example, AIs were previously not picking the right civs to declare war on because of a bug in the closeness calculation, causing AIs to declare pointless wars on civs on the other side of the world and the like. So Better AI AIs hopefully make better decisions in that regard.

Another example is that in Better AI the AIs can now actually build privateers because of the removal of a bug that caused them never to be built. IMO the AIs don't use privateers very well yet but the very fact I've seen them pillage the trade routes outside my city shocked me because I'd never seen a normal AI do it.

It's a work in progress, basically. ;)

Can you get them to use the governor emphasize feature consistently? Even crude city specialization would improve the AI drastically.
 
Can you get them to use the governor emphasize feature consistently? Even crude city specialization would improve the AI drastically.

Wait. You're asking me? I'm not one of the people making the mod - I just contribute to the development discussion, and have been following it since its inception during the days of Warlords. I agree on the need for improvement in city specialisation but one of the main things that holds back much progress on this front is that basically the AI cannot have a memory - everything has to be decided from the current state. An AI cannot remember that city X is a GP Farm, it can only see its various output values for this turn and whatever the emphasise button is currently set to. This puts great limits on its ability to specialise cities effectively.

Honestly I think for Better AI to go far there is going to need to be some way of using a memory for each civ. No human player is able to develop a sound strategy if he is not allowed to know anything from the previous turn. I reckon if you made 500 human players take the 500 turns in a normal speed game, each of them not being able to see the game before their turn, it'd be a mess. The team might win (if low enough difficulty) but it will not be completely obvious to each human what the strategy of the previous human was.

I think the main issue is savegame compatibility which is one of the stated goals for the Better AI project. I couldn't care less about savegame compatibility.:(
 
Why can't the AI have memory?
 
I reckon if you made 500 human players take the 500 turns in a normal speed game, each of them not being able to see the game before their turn, it'd be a mess.

Now that would be a fascinating, if somewhat unwieldy, succession game. :lol:
 
Now that would be a fascinating, if somewhat unwieldy, succession game. :lol:
well, there already was a "let's throw the dice to know what we're going to do next" succession game.
So a "let's not say what the next guy shall do" SG might be too easy ;)

About city specialization, TMIT implied the AI could check or uncheck the buttons in a city in the same way the player can.
That is a form of city specilaization memory that could be used.
Now I don't know if the AI has the ability to do this.
 
Why can't the AI have memory?

Because of BetterAIs drive for save game compatibility. If it has memory then there needs to be some way to save/load that memory, somewhere to store it, which means additional variables in the save game file that aren't there in a normal game, which means Better AI can't load a normal saved game and vice versa. They want to avoid that, so they have to do various hacks where they want to simulate memory.

Personally, my games either have BetterAI or they don't at this point, so I would be really curious to see where it could go if they ditched saved game compatibility as well.
 
To me it's a wish list item (which probably will not come true) that in a future release of Civ the difficulty levels will be reflected in the AIs getting *smarter* rather than the human getting crippled with arbitrary penalties or the AI getting boosted with arbitrary bonuses.

I think this can be captured by programming the strategy choices made by humans at the various levels, and when you "play Deity" you're up against an AI programmed to act like a deity-level human player.
 
To me it's a wish list item (which probably will not come true) that in a future release of Civ the difficulty levels will be reflected in the AIs getting *smarter* rather than the human getting crippled with arbitrary penalties or the AI getting boosted with arbitrary bonuses.

I think this can be captured by programming the strategy choices made by humans at the various levels, and when you "play Deity" you're up against an AI programmed to act like a deity-level human player.

It's interesting a lot of people think along these lines. I disagree with it because I prefer to have the full AI capacity even at the mid-range difficulties.

Having a more skilled AI at higher difficulties might drive people to become more competent at the game but for the people who can't realistically make it to Deity or Immortal it kinda sucks to know we're never going to see the "full" AI. IMO it's entirely sensible to just give the AI handicaps and let it use all of its intelligence at every difficulty.

Besides, that would also make strategy discussions easier. If strategies changed from level to level and there were 7 or so levels it'd be a nightmare in S&T.

There's also the fact it'd be more time-consuming and expensive to program the AI to be different at each difficulty. It's better to just have the programmers/designers make the best AI they can and then scale/handicap it for the difficulty levels.

My 3 cents. ;)
 
^^ agreed - it would be nice if the AI was so good that most players played on levels below noble, to get bonuses against the machine.
 
I think the only way to get a playable AI is to have one AI and give it bonuses or handicap it by level, as Civ IV does.

I've read previous discussions on AI (in various games) where designers have basically said that programming an AI that's near impossible to beat is not a problem, the problem is programming one that can put up some sort of challenge at a high level AND is fun to play against.
 
no way. Chess programs were around for decades before software programmers were able to create chess AI that could take on the best humans. A game like Civ has 1000 times more variables to program than chess. It would take them decades from now to make an AI that would be a real challenge without getting bonuses.
 
I think the only way to get a playable AI is to have one AI and give it bonuses or handicap it by level, as Civ IV does.

I've read previous discussions on AI (in various games) where designers have basically said that programming an AI that's near impossible to beat is not a problem, the problem is programming one that can put up some sort of challenge at a high level AND is fun to play against.

This is true for some games (or more to the point, game genres)- twitch games in particular, like first person shooters, you don't actually want the AI playing to the best of its ability unless you really enjoy taking headshots all the time.

I think for a Civlike game, GalCiv managed to have an AI that mostly gets smarter rather than cheating on higher difficulty levels. What they really did right was set it up so that people could send them games, they would improve the AI based on working strategies, and then patch it in.
 
I've played GalCiv and its AI is really no more impressive than Civ's. It misses important wonders and can't win wars
 
Honestly I think for Better AI to go far there is going to need to be some way of using a memory for each civ. No human player is able to develop a sound strategy if he is not allowed to know anything from the previous turn. I reckon if you made 500 human players take the 500 turns in a normal speed game, each of them not being able to see the game before their turn, it'd be a mess. The team might win (if low enough difficulty) but it will not be completely obvious to each human what the strategy of the previous human was.

I think the main issue is savegame compatibility which is one of the stated goals for the Better AI project. I couldn't care less about savegame compatibility.:(


Adding extra variables into the code is very difficult because you need to get the rest of the code to reference it, but you can have some relatively elegant workarounds. I really like what Kael has done with Fall From Heaven II with equipment promotions and the like - and I especially like what he's done to correct the truly boneheaded moves that the AI had been making with spellcasting units (i.e. he made spellcasters able to cast even with 0 movement left so that the AI would actually be willing to cast a spell).

The idea that I had was to create a national wonder style building (1 per empire) or a cathedral type building (only 1 per 3 cities, etc) that cost 0 hammers that would designate a city as a GP farm/unit production city/building city/wonder city/commerce city or something similar. It could even be built as an action by units as long as it did not consume the unit to do so (think Scotland Yard or Academy). Make the building be destroyed on the city's capture and you have yourself a memory.

It's not a perfect solution, but it is a lot more simple to implement than many other changes would be.
 
Top Bottom