Having written a completely new AI for the Decisive Campaigns engine I can restate with confidence that writing an AI (artificial intelligence) for a wargame is without doubt the hardest part of making a complex strategy game.
Not only is it incredibly time intensive but also incredibly difficult. While designing the AI I stumbled over almost philosophical questions like “how does the human brain work when it is plotting its moves?” Questions that are hard to answer.
The new AI that I designed was radically different from the AI that I did for Advanced Tactics. Instead of letting the AI follow a number of complex fuzzy rules I split up the AI in a “move planning” part and a “move analysis” part. Instead of coming up with a move for the AI and executing it immediately I would let the AI make a prognosis of how well that move would probably do and assign a score to it. Then it would come up with more new “move plans” partly based on the highest scoring move plan so far and eventually after X iterations it would execute the best scoring move plan.
The result of this new approach was much better then the old approach but required me to do a lot of code speed optimizations and scoring rules balancing for the AIs “move analyzer”.
The “move analyzer” scores each move for hexes held, hexes conquered, entrenchment gained, enemy units attacked, encircled, etc… and the cool thing about this method is that it is very hard to predict the exact AI reaction to any given situation since numerous rule based rewards and penalties compete with each other to guide the AIs behavior. This makes it possible for the AI to come up with moves that make compromises or trade-offs between conflicting goals.
Granted the AI could still do better and it is still no good match in an equal situation when facing a good human player, but in that respect AI designing for wargames will always remain a mission impossible. Consider chess computers after dozens of years of research still have difficulty winning from top players while chess is a game with only 32 pieces and 64 fields where 1 piece moves per turn, while for example the Case Yellow scenario in DC:Blitzkrieg has 600 pieces and 15.000 fields where all pieces move every turn. Do you see the different level of complexity and permutations?
All in all I have to say I am very happy with the AI that I shipped with DC:Blitzkrieg. Release will come soon and I hope the players will agree with me.

Hi Vic. Interesting post. I’ve been working on an Excel based AI for production descisions in AT. Basically I’m playing a reigme in “dummy” mode and using the spreadsheet for the produciton descisions.
One thing I’ve been toying with in that spreadsheet is the “seen” or “known” units that the AI has encountered. It keeps a tally on the forces it has seen or come into contact with as one of the parameters it uses to evaluate what to do with it’s production points.
I established all the parameters in exactly the same way as you describe, by asking myself “How do I normally make these descisions ?” and trying to break down the problem starting from there.
One thing that bothers me a little about the approach you’ve outlined is how much does the AI get to know about each of it’s moves before it makes them ? Isn’t this essentially giving the AI a built in advantage over the human ?
Nope. Its just weighing different probable outcomes against eachother.
How FOW rules apply to AI is more interesting though as it is very tempting to go just give it some partial info with some errors put in instead of making a huge algorithm to actually come to the same sort of conclusion.
When more people start playing DC:BLITZKRIEG I am looking forward to more AI feedback and will try to adjust the perceived AIs weakpoints.
I hope the AI handles the German Paratrooper and Airlanding troops beter than the other games we already have on this subject.
Can you offer insights into how supply is handled with airborne landings? How do you handle airborne landings. (morale / initial confusion / mixed units). In HPS’s First Blitzkrieg the fallschirmjager land fully organised and at fullstrenght. I would prefer airborn units that are weak after the initial landing (but with the ellement of suprise). Over time the units would get more organised and stronger.
BTW Is there a scenario/card option to leave the 3 LK defending the Peel-Raam line?
Airborne landings give uncertainty in the fact you do not know which exact hex they land on. Otherwise there is no different handling except for the fact they dont get Corps level bonus in most cases.
You can choose your own deployment of Dutch forces using the “free deployment” variant.
Best regards! Vic
“How FOW rules apply to AI is more interesting though as it is very tempting to go just give it some partial info with some errors put in instead of making a huge algorithm to actually come to the same sort of conclusion.”
Sorry, I’m a bit of a noob with the wordpress software.
The comment above is what I was trying to understand. If the AI has no advantage over the human in terms of it’s ability to see into the FOW, how can you apply a probability or numerical score to the potential moves ?
So, this works only without a shroud, but with FOW ? I think I see now.
But I’m still curious how the individual moves are assigned a value when the FOW prohibits any knowlegde of what units are in the hex ?
Let me answer with a question. Does it matter if the AI does move A using a complicated prediction mechanism or that the AI does move A using FOW cheating but with some random errors thrown in? Does the method matter or the resulting behaviour?
Ahh I get it now. The light is on.
The question is a little bit philosophical I suppose. I like the idea of the random error tossed into it, that solves the practical problem, (user perception of cheating AI) and in a sense reintroduces the FOW. Interesting.
It will be interesting to see how people interpret the AI moves. I can envision unpredictability to be a likely result. That may be enough, (combined with some ‘rationality’ in general) to keep people entertained.
I guess it will be interesting to see how the unpredictabiity and it’s results are exploited in subsequent turns.
Thanks Vic for the insight. I wasn’t trying to make trouble for you, it’s just that I’m very curious.
Is the random error used with FOW ‘just’ random or does it use some of the other info like being more likely to spot new units near the front line.
Is it random for every turn or does it remember previously sighted units. I would think that spotting a main axis of attack on one turn and losing the sighted units the following turm would make an AI dance the samba….
Vic,
I think the AI in Decisive Campaigns does a pretty good job and I commend you on how well it works. I have been playing computer games for over 30 years now and I have seen some pretty terrible AIs in my day (one space game I bought years ago essentially had no AI at all). The DC AI is one of the better ones I have seen, although like all AIs it does a better job on defense than on offense.
On defense, the AI does a good job at extracting units from precarious positions, building defensive lines and getting units to threatened areas. It only does a fair job of defending critical positions though. For instance, in my last Case White game against the AI, the Poland city center was only defended by the WAR HQ and two artillery units. Not a huge drawback, but something that might be worth tweaking.
The offensive AI is not too bad as far as AIs go. I know it is hard to design a good offensive AI that doesn’t make a lot of stupid mistakes, like leaving units unsupported, and the AI does a good job not making stupid mistakes like that.
One of the areas the offensive AI could use a little work on is in cutting off and destroying isolated units. I have had a few instances where units were able to escape certain destruction because the AI only made a halfhearted attempt to attack and/or surround them. During my testing for you recently I had the opportunity to watch the AI sometimes completely surround a couple of isolated Battalions and then make a weak attack, sometimes it would not surround the stack and just bombard it and sometimes it would almost act like the stack wasn’t even there.
Another area that could use a little work is in advancing in an area where the enemy is weak. I have had a few instances where only one Battalion was able to delay an enemy Divisions advance because the AI seemed to be more concerned with keeping units close together than in advancing or even attacking the isolated unit. I know this behavior is keeps the AI from having unsupported units and that it is a tradeoff between caution and aggressiveness, but I think this area of the AI could use a little work as well.
Lastly, the AI does a pretty good job making local attacks when it is on the defensive, slowly funneling units forward into weak areas of the enemy lines. However, it often leaves the neck of the advance weakly supported, allowing the advance to be cut off and surrounded. However, if the neck isn’t closed properly, the AI does a good job extracting the nits in the salient.
Just thought I would give you my impressions of the AI in DC.
Mark Oakley
AKA RocketMan