AI: Why is it so hard to improve?

Soren Johnson also had a great talk at Google you can find online where he talks a lot about the theory of AI, and it follows a similar principle - it's better to have the AI act logically but stupidly than to have the AI act like a human.
Ye he learns from the master. Every time these wanna-be psychologists try to make make an AI that tries to appear to do this and than, instead of making an AI that actually plays to win, it's gonna fail one way or another. And i'm 47% certain these quirks we are seeng are just side effects of that global plan.
 
Maybe this is a silly question, but does the AI do any work on our turns? If not, why not?
The decisions depend on your cities, on your income, etc. So Imagine that someone suddenly takes one of your cities. Now you would have to revise your plans.

Here are the typical approaches:
* Snapshot: take decisions upon the situation from previous turn. Can lead to glitches and exploits, significant programming overhead to check that decisions can still be enacted (does the unit still live?), more bug opportunities.

* Transaction: take decisions upon the situation from previous turn but detect changes and recompute all plans from scratch in case of changes. Of course something will always change. And of course there are times where you will fail to realize that something can change, and this will introduce bugs.

* Granular concurrent reactivity: Implement a reactive algorithm that dynamically and incrementally revise its plans as things change. Very huge effort, very complex, very bug-prone, will slow down all future developments and lead to worse games.

* Global lock: do not do anything while another player is acting. Simple, works, few bugs, no programming overhead. *Victory music*
 
DonQuiche, good explanations. I will take your word for it that it is not feasible.

I guess I was thinking too much like a human. In most games I have my next turn planned out and make adjustments as necessary. Of course, as a human, it is easier for me to make those minor adjustments then to wait until my turn to formulate a plan. I can see how AI is not there yet.

Not speaking specifically about Civilization, but could a game and AI be designed around that concept? Compute tasks that will not change on the players turn, and leave tasks that could change on the players turn for the AI's turn? Or would such a system lose more efficiency then it gains from the extra time?
 
DonQuiche, good explanations. I will take your word for it that it is not feasible.

I guess I was thinking too much like a human. In most games I have my next turn planned out and make adjustments as necessary. Of course, as a human, it is easier for me to make those minor adjustments then to wait until my turn to formulate a plan. I can see how AI is not there yet.

Not speaking specifically about Civilization, but could a game and AI be designed around that concept? Compute tasks that will not change on the players turn, and leave tasks that could change on the players turn for the AI's turn? Or would such a system lose more efficiency then it gains from the extra time?

There's a few flaws with that.
1. it's often hard to separate what could depend on your actions and what won't. I mean, if you declare war against them, they basically have to start from scratch, and I would imagine a large part of plans will depend on their overall state, so even a tiny change of yours could shift them around. Stuff like adding one envoy to a city-state can cause problems.
2. The tougher issue is simply a matter of making sure to not screw things up. If the AI is evaluating its city-state planning while you're adding an envoy, you would either have to wait until they're done, they have to wait until you're done, or you have to be careful that the AI isn't seeing being a suzerain at one point in calculation and not being suzerain the next line of code. Alternately, you can't have the AI be evaluating their city as you capture it, since there's a higher chance that either you'll see something out of place, they will, or things will get into a state that will cause a crash.

Basically, it's a lot easier to just do things one at a time, and if you want to speed things up, you can do stuff like have the AI manage all their citizens between cities in parallel instead of doing it one at a time. Trying to do too many things at once is more likely to cause a problem that the small edge in calculating time savings won't be enough.
 
@Wintervoid
The human brain itself belongs to the lazily reactive category, so indeed we do not realize how sophisticated this is.

As for your proposal, very few changes to none could be unaffected by the player's turn, so it may not be worth it. The few things I can think of (pathfinding) would have had to be computed during the previous computer turn anyway, as a result of strategic decisions.
 
Thank you both for the replies and explanations. It makes perfect sense once you explained why it would not work. And it seems like the process is not really viable for most other games either.
 
Maybe this is a silly question, but does the AI do any work on our turns? If not, why not?

I know that combat would have to wait until the AI's turn, but what about decisions such as build orders and tech choices? Most of those decisions are made mostly in a vacuum, or at the very least, would only be 1 turn behind on the logic.

I imagine that would need to be a design decision from the start, but IMO, if you could offload some of the AI decision making to the time we use on our turns, that would give more time for strictly combat related processing.

Just trying to think outside the box, assuming it is not already done that way.
Not a silly question at all!

I actually did have the AI of Pandora do that at one point. In Multiplayer the game has simultanous turns anyways so i figured that why not lets have the AI do the same. The reason why I stepped back from it was ... players complaining that the AI moved on "their turn" and reacted to things the player was doing. For example: Move a unit with 2 movement next to an enemy city, so you can bombard it and then retreat the unit... Now the AI just attacked that spotter-unit. I thought this was brilliant but as I said players didn't like it.

However, I did not remove it completely. On the first turn, I have the AI move as soon as you do something. If I wouldn't do that, they would basically be one turn behind for the whole game.
Also if they use units with multiple movements near enemy cities, they also spend most of the moves when the player can already move aswell. And if the player moves fast, the later moves of the AI still cann react to that. But most of the time is taken by animations, not actual AI-calculations. Still, usually it saves some time to allow the player to already act while the AI also is still acting.

The main reason why this usually is not done is simply that everything except pathfinding only takes very, very little time. Deciding what to build, what tech to research and even what to attack and where to defend only takes split-seconds. Path-finding on the other hand eats up the majority of AI-processing time.
 
DonQuiche, good explanations. I will take your word for it that it is not feasible.

I guess I was thinking too much like a human. In most games I have my next turn planned out and make adjustments as necessary. Of course, as a human, it is easier for me to make those minor adjustments then to wait until my turn to formulate a plan. I can see how AI is not there yet.

Not speaking specifically about Civilization, but could a game and AI be designed around that concept? Compute tasks that will not change on the players turn, and leave tasks that could change on the players turn for the AI's turn? Or would such a system lose more efficiency then it gains from the extra time?
The solution to this is a system of planned orders/execution phase like in the board game Diplomacy or games like Dominions or, I believe, Oriental Empires. It means planning and doesn't work well with 1upt which is too tactical (you have to move each unit one by ont and if one unit is blocked then your whole orders collapse). I think it's vastly superior to what civ proposes in terms of strategy, but you don't get immediate satisfaction of seeing your units move when you tell them to.
 
Top Bottom