i think i know why the ai always sucks

There is a lot of truth to this statement about the AI and performance implications. I wrote an "AI" this past winter, a very detailed set of algorithms on how to recommend and model fantasy baseball trades for a client of mine.

The actual AI that was released was a shell of the "on paper" version. Of course, people complained about its lack of depth, but had we gone with what works perfectly, people would have complained about the slow performance.
 
The time the AI takes to process things doesn't matter.
It should be around a minute or 2 of extra waiting in the whole game.
The thing is, the AI can't improvise.
And frankly, this is what is keeping all technology from reaching Terminator level.
It has 1 plan, maybe a backup, but it has no idea what to do if those fail.
 
It was done in Galactic Civilizations II, and fairly well received; from what I can tell. A Checkbox in the options allows for "multiple thread processing" (or, slightly more intelligent AI) for those who have the extra processing power. Don't see why it couldn't work with Civ.

I guess it's largely in how it's framed. "Multiple thread processing" doesn't tell me the same thing as "reasonably decent AI, because the other one's crap", even if they'd mean the same thing. I can't imagine many people be happy about it unless they were very clever in selling the concept.
 
then just search random sampling. and when considering countermoves, limit the search to moves that would happen nearby

more brain power is used for chess or go than civ. ergo, a civ ai should be easier to develop.

go also has a big variety of possible moves, yet the ai for go is pretty good. No need to exhaustively search. Use monte carlo or something like it. Even searching 3 moves ahead will make for a far greater ai than what we have now.

Civ has about as many possible moves in ONE TURN (late game) as go in an ENTIRE GAME.

Enough said.

"Looking ahead" in the form of trying random moves by whatever sampling method you use, simply is not an option. (An haven't even started about the fact civ is not a deterministic game, which disfavours such an approach even more.)
 
Civ has about as many possible moves in ONE TURN (late game) as go in an ENTIRE GAME.

Go has between 10^(10^48) and 10^(10^171) possible moves in the entire game with a typical game having 10^360 possible moves. Civ doesn't have that many in one turn, even late game. And you could just limit this to tactical AI anyway.

"Looking ahead" in the form of trying random moves by whatever sampling method you use, simply is not an option. (An haven't even started about the fact civ is not a deterministic game, which disfavours such an approach even more.)

It works for go.
Should work for civ. They've used this kind of approach on other games that are not deterministic. You can simply approximate with a likely, balanced outcome.
 
but it seems a lot easier to be good at civ than chess. So, I think civ is the simpler game. And what about go? Go has a board about as big as civ and go AIs are light years better than the civ ai.

I shouldn't have though Goe and Civ are comparable. You can only do one thing in goe (placing stones), whereas in civ there are a plethora of options in every single turn.
 
Go has between 10^(10^48) and 10^(10^171) possible moves in the entire game with a typical game having 10^360 possible moves. Civ doesn't have that many in one turn, even late game. And you could just limit this to tactical AI anyway.
Late game civ turns can have more than 100 units, that can have as much as 100 available moves. The number of possible moves in a single late game turn thereby can easily reach the number of moves of a typical game of go.

It certainly is much more than can be efficiently searched by any monte carlo method.
 
Late game civ turns can have more than 100 units, that can have as much as 100 available moves. The number of possible moves in a single late game turn thereby can easily reach the number of moves of a typical game of go.

It certainly is much more than can be efficiently searched by any monte carlo method.

A go piece can be placed anywhere on a go board, whereas a unit has a very limited set of hexes it can move to. Pare down the set of hexes it can go to with some common sense (eliminate half of the hexagonal area by deciding on a direction, and toss out sea tiles for land units and vice versa) and you get ~10 hexes as possible destinations. A go piece, on the other hand, has quite a lot more vertices it can land on.

Moving a units with the tactical AI is not an insurmountable problem. It has been solved over and over again with successful wargames. Take a decent WWII tactical hex-based wargame worth its salt, and you'll find you can do more things with a unit than Civ can, and there are more units as well. A wargame's tactical AI can give Civ's tactical AI a run for its money.

I'd say developing better heuristics is more of a win than minimaxing or going monte carlo. Searching through a tree is prohibitively expensive, as people have pointed out, and random sampling sounds sketchy as well. I'm not convinced that you can get away with a small amount of sampling for decent AI, and on top of that, your objective function should be topologically aware so that GGs and artillery are protected - but if you're running that expensive function on multiple random samples, you might as well take the topological framework and develop simple heuristics for it, no?
 
A go piece can be placed anywhere on a go board, whereas a unit has a very limited set of hexes it can move to. Pare down the set of hexes it can go to with some common sense (eliminate half of the hexagonal area by deciding on a direction, and toss out sea tiles for land units and vice versa) and you get ~10 hexes as possible destinations. A go piece, on the other hand, has quite a lot more vertices it can land on.

Moving a units with the tactical AI is not an insurmountable problem. It has been solved over and over again with successful wargames. Take a decent WWII tactical hex-based wargame worth its salt, and you'll find you can do more things with a unit than Civ can, and there are more units as well. A wargame's tactical AI can give Civ's tactical AI a run for its money.

I'd say developing better heuristics is more of a win than minimaxing or going monte carlo. Searching through a tree is prohibitively expensive, as people have pointed out, and random sampling sounds sketchy as well. I'm not convinced that you can get away with a small amount of sampling for decent AI, and on top of that, your objective function should be topologically aware so that GGs and artillery are protected - but if you're running that expensive function on multiple random samples, you might as well take the topological framework and develop simple heuristics for it, no?

I agree, that was sort of my point. civ7 seemed to be under the naive impression that the civ AI could easily be improved by just trying to look ahead a few turns. As you said, that is a very (computationally) expensive approach for a very minimal gain.

There are other ways by which the tactical AI can be improved much more efficiently. Mostly through better heuristics. This is, by chance, what many of the AI improvements in the previous patches boil down to.

I think the civ5 can be improved a lot, the question is how fast will it get there.
 
Maybe the developers shouldn't waste time trying to make the AI more intelligent, but rather develop a set of behavioural rules which govern the AI behaviour. For example: "if there is more than 50% forrest tiles in my territory I will invent Bronze Working". If they would use these sorts of (simple) rules only for diplomacy, the AI would become infinitely better, without the need for heuristics or Monte Carlo systems. (actually the bad AI diplomacy is the main reason why I don't play Civ5 anymore)
 
I don't accept time as a suitable excuse for the AI's shortcomings. If I can play against a half-decent AI opponent in Advance Wars--a Game Boy game of all things that also uses 1upt--then I should be able to at least play against an AI in Civ that's comparable on a system that's many, many times more powerful. Not to mention that in Advance Wars the AI can deal with manually loading air and sea transports, if a bit uncoordinatedly, and even tries to protect them from your ships, while the Civ V AI can't even figure out not to put its units in the ocean ("Oh look, an open space where my unit will be out of the way!) while your frigates are just a few tiles away, well within sight.

I'm not holding Advance Wars up as some shining beacon of AI light. It's not by any means and has plenty of tactical shortcomings. But the thing is it's competent enough to get by and, again, if a Game Boy game can do that quick enough to make for a quick strategy game on the bus, a PC game should be more than capable of it.
 
You only have to look at the map to realise that they start with 4 times more unit than the human and with 3 times more income. Those are bonuses that completely dwarf Civ Deity level.

In campaign, yes they often have units and income in the beginning. I never claimed the game's AI was perfect, and beyond that it's still AI and needs help to be a challenge (especially in hard mode). However, playing against it on an even playing field in multiplayer maps or custom maps made in the editor it still manages to hold its own. That's more than I can say for Civ V where I've watched the AI horde all their troops up just outside my range while I take their capital.

In short my point is that the Advance Wars AI, as simple and imperfect as it is, is still better than the Civ V AI at doing the same kinds of things, and thus raw horsepower and computation time are not valid excuses for its shortcomings.

(Also, the campaign mode maps are usually set up with some specific tide-turning strategy in mind for the player. They usually have a bunch of easy-to-take cities near your bases to siphon away their income, or their army relies on a specific kind of unit you start building counters for, etc. The comparison to the bonuses in Deity level are a little apple-to-orangish, Civ being an open-ended playing field and all.)
 
Regarding a toggle option to select how much time to allow for AI processing - a lot of strategy games and virtual board games actually have that, and perhaps it would be nice for Civ5.
 
Maybe the developers shouldn't waste time trying to make the AI more intelligent, but rather develop a set of behavioural rules which govern the AI behaviour. For example: "if there is more than 50% forrest tiles in my territory I will invent Bronze Working". If they would use these sorts of (simple) rules only for diplomacy, the AI would become infinitely better, without the need for heuristics or Monte Carlo systems. (actually the bad AI diplomacy is the main reason why I don't play Civ5 anymore)
The problem with such rules is that they would not work with mods. Or to make things worse the AI would be hopelessly broken with each major patch. A requirement for any civ AI is that it makes its decisions based of the XML/ game data.

