Post-Play'em - Observations on Game AI

Posts Tagged ‘squad’

Company of Heroes: My First Look

Saturday, February 7th, 2009

Well, now that I’m finished writing my book, I am grabbing a few demos of games that I really need to take a look at. I pulled down the free demo of Company of Heroes off of Steam the other day and have had a chance to putz with it a bit.

One of the reasons that I wanted to see CoH was the articles by Chris Jurney in AI Game Programming Wisdom 4. He wrote up a pair of articles on the pathfinding algorithms that they used–one for constructing realistic turns for vehicles and one for the ‘leapfrogging’ of squads. Both are good reading.

Anyway, I haven’t touched an RTS since Empire Earth (which chewed up way too much of my time in its day). It took me a bit to get back in the RTS groove. I was immediately impressed by the way the squads moved, but perhaps that is because I was looking for it. Also, they seem to react well to the unexpected. One concern that I had was how they didn’t seem to always go for cover when I would have expected them to. Despite having plenty available, sometimes they would hang out in the open. This is more alarming when 4 of the 6 squad members are in cover nearby but the other 2 don’t go. It makes me briefly wonder if the value being tracked is the amount of cover per squad rather than per soldier. I will have to investigate further on that (or just ask Chris when I see him next month).

The vehicles, as well, move admirably. Calculating vehicle movement on the fly (in a destructible environment!) is, indeed, a pain. Again, I will observe more, but they seem to do fairly well. The tanks have the advantage of being able to turn in place. However, the jeeps and trucks do not have this luxury and need to plan ahead lest they find themselves unable to make a turn.

On the 2nd campaign map (with the 3 bridges), I noticed some serious influence map work going on. As I got my bridge defenses shelled (and failed to rebuild quickly), the offensive seemed to shift to that bridge. As I reinforced it at the expense of another bridge, they seemed to shift to the one I had borrowed from. Now, with the fog of war in place, I don’t know for certain that is what happened. They may have been hanging out over there and just were able to push forward when I moved away. I will have to see if there is a replay mode that shows the enemy.

Sometimes I wish that the squads were a little more autonomous. There are times when I wish that they would take some more initiative with their orders. When I give them orders, everything is cool. I can tell a squad to attack/move all the way across the map and they will engage and move repeatedly until they get there. However, if I only give a unit partial orders, they will wait patiently until I get back to them… even if that means standing in the middle of the street.

One example of this is when I had an anti-tank artillery unit pointing one direction with no target and a tank started firing at them from behind, they didn’t turn around. While sticking to my orders is cool and all, some intelligent reactive behavior would have been warranted there. I’m not sure if this aspect is more of a design decision than a failing of the AI, however.

Again, I need to play with the game a bit more to get a feel for it. Right now I am spending more time noticing what I am doing rather than what the AI is doing.

(If you jumped into this article, you may want to click the “Company of Heroes” tag below to see if there are more observations on it.)