AI competance in games - How much development resources go into AI?

There’s nothing like having a compiler engineer (or two!) on staff.

I like Charle’s comment that the trick is making the AI “dumb” in a realistic, human manner that doesn’t feel like cheating. Chess is a great example: when chess programs for the PC first appeared, they were great at openings (book programmed in,) great at pure tactical mid-game as long as there wasn’t a sacrifice or combination that went too many moves deep, and really, really sucked at the end-game. Eventually chess programs became so good, as the power of the computer grew exponentially, that it was hard for a good player to feel like they’d accomplished much when they’d win a pawn because they knew that the computer had to have calculated and seen that coming and intentionally allowed it. It could feel like a random number generator decided when to allow the player to win.

So how do you make an AI that wins via human-like moves and loses via human-like moves? Lots of papers written on this, I’m sure. I’d imagine that one approach is to try to determine just how “smart” a good human can be in a particular game (wrt all of the factors that go into a decision) and try to limit the AI to that level of “intelligence.” And then do the same on the mistakes side - for example, are there emotive factors that can suboptimize a player’s choices? If race 1 betrayed a treaty with me, am I going to go after that race even more than a calculator would tell me I should if I was purely and coldly trying to win the game? Etc.

Must be a facinating area in which to work.

AI is a loaded phrase, because it means so much to so many different people. Some designers think they’re doing “AI” when they’re just modifying and wiring triggers. Some programmers think they’re doing “AI” when they’re just writing path finding. Some programmers/designer think they’re doing “AI” when they’re setting up a structured system of hierarchical goals. Hell, animators think they’re doing AI because their work is what makes things look real.

They’re all AI but all different as well.

AI really breaks down into three related areas:

PATHFINDING: This has traditionally been the really hard part of AI which is why it always tends to get its own bullet point. It’s a lot better researched today than it was 10 years ago, and while it’s a ‘solved’ problem it’s still problematic to implement. “Getting from here to there” can be very tricky, and how you do it depends a lot on the genre. Think of this as one of the “HOW” elements of AI.

INTELLIGENT DECISIONS: This is the strategic element. It’s the “What” and not the “How”. Deciding whether to go after ammo A or weapon B; deny location A or attack location B; retreat for health or go for the kill, possibly suicidally; duck behind cover instead of just standing upright and firing; using grenades when appropriate, but not at point blank; etc.

Intelligent decisions are depending upon effective path finding.

BELIEVABLE BEHAVIOUR: This is really two elements, a combination of being intelligent (don’t do obviously non-sensical things, like staring at a wall or just ignoring a player that attacks you) and being ‘intelligently dumb’ (don’t have 100% accurate fire).

For example, don’t always go with the optimum decision in min-max scenario and sometimes go for the reckless route with more reward…

This also means incorporating personality. Human players have different personalities, often to the point of hurting their abilities. Maybe they have a preference for a certain RTS unit or weapon, or maybe they’re overly aggressive or defensive. You have to incorporate style into the behaviour tree if you want it to feel human.

Believable behaviour is dependent upon intelligent decisions.

Bacon - that’s a good write-up of the differing areas.

Several posts talked about believable AI… one that makes human mistakes. I have a concern about that and I’ll use “Star Wars Empire at War” as an example. My concern is if an AI team believes they want to go for realistic AI before they’ve gotten the basics down. Right now in SW:EAW the AI is easy to beat, and the only challenge is when they give the AI lots of cheats. For the game player - that sucks. So in this case an AI that was robot like in it’s implementation would be legions better that what we have now. However in other games that would be OK… but competetive AI HAS to be there first.

Now one thing I hates about Ghost Recon was that you were always hit 100% of the time and always killed. I hated that. In their case, they totally should have worked on it, so it wasn’t so fake, and even if the AI shots were made much worse, it’d still have been better than the one hit you’re killed scenario. I also think in the case of Ghost Recon, they could have fudged it the system and insititued a generic % for hits that truly required no so-called “AI”.

For pathfinding suppoesdley being so fleshed out, there’s still a fritening amount o games with poor pathfinding, and fps’s with people trying to run through walls, or staring at a wall.

As I recall, the AI in Ghost Recon used exactly the same firing code you did.

They just took higher percentage shots by waiting until they had a good shot at you.

Right. You gotta be able to do the basics before you can do the advanced stuff.

For pathfinding suppoesdley being so fleshed out, there’s still a fritening amount o games with poor pathfinding, and fps’s with people trying to run through walls, or staring at a wall.

Staring at walls is a behavioural thing, not really path finding. But path finding in a full 3D environment is still very challenging, a lot more challenging than dealing with a 2D situation a la Baldur’s Gate or an RTS. Throw in portals, moving lifts, elevators, locked doors, etc. and it becomes a mess.

I hated that. In their case, they totally should have worked on it, so it wasn’t so fake, and even if the AI shots were made much worse, it’d still have been better than the one hit you’re killed scenario. I also think in the case of Ghost Recon, they could have fudged it the system and insititued a generic % for hits that truly required no so-called “AI”.

So you want the AI to cheat to punish itself? They had clear shots at “you”, why should they have missed?

I was going to write a big thing about how good AI is supposed to “seem” realistic, not actually be realistic, because it would suck ass to actually try to take on an army of enemies with the skills and tactics of a real human being, but I am sure you already know this. If an enemy’s AI works out such that it’s more annoying and frustrating than interesting and (deep breath, pause) fun, it’s “bad” AI regardless of how realistically modelled or non-fudged it is.

I was going to write a big thing about how good AI is supposed to “seem” realistic, not actually be realistic, because it would suck ass to actually try to take on an army of enemies with the skills and tactics of a real human being, but I am sure you already know this.

Yep, you’re right, I do know this already. I was just trying to ram home exactly what you’re saying - we don’t want perfect AI that doesn’t ‘cheat’ to make the game more ‘fun’ - jpinard seems to want it though.

This raises an interesting point about AI. If the AI is good enough at playing the game, players tend to assume that it is cheating.

Chris Woods

I’d say the way around that is giving the players logs after the game to see the AI’s choices and see it’s all real. Also really interesting seeing the AI deciding what to do.

-Shiroko

Why?

First, if you don’t trust the game not to cheat in the game, why do you trust it not to cheat in the log?

Second, if the artificial opponent isn’t fun to play against, why would you care if it was unfun for a good reason?

Third, if the artificial opponent is fun to play against, why would you read the log rather than play the game?

That feature would be a serious waste of effort.

–Dave

I don’t. I only accuse the AI of cheating after I see it first-hand (Heroes of Might and Magic 1-4). Otherwise I’ll just assume I suck. :)

After writing an AI that does not cheat, I kinda have become an advocate for cheating AI’s. The complexity of almost everygame from my perspective makes it a waste of time to write a straight AI.

The task is to not let the player know it is cheating.

Huh? Some cheats are OK (like AI knowing what is where, how much, etc) - but resource and money cheats suck on normal difficulty levels.
Keep in mind once the player knows or figures out the AI is cheating (on medium/normal difficulty levels), it ruins the remaining single player experiece.

What game did you work on?