I really love this game, I really do.. but what ruins it for me is ---

I've been programming all my life and have good notions at everything related.

Not that the current AI isn't worked at all. I'm pretty sure they have put lots of effort and countless hours to get the current AI, but still there's much room of improvement and lots of ways to make the computer actually perform better without resorting so heavily into production/happiness/growth/maintenance boosts.

To do such refinement, you just have to extensively test AI outcomes. And you don't even have to change all the coding logic and formulas, just add some extra conditions to fix those common errors the AI usually fall for. Just the same way you can add extra coding logic to add shortcuts for expected results.

AI in any game is after all just some code flow (program) reigned by conditions (if/then) and lots of evaluations, not matter how complex it may look.

I'm sure they just adjust it with all kind of bonuses because it just takes much less time that way to get a desired effect, and in a company, time is money.

My biggest concern is that you play a totally different game at prince and at deity. Bonus to production, maintenance and such things is OK, but free techs and units from the begining ruins the game experience. Playing catch-up science all the time because otherwise is very easy is a concern to me.
 
I've had an AI blatantly break the rules right in front of me. I had a crossbow on a hill two tiles away from a minuteman. The tile between them was also a hill and there was a river between that middle hill and the minuteman's tile. This was in Washington's territory, there was a road where the minute man was standing but it was leading away, no road leading over the river. Well I watch as it attacks and kills my crossbow in a single turn I was expecting it to obey the rules and cross the river and only get to move one spot closer to me. There is nothing I can think of to explain how that happened.
 
Having a background in software development I flat out don't believe this. I am not suggesting it read out the whole game, just the tactics within say ten tiles of a city that is being attacked or defended.

That seems to me to be a well bounded problem with a reasonable search space.

On any modern computer such a lookahead is extremely fast. Chess programs now check millions of moves in their search for the best one.

Seriously, even a lookahead of two or three moves would at least prevent it from putting its units in the water within range of your archers, and I can't see why a lookahead of seven is infeasible.

Even if it only performed advanced tactics when fighting a human player that would make a tremendous difference.

The main reason I am able to win vs an AI with huge bonuses is that I can defeat an AI military with three times as many units an era ahead. And mostly just because the AI does incredibly stupid things.



The problem is much more difficult than it at first appears.

Someone made a comparison to chess. A Chess AI has all of the following advantages:
- It knows there is always exactly one other player
- It knows it is always at "war" with the other player, with no possibility of peace
- It knows there is only one victory condition
- It knows the cost to move into a tile never changes
- It knows the direction a piece can move never changes except in some very limited circumstances
- It knows it has a 100% chance to kill another "unit," given a particular move
- It knows each piece by its actual class rather than its profile or flavor. A Queen is "Queen," not "a Unit that can move unlimited spaces diagonally or perpendicular to the board."
- The abilities of a particular unit never change
- It knows it has no opportunities to change the game board itself, nor does the opponent
- It knows every scenario is the same and the game will never be modded
- It knows the capabilities of both players are the same
- It knows that pieces don't lose value over time, except specifically in relation to their position on the board
- It knows there is no cost to maintain a piece in any situation
- It knows the exact position of every piece on the board, and is never surprised by fog of war


The one thing I think CIV could do to rapidly improve its AI is IMO not really directly related to AI at all: allow embarked units to fight each other while on water and lower the damage they take from ranged attacks. They already partly made this change from Vanilla (where a unit died instantly if touched by a boat). This change would mainly be helpful in assisting the AI in avoiding the code trap of a need to strongly avoid these spaces while still allowing it to attempt water invasions.

The only other thing I can think of would be to increase the movement of melee troops. The fact that they can only move 1 tile in a lot of circumstances causes a lot of the confusion.

Overall though could the AI be better? Yes, in the sense that anything can always be better. Is it easy to do? It wouldn't be for me. It may be to a coding genius who also happens to be a master tactician and CIV expert. I won't say its impossible for someone to come along and make it amazing but the fact that it holds up as well as it does given all the variables involved I don't expect to see it anytime soon.
 
I've had an AI blatantly break the rules right in front of me. I had a crossbow on a hill two tiles away from a minuteman. The tile between them was also a hill and there was a river between that middle hill and the minuteman's tile. This was in Washington's territory, there was a road where the minute man was standing but it was leading away, no road leading over the river. Well I watch as it attacks and kills my crossbow in a single turn I was expecting it to obey the rules and cross the river and only get to move one spot closer to me. There is nothing I can think of to explain how that happened.

No rules were violated. Minutemen automatically get the Ignores Terrain Cost promotion (like a scout), so no extra movement cost when crossing rivers or moving through hill, forest, jungle or marsh tiles.
 
Spoiler :
The problem is much more difficult than it at first appears.

Someone made a comparison to chess. A Chess AI has all of the following advantages:
- It knows there is always exactly one other player
- It knows it is always at "war" with the other player, with no possibility of peace
- It knows there is only one victory condition
- It knows the cost to move into a tile never changes
- It knows the direction a piece can move never changes except in some very limited circumstances
- It knows it has a 100% chance to kill another "unit," given a particular move
- It knows each piece by its actual class rather than its profile or flavor. A Queen is "Queen," not "a Unit that can move unlimited spaces diagonally or perpendicular to the board."
- The abilities of a particular unit never change
- It knows it has no opportunities to change the game board itself, nor does the opponent
- It knows every scenario is the same and the game will never be modded
- It knows the capabilities of both players are the same
- It knows that pieces don't lose value over time, except specifically in relation to their position on the board
- It knows there is no cost to maintain a piece in any situation
- It knows the exact position of every piece on the board, and is never surprised by fog of war


The one thing I think CIV could do to rapidly improve its AI is IMO not really directly related to AI at all: allow embarked units to fight each other while on water and lower the damage they take from ranged attacks. They already partly made this change from Vanilla (where a unit died instantly if touched by a boat). This change would mainly be helpful in assisting the AI in avoiding the code trap of a need to strongly avoid these spaces while still allowing it to attempt water invasions.

The only other thing I can think of would be to increase the movement of melee troops. The fact that they can only move 1 tile in a lot of circumstances causes a lot of the confusion.

Overall though could the AI be better? Yes, in the sense that anything can always be better. Is it easy to do? It wouldn't be for me. It may be to a coding genius who also happens to be a master tactician and CIV expert. I won't say its impossible for someone to come along and make it amazing but the fact that it holds up as well as it does given all the variables involved I don't expect to see it anytime soon.
What about my 'database' solution (in my earlier post on the previous page)? Would it take too much computational power to even consider it? You could stop updating the database once the AI performed at an acceptable level.
 
The solution is quite simple - don't play the AI, play other humans.

Yes, multiplayer has issues. But playing against good players changes this game to a higher level of competition and fun. Several ways to play this... FFA (free-for-all, like playing singleplayer with humans instead of AI) and my favorite - team games on a skirmish map, like 3x3, where you have wars on a grand scale.

There is a learning curve, and that discourages many players. But once you accept the shortcomings of multiplayer (which I think are not nearly as bad as playing bad AI) you will have an increased civ experience.
 
One fundamental game breaking problem with multiplayer in civ is this, and no-one has ever talked about it could some-one clarify please?

The Problem:
1) You set up a standard game but it turns out that you are in a poor location and you realize after one hundred turns that you are totally stalemated.

2) You can't ethically pull out of a stalemated game. This is because if you do, you will be replaced with an AI which is weaker than you and this benefits your human neighbours and penalises distant human players since now the neighbours can abuse the AI and get an unfair advantage in your absense.

3) So the only thing you can do is pull the plug on the game and be unethical, or endure another 300 turns, but other players will be in a similar situation at some point.

So the multiplayer concept is broken in civ fundamentally by game theory itself and it discourages ethical play by definition. It's great for *social games* where you know everyone as friends or family but fundamentally flawed to play with strangers unless it is very quick 3-4 hour games on tiny/skirmish maps.

Have I got a point?
 
What about my 'database' solution (in my earlier post on the previous page)? Would it take too much computational power to even consider it? You could stop updating the database once the AI performed at an acceptable level.


I don't have any direct experience with it. But it would only be as good as the computer's ability to match up its intent with a strategy players used. It's not clear to me that there is a canned tactical solution. There is just so much the AI has to take into account.

Here is a small but good one: how do you account for memory? If a player sees a unit run past and disappear into the fog of war, s/he is likely to remember it and mentally keep note of the fact that it's out there somehwere. But how good should the AI be at guessing where that unit is now? This is why a chess example really doesn't work. The AI frequently can't even see where it is going and helping it understand what it will probably encounter when it gets there is very difficult to do.
 
The Civ5 AI is decent in the world of AI. I don't know many AI that does better in a as-complex game.

Sure there are improvement that could be made though, especially in the managing department. Like what specialists to run, what wonders/tech to get etc.

But it will always need cheats to beat players that have a clue about the game. And to be honest, unless your game is very simple, it will always be the case (until we are able to make an AI that can learn).
 
I don't have any direct experience with it. But it would only be as good as the computer's ability to match up its intent with a strategy players used. It's not clear to me that there is a canned tactical solution. There is just so much the AI has to take into account.
The point is that any move the human makes is superior to an AI-made move. If you took the data from competitive multi-player games, then there'd be very few bad moves recorded. The human would never suicide-embark or put ranged units in vulnerable positions, etc. There may not be one optimal solution in most combat situations, but any move that the AI picks from the viable alternatives is better than the default AI action (assuming the record-approximating algorithm is decently coded... Even if not, things would improve with more samples.).

EDIT: I realize that the bolded is quite the Achilles heel and a Trojan horse in the sense that it means that my 'solution' covertly includes the initial problem, i.e. coding a decent tactical AI. Even the position of a single Hill tile being different from the sample could alter the optimal movement/attack pattern drastically... The order that the units act in is also a major hurdle here. Oftentimes the outcome is very different when you attack in a different order... A melee unit may have to move forward if it makes the last attack, rendering it vulnerable. Etc... Eventually every possible situation might get recorded, especially if you abstracted things a little bit (ignore rivers; make every ranged unit the same in the calculations, every melee unit is just 'melee', etc)... But what would the AI do in the mean time? It could use the 'default' combat AI I suppose. There's a lot of ifs and buts here, but if (heh) this could be made to work, the AI would effectively learn to be as good as the best humans... Excluding what is discussed below:

Here is a small but good one: how do you account for memory? If a player sees a unit run past and disappear into the fog of war, s/he is likely to remember it and mentally keep note of the fact that it's out there somehwere. But how good should the AI be at guessing where that unit is now? This is why a chess example really doesn't work. The AI frequently can't even see where it is going and helping it understand what it will probably encounter when it gets there is very difficult to do.
You don't... At least I don't see a feasible way to do it. The calculations are already complex enough without committing things to memory. This will always remain a flaw in the AI until we can afford super-computers in households.

Ofc you could remove fog of war as a mechanic; but most players would object to that on account that it's too gamey in civ's historical context. I'm inclined to agree and simply accept the fact that the AI will be inferior when it comes to accounting for hidden threaths.
 
The point is that any move the human makes is superior to an AI-made move. If you took the data from competitive multi-player games, then there'd be very few bad moves recorded. The human would never suicide-embark or put ranged units in vulnerable positions, etc. There may not be one optimal solution in most combat situations, but any move that the AI picks from the viable alternatives is better than the default AI action (assuming the record-approximating algorithm is decently coded... Even if not, things would improve with more samples.).


Yes, but the problem remains that a recorded move is only good to an AI if it can tell when it should use it. The conditions in this game are so complex that it would be very hard to match up any particular move previously recorded with an ideal action action to select by the AI. I can't say for sure but my impression is that in the end you'd probably end up with AI already very similar to what we have, assuming the new ai was build on a reasonable budget and could function on a standard gaming PC.
 
Yes, but the problem remains that a recorded move is only good to an AI if it can tell when it should use it. The conditions in this game are so complex that it would be very hard to match up any particular move previously recorded with an ideal action action to select by the AI. I can't say for sure but my impression is that in the end you'd probably end up with AI already very similar to what we have, assuming the new ai was build on a reasonable budget and could function on a standard gaming PC.
It should use it whenever it encounters that exact situation (combo of terrain and units), or one resembling it closely enough (this is very hard to code I'd imagine; perhaps only identical* situations could be used). You may be right though about the result and particularly the required resources... I wonder if such an AI has been attempted in other games (other than chess ofc), and if so, then what was the result?

*'Identical' on an abstract level... ;) Bit of an oxymoron, but I think some things could be relatively safely ignored. Rivers for example; maybe forests, too. It would lead to some mishaps, sure; but the patterns of terrain become too complex if rivers and forests are included... If the units were abstracted to their types (ranged, melee, anti-cav, cav, etc), and only Hills/Flat/Mountain/Water recognition is used, then I'd imagine that most situations would be encountered soon enough. In the mean time the AI could use its default actions (braindead as they are, they're better than nothing).
 
It should use it whenever it encounters that exact situation (combo of terrain and units), or one resembling it closely enough (this is very hard to code I'd imagine; perhaps only identical* situations could be used). You may be right though about the result and particularly the required resources... I wonder if such an AI has been attempted in other games (other than chess ofc), and if so, then what was the result?
I think that the most interesting study in gaming AI can be found in examining Shogi (Japanese Chess) AI. Shogi is orders of magnitude more complex than western Chess and it isn't at all uncommon to play a position that has literally never been played before, so the AI is coded to attempt to create scenarios that it has in its database that it knows will result in a win for its side. The most powerful current Shogi AI is actually 4 independently functioning AIs running over 169 networked computers named Akara (the Japanese word for 10^224; the hypothesized number of possible positions on a Shogi board). It is thought to be about as good as a high-level amateur Shogi player.

Given that CiV is orders of magnitude more complex than Shogi, you can imagine how many supercomputers you'd need to run a similar AI.
 
Sounds like some of you should play any one of the many Immortal or Deity Challenge games.
 
Sounds like some of you should play any one of the many Immortal or Deity Challenge games.
On Deity the AI spams units faster than you can kill them... It is just as stupid as before, but it seems smarter because there's (literally!) less room for error. On Immortal it's a slaughterfest as usual. So, what was that about challenges again? Or do you mean the changes introduced by BNW that make early wars harder? We're talking about the combat AI here so that's neither here nor there.

@Peng Qi: Again I'm talking about the combat AI only (I assume that you were as well, but just to be clear). Even with my abstractions (units sorted by type, four types of terrain), there'd still be too many combinations to record? Or is it that searching that database with every move would eat up too much power?

As I understand it, in Shogi there's like a hundred stones on the board at once -- while in a 5x5 tile area there can only be 19 units, and even then such situations are rare (excluding Deity and its 'carpet of doom' situation). Wouldn't this reduce the complexity to manageable levels (together with my abstractions)?
 
I'll happily sit here waiting until you can provide me a single instance of a competent AI that does not cheat. I won't hold my breath, though.

The only one I know of is checkers. From the standard starting position, Black (who moves first) is guaranteed a draw with perfect play. White (moving second) is also guaranteed a draw, regardless of what Black plays as the opening move.

http://www.thinkartificial.org/artificial-intelligence/the-unbeatable-checkers-ai-system/
 
I really love this game, I really do.. but what ruins it for me is How they Changed Japan on Fall patch, still a lame Civ (no offense)

BTW good job on Germany :goodjob: and the Landsknetch?.
 
Top Bottom