The other thing with such rules is that it makes the AI extremely vulnerable to exploits.

Regarding a toggle option to select how much time to allow for AI processing - a lot of strategy games and virtual board games actually have that, and perhaps it would be nice for Civ5.

Such a toggle only makes sense if the AI contains routines with a time limit (or a search depth limit). The civ AI doesn't contain such routines, and therefore would not benefit from such a toggle.
 
I do wish people would stop linking the strategic AI in Civ to Chess.

Chess has a limited number of spaces, pieces, moves and counter moves. You could actually program all possible variants in if you couldn't be bothered writing the algorithm (although it would take more time but less programming skill!) Chess works on predictable variables within the game and works entirely by mathematical models.

Show me where the ranged pieces are in a 5000 square chessboard that has limitless numbers of playing pieces with a dozen players each playing with variable levels of piece strength, and then throw in bonuses (negative and positive) from what type of square they're on, throw in a few abstract modifiers and then add relationships between the players and I'll agree that Civ is just like Chess and the programming should be just as easy.

You can beat any chess program simply by not trying to win, you can get a stalemate 100% of the time against a computer because it cannot understand the strategy.

Civ you can beat constantly because it's not programmed with sufficent data to comprehend it's environment effectively. It doesn't know how to use units collectively or formulate a strategy beyond sheer brute force.

These are totally different types of strategy programming. :mad:

What the AI in Civ needs is a strategic database to draw from, but that would significantly add to it's processing time as it tests it's proposed moves.

But it's not frickin' chess. :nuke:
 
On that note I'd really love to play Chess on a fractal map generation script, it might spice things up a little.
 
The problem with such rules is that they would not work with mods. Or to make things worse the AI would be hopelessly broken with each major patch. A requirement for any civ AI is that it makes its decisions based of the XML/ game data.

The other thing with such rules is that it makes the AI extremely vulnerable to exploits.
QUOTE]

I don't understand why that wouldn't work with patches. Can't they just tweak the decision rules a little after each patch?

About the exploits, sure you can influence AI decision making when you know the decision rules, but isn't that something real world leaders do as well?
 
Real world leaders would 'exploit' to some extent, yes, but not in the computer-game sense. Exploiting in Civ diplomacy involves making use of some sort of rule that the AI is incapable of making use of.
 
Back
Top Bottom