War AI Needs Help

If all AI units had +33% combat, war would be a less attractive options. Having a +25% strength promotion to all AI units would make emperor a lot more interesting IMO. And +100% for naval units - they have no idea how to use those.

Yes. They should give units free promotions (not of their choice, just drills, shocks, maybe medic) (properly marked in the pre-battle report, of course) and mellow out a bit with the science and gold bonuses.

Firaxis appears to feel that giving units an outright strength bonus would be too obvious. Well, it would be obvious, but so is the science and gold bonus they get on higher levels. A better AI would be the best solution (and in my opinion an attainable one).

Naval units don't need an extra bonus though, they need better AI. The AI for naval units is so poor that I would classify it as a bug.
 
Giving the AI combat bonuses, either as a flat modifier or a free promotion was suggested in the early days of civ5 when the combat AI was performing even worse. The community has more or less rejected combat bonuses as a way to 'patch' the AI to give it an advantage.

I am of the same mind as well.
 
4. (without doing too much number-crunching) Imagine making all your moves, now pretend you are the human and make all of their moves. Now imagine what your moves next turn will be. If they involve an army fleeing away after heavy losses, don't move in!

A 2-ply relative strength optimization (as you sort of suggest) would generally be much better than what the AI does. I.e look at all my (AI) moves, look at all opponent moves for each of my moves (this sounds like a lot but many branches would merge or could be pruned), count how many units my opponent loses and how many I lose in each branch. Choose the move which maximizes the difference of these two numbers (minimax). Imperfect information leads to complications, but these are not insuperable.

The current AI far too often puts units on "suicide squares".
 
Actually, qemist, that would be a LOT of calculation time. Given 6 units per side in a fight (low estimate) that each of them can move to/attack 10 different tiles (very low estimate, especially if there is cavalry around) that gives a total 1 thousand billion combinations. Sure, most of them can be recombined, but you still have to check them to know that. Even if only 1/10000 is unique, you then have to work out the combat odds for ~5 attacks.

They could prune that down a lot. Even if it just calculated the maximum damage each side could do (which basically eliminates every option that involves walking to a blank space without firing afterwards) it would still be much better I think. Also, the recombining is indeed pretty powerful. Any move where the first hex begins in a direction that would not be taken to reach an enemy can all be dismissed as withdrawal scenarios from the first move and completely ignored unless withdrawal becomes the AI's choice. A unit's battle options in a 6v6 scenario would be [any of the six units it can reach] or [any of the ~8 hexes it can reach near those units] or [calculate good withdraw and go with that]. Out of those options, it can take the best 2 or 3 and compare with the best options of the other units. Not saying it's easy, but it's a huge part of the game so it shouldn't be.

If all of that is too complicated, it should at least say "this is the move I'm going to take. Oh wait, if I do that, 3 guys will shoot at me, I will be down to 15% health, and at that point I will choose to withdraw. They have no reason not to shoot at me, it's a free move and they're clearly not doing anything else. Guess I will not make that move after all".
 
I think that approaching it purely as a calculation issue is a little closed. The problem with AI in a 1upt environment is more complex than simply valuing units and I think it has a large amount to do with the AI not using set plays. (Not that I'm suggesting it should have a playbook and just repeat moves verbatim.)

Ultimately, there are only 4 classes of land combat unit.

Melee - warriors, infantry
Ranged Weak - archers, crossbowmen (these are only really around for the first few eras and seem to vanish after chemistry appears)
Ranged Seige - catapults, artillery
Unit Inteceptors - horsemen, tanks (those with negative city modifiers)

These are then modified in priority by strength.

The AI doesn't need to know how to control every type of unit, simply what to do with these 4 types.

If you look at how you play, you move your units in a pattern that follows how you intend to attack, you make assesments based on the unit defense around that city and approach accordinly.

The AI doesn't seem to do this, it wades its units in and if the seige ranged happen to be at the front then it will shift them afterwards to let the melee through.

I think by teaching it attack patterns and then letting it diversify based on opposing units and terrain (ranged units favor hills, melee favour forest next to cities where they can take cover etc) that you should be able to build up a stock of formations that the AI can then replicate.

Currently, it seems to me, the AI is playing a lot like a simple chess program in that it is applying values to units and simply moving them accordingly to how those values change, rather than creating a wider view of the game and employing a strategy with a clear outcome. It wants a city, it moves units, it has no idea how it's going to take that city other than to just keep pounding it until it breaks.

Teaching the AI to use units properly, which the above is aimed at, would be a massive leap forward and solve a lot of the stupid moves that it currently uses in it's suicidal conquests.

I don't think its the AI overall that doesn't work properly, I think it's the AI's understanding of what units do and their relationships.
 
Well said. Watching a good human playing, asking them why they did each move, and trying to apply those heuristics to an AI could probably do a lot without it considering too many combinations.
 
Well said. Watching a good human playing, asking them why they did each move, and trying to apply those heuristics to an AI could probably do a lot without it considering too many combinations.

If you developed a "play book" this way, you could even have more advanced strategies for higher levels so the AI didn't need freebies to be harder to beat! :cool:

I think to a degree human combat movements follow set patterns, in this style of game they have to ultimately, they can't be that hard to map.
 
Actually, qemist, that would be a LOT of calculation time. Given 6 units per side in a fight (low estimate) that each of them can move to/attack 10 different tiles (very low estimate, especially if there is cavalry around) that gives a total 1 thousand billion combinations. Sure, most of them can be recombined, but you still have to check them to know that. Even if only 1/10000 is unique, you then have to work out the combat odds for ~5 attacks.

While this approach could work, the waiting time inbetween turns would be insufferable to 99% of players.

Yeah, but I can;t imagine Civ6 not having multi-core CPU as a minimum requirement. So i think 1UPT will get better over time. I'd imagine 8 to 16 cores being standard in 2014 when the next game is ready.

As for Civ5, the problem for the AI will always be the human will manage its troops better and they will need to rely on numbers, and that's always been the argumrent for Stacks (that the AI can bring together more numbers) in one spot, and it's a fair point to make.

But meticulously killing a numerically superior AI has always been a hallmark of playing a 'harder' AI so I don't think that will ever change.
 
But meticulously killing a numerically superior AI has always been a hallmark of playing a 'harder' AI so I don't think that will ever change.

I would say that's the problem. With the hex map and one unit per tile, giving the AI more units won't affect the outcome so much. Once you have enough units you can stop 100 o 1000 enemy units, so in higher difficulties they shouldn't focus so much on numbers, but giving them a +X% bonus based on difficulty.
 
Again combat bonus was suggested and rejected, and I think for good reason. You don't want to create an experience where the game is working against you and you lose what should be winnable fights.

The bonuses need to be subtler.
 
Again combat bonus was suggested and rejected, and I think for good reason.
The bonuses need to be subtler.

I agree with this too, and it's all the more reason why Firaxis needs to put real work into the AI (Civ as a whole is a complicated game; moving a few units at a city is not).

I wouldn't suggest a combat bonus except that their bonuses elsewhere are so ridiculous (on Diety) that adding a combat bonus and reducing gold\science bonuses would actually be subtle in comparison :crazyeye:
 
Just a question:
As I am currently playing my first game since December, I've got the impression that the combat AI actually has got worse!
Just for the background:
Emperor, huge map, continents, France.
I am capturing workers like crazy (being constantly at war from turn ~30 to 110 now and none of the three wars has been declared by me), I assume that it has been almost 10 workers now.
This is significantly more than last year, where it would have happened too, but not that much frequently.

2nd observation: siege weapons are again rolling to the front without being escorted. At least the escorts are not protecting the sieges weapons, but try to engage here or there, leaving the siege weapons alone and prey to my horsemen.
Once again, this effect seems to be considerably worse than what I remember from last year.

3rd observation: "Attacks" (actually, they don't deserve that name) on your cities can easily be interrupted by shooting (the city itself or defending archers) at one or two of the attacking units, which then try to move back (assumed: for recovering).
The rest of the attack force remains where there are just located at that moment.
The effect is that the attack force is split into parts and can easily picked one by one, thus completely destroying them.

So, my question is: has there been a patch in the meantime which has weakened the combat AI? :confused:
 
That hasn't been my experience. The siege weapons usually have preset positions they want to take and travelling there may be causing you to think they're not escorted.

I routinely lose cities in my emperor games, and experience set backs. Without knowing about your game it's hard to judge the circumstances. Terrain is an issue that can be worked into your favour, but generally, the AI can bring 3+ siege and can now take your cities in under 3 turns with ease.
 
let's allow stacks just for the AI

As for Civ5, the problem for the AI will always be the human will manage its troops better and they will need to rely on numbers, and that's always been the argumrent for Stacks (that the AI can bring together more numbers) in one spot, and it's a fair point to make.
 
That hasn't been my experience.

Then I would like to wait for the experience reports of others, since in this current game all three enemies (Ramkhan, Bismarck and Hiawatha are all doing exactly the same: attacking with too less units, stupidly moving them, sending workers into my territory, leaving the siege weapons alone).

Granted, the combat AI never was even mediocre, but this time it is extraordinarily bad.

I mean, based on my experiences from last year, I wasn't exactly afraid when Ramkanheng attacked me, although I just had 2 warriors and 1 archer (upgraded scout).
When Bismarck joined, I thought "Ok, now I should be a bit careful, perhaps!"
Then I crushed both their invasion forces, pushed Siam back and had to move my whole army from south to north to meet Hiawatha.
In total I have lost 1 warrior due to not being aware that cities can shoot over forests, one horseman since I moved it too much forward so that it was attacked in total by four units and 1 swordsman at a city attack.
All three losses I could easily have avoided (my fault) if I would have been a bit more careful - and that is exactly the problem: I am not concentrated in this game anymore, as I will win the battles anyway.
I have stolen like 10 workers from the three nations and have already started to kill three of them to reduce troup maintenance.

And there isn't any challenge. I see them coming, may it be combat units or workers, I crush them or capture them and that's it. It is kind of frustrating to be enabled to do so. It's like slapping a group of 6-year-olds into their faces, over and over again.
It is even not fun. :sad:
 
well first someone must code in a unit manager so the AI's units could work in tandem and not wander around on their own. this is a must, otherwise everything below is simply not applicable

+1 to brute force method

the idea is simple:
1) to go through all the permutations of involved units' positions and/or attacks to find the moves/attacks by units that result in the { our total effective hammers(aeh) - opponent's total effective hammers(oeh) }(#)

next the AI should switch sides and repeat 1). let's call (#) for this step (##)


what the AI ultimately ends up with is a matrix(rows what AI did, columns how opponent reacted) that can be min-maxed, but for simplicity avg { (##) } -> max is fine imho
inversely opponent seeks avg { (##) } -> min

an artificial example:
Spoiler :

1 AI unit(au), 1 opponent's unit(ou).
unit's generic stats: 100 hammers, 100 hp e.g. full, 40 attack damage, 20 counter-attack damage, 1 movement

fortification gives +50% to counter-attack damage and -50% attack damage.

situation:
ou is fortified and au stands adjacent to him. it is au's turn to act

NB as you may notice initial (#) for the AI is -100 as ou is fortified increasing his eh to 200. if au forces ou out of fortification, he gains 100 in (#) without(!) even attacking :D

au(as any unit) can (by row):
  • (1) move(skip turn is the same in this context), but stay adjacent to ou -> (#) = -100
  • (2) move way from ou -> (#) = -100
  • (3) forify himself -> (#) = -100(initial) + 100(fortified status) = 0
  • (4) attack -> (#) = -100(initial) + 40(attack itself) - 30(counter-attack: 20 + 50% fortified bonus) = -90

indices are in the form (rc); r = row, c = column

opponent reacts to (1)
  • (11) ou looses his fortified status prior to moving (##) = 0
  • (12) ou looses his fortified status prior to moving, but cannot be reached by au next round (##) = 0
  • (13) skip turn option goes here, since ou is fortified already (##) = -100
  • (14) attack -> (##) = -100(lost fortified status) + 40(attack) - 20(counter-attack) = -80

opponent reacts to (2)
  • (21) same -> (##) = 0
  • (22) units move away from each other -> (##) = 0
  • (23) same -> (##) = -100
  • (24) n/a

opponent reacts to (3)
  • (31) au and ou switch sides from initial position -> (##) = +100
  • (32) same -> (##) = +100
  • (33) both units are fortified -> (##) = 0
  • (34) swap sides(e.g. signs) in (4) -> (##) = +90

opponent reacts to (4)
  • (41) move, but stay adjacent -> (##) = -10
  • (42) same -> (##) = -10
  • (43) skip turns -> (##) = -90
  • (44) attack -> +80(-50% of eh for loosing fortified status) - 40(attack) + 20(counter-attack) = +60

results:
(1) -> with (#) = -100 & { -100 <= (##) <= 0 }. 4 * avg = 2 * 0 + 1 * -100 + 1 * -80 = -180
(2) -> with (#) = -100 & { -100 <= (##) <= 0 }. 4 * avg = 2 * 0 + 1 * -100 + ? = -100 (?)
(3) -> with (#) = 0 & { 0 <= (##) <= 100 }. 4 * avg = 2 * 100 + 1 * 0 + 1 * 90 = 290
(4) -> with (#) = -90 & { -90 <= (##) <= 60 }. 4 * avg = 2 * -10 + 1 * -90 + 1 * 60 = -50

(3) is a clear winner. as you can see (#) -> max should be a pretty good heuristic. another observation is that the most numerous options, e.g. (1) + (2) are the worst.
 
But I dont think that will really work, my unit positioning depends:
1) Location of enemy units
2) Terrain
3) My units

So a rule book would be incredibly complicated. For example, you said that siege units should always be guarded. I disagree, when I get artillery, I place them on the front line, so they can hit cities without being hit themselves.

That's actually why I think it would work. We all play differently and employ different strategies to achieve the same result, but every situation is different. The current AI model doesn't deal with those differences and just barges on ahead the same way over and over and over.

Whilst I completely agree that predetermined strategies would be a massive undertaking, particularly in research terms and subsequent coding, the benefit would be that the AI understood what it was doing a great deal more and it would have the capability to simulate, if not actually be, creative in it's strategic planning.

I'm not proposing that the AI should have a handful of strategies that it can just delve into, more a database that it can filter through to make use of the differing terrain, unit strength, enemy placement/type etc and understand how to handle those situations as an overall problem, rather than an individual unit issue.


For example, I recently had to build a list of proper names and match data from several spreadsheets into it. The first issue was getting all of those names in a correct format.

Names were arranged as Smith, John; Smith John Thomas; Smith-Harrison, Johnathon T, John T Smith etc etc. So I had to build a network of formulas to teach the spreadsheet how to understand how names work.

Basically, I replicated across a spreadsheet how I would determine what a surname is and the criteria I'd use to make that determination. Breaking it down into sections, testing it against known criteria, calculating length and punctuation variables, checking to see if there was a match in the existing list of first and middle names if it got stuck etc. The result was that the spreadsheet can now take a name in any variation and identify the first names, middle names and last names are based on it's thinking process across ~70 conditions and then apply the rest of the data.

That's kinda what I'm proposing here, you enable the AI to understand issues by breaking down the full situation and then apply that understanding to it's experience. The key difference is that AI would have that databank of experience to draw from. It would know that in a given situation X works better than Y but not when Z is going on unless you have A B and C, rather than simply building a unit and sending it out based on strength and function alone and brute forcing it's way to victory.

You would probably have to have a fairly hefty team of people to do the groundwork, but I seriously doubt there is another way to stop the AI from being a mindless unit producing drone and actually present a challenge to players from a tactical standpoint.

But then there's probably also a good reason why they program games and I program VBA! :crazyeye:
 
But I dont think that will really work, my unit positioning depends:
1) Location of enemy units
2) Terrain
3) My units

I agree that ultimately, it will require brute force/optimization to get it to work better.

I also find AI performance with combined arms is very uneven. They do best on flat terrain (no mountains that muck up positioning or create congestion)

In my current game, I was taken completely by surprise when the 1 artillery parked out of range of my units to kill in 1 turn multiplied into three within turns and the next thing I knew I lost my recently conquered city. The AI does appear to understand concepts of attack range (of your units) and this is one area I've noticed a marked improvement is their ability to place artillery in choice spots for set periods.

Where they fall down is that the AI can often be baited to abandon their position and attack - usually with insufficient numbers. Alternatively if the human player decides to take the chance of losing units and charge right at their defensive line, the AI tends to fallback in disarray and do not have a secondary fallback position from which to regroup. So I've found the best way to stop an invasion is to attack as soon as possible and interrupt the AI's positioning of their units.


One last observation. I've seen the AI take their train of Trebuchets and melee units pass a narrow gap in along train then swing around into position with sierge units and land units positioned in a classic setup. This works fine if they are setting up for a surprise attack but not when they're in hostile territory.

So I do think at some level the AI has a map of where they need to position units. Their issue is getting to that 'AI calculation' position can often be interrupted by human actions and they do not have a good secondary position to work from and get caught in shooting gallery type situations where they keep running units through a gauntlet to get to that predetermined position.
 
Back
Top Bottom