Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

What do you feel is the primary goal of AI design in games? (Please expand on your vote.)

Immersion.
Challenge.
Complexity.
Ability to run on any system.
Undecided.
All are equally important.
Other.
Don't care.
View poll.

Pages: [1] 2 3 4

Author Topic: Goal of AI Design for Games?  (Read 2945 times)

Farseer

  • Bay Watcher
    • View Profile
Goal of AI Design for Games?
« on: January 28, 2011, 11:18:03 am »

This is an argument I was having on the Paradox forums. I was saying that EU3's AI in Divine Wind is worse than it's AI in Heir to the Throne due to, seemingly, stripping back much of the hidden computations that it did and having a massively reduced "personality" due to the various hardwirings of decision making that got programmed into it.

Eventually, we got into a discussion and I said that I did, in fact, believe Civ 4's AI was better than EU3's current implementation due to the fact that at least Civ 4 had a varied decision making structure (even if it was equally deterministic to EU3's) between the various civilizations. There was no complex decision making, but there was, at least, a difference between fighting one civ and the next.

So, I'm wondering what all you guys think the most important parts of an AI within games are? I've always thought that my concept of what an AI should strive to be was industry standard, but it turns out it is not. :p#

What I think an AI should do (in semi-order of importance):-
  • Not have it's "wiring" on show. By this I mean that the AI shouldn't be an obvious AI. This counts major bugs, obvious computations / cheating ("hi player 1, I shoot you from 30000 miles away through dense wilderness because you came into my line of sight which is technically possible but in reality impossible") and anything that breaks immersion.
  • Be capable of giving the player an enjoyable experience through a human-esque AI personality wise. By this I mean it should have a "character" that determines what it's foibles are. Imagine Montezuma in Civ4. He made absolutely ridiculous war declarations because that was how he was programmed.
  • Advanced decision making. A risk versus reward system or a complex coding system which both makes the AI unable to be exploited and capable of rationalising what it's going to do. In EU3, the AI does the exact opposite of this. It is a deterministic AI, everything is hardcoded. There is no real decision making. The AI can't see a juicy colony and go "Screw our +200 relations, if they don't give me that colony I'm declaring war!", it just stays quite happy how it is.
  • Capable of running without major system slowdown. I can understand why, due to this factor, the EU3 AI isn't considerably more advanced. Whilst you could do more complex AI in a turn-based game, EU3 is running constantly, so the AI can't just do decision making on their turn. I don't see why they couldn't have put in a monthly "target" system, though, I doubt anyone would've complained about slowdown once each month.
  • Capable of providing a sufficient challenge to the player. Everything else would hopefully contribute to this, but I'd happily have the AI cheat the shit out of the game if it just had everything else included. Yes, I prefer gameplay to difficulty, and isn't it weird to hear it described like that? :p

The guy I was arguing with seemed to suggest the sole and primary goal of AI design should be difficulty with a minor focus towards system slowdown. Regardless of immersion breaking, if the game didn't provide a challenge then the quality of the AI programming doesn't matter. I found this very, very odd.

So, what do you guys think the goal for AI design in games is?

Duke 2.0

  • Bay Watcher
  • [CONQUISTADOR:BIRD]
    • View Profile
Re: Goal of AI Design for Games?
« Reply #1 on: January 28, 2011, 11:55:36 am »

 Ain't nothing human about those mutas Overmind uses. To some extent a computer AI needs to know when to not use it's computer-fast ability to manipulate units in a way humans cannot. As cool as it is I know it's extremely annoying to see a computer control a bunch of units because the interface for me cannot handle doing such actions.

And keep in mind friendly AI. Like Company of Heroes, where the troops would sort of do stuff on their own without your control. They fight for survival and take cover. And while this can lead to squads retreating back to base and bizarre things you didn't intend some amount of AI for making games less tedious micro-fests is increasingly necessary nowadays.
Logged
Buck up friendo, we're all on the level here.
I would bet money Andrew has edited things retroactively, except I can't prove anything because it was edited retroactively.
MIERDO MILLAS DE VIBORAS FURIOSAS PARA ESTRANGULARTE MUERTO

Farseer

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #2 on: January 28, 2011, 12:06:42 pm »

Ain't nothing human about those mutas Overmind uses. To some extent a computer AI needs to know when to not use it's computer-fast ability to manipulate units in a way humans cannot. As cool as it is I know it's extremely annoying to see a computer control a bunch of units because the interface for me cannot handle doing such actions.

The micromanagement isn't human, but the system it uses (the decision making process with the risk vs reward rings etc) is definitely human-like in complexity. It also moves so smoothly that it's almost biological in the way it works.

And, yes. I can entirely empathise with the "computer controlling in a way people cannot" thing. :p That's one of the issues with Divine WInd.

And keep in mind friendly AI. Like Company of Heroes, where the troops would sort of do stuff on their own without your control. They fight for survival and take cover. And while this can lead to squads retreating back to base and bizarre things you didn't intend some amount of AI for making games less tedious micro-fests is increasingly necessary nowadays.

See, I'd quite like to give at least some control over to an AI in a lot of games (Starcraft comes to mind, I'd love to manage base building and grand tactics and leave the micromanagement to the AI).

I should try out this Company of Heroes. :p

Duke 2.0

  • Bay Watcher
  • [CONQUISTADOR:BIRD]
    • View Profile
Re: Goal of AI Design for Games?
« Reply #3 on: January 28, 2011, 12:12:07 pm »

 I sort of lied a bit, the company of Heroes troops can't retreat on their own and their only real AI is using nearby cover and splitting up to utilize it well. I don't have much experience with the hostile AI though.

 And I wouldn't say that the Overmind is very much removed from other AI's that are developed. The whole zone zones of attraction and repulsion feels like another behind the scenes mechanic that is too open-ranged for humans to recognize or utilize correctly. He has some tasks hard-coded for the game(Set up base, cover map with overlords, expand, etc) that have some slight deviations allowable but still rather hard in there and a horde of units that simply look for another target while avoiding things too hard for them. I dunno. When an AI can reason "If I attack here they will draw out their units so I can do this" I'll call it revolutionary AI. This feels more like some very good tricks.
Logged
Buck up friendo, we're all on the level here.
I would bet money Andrew has edited things retroactively, except I can't prove anything because it was edited retroactively.
MIERDO MILLAS DE VIBORAS FURIOSAS PARA ESTRANGULARTE MUERTO

Farseer

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #4 on: January 28, 2011, 12:35:49 pm »

And I wouldn't say that the Overmind is very much removed from other AI's that are developed. The whole zone zones of attraction and repulsion feels like another behind the scenes mechanic that is too open-ranged for humans to recognize or utilize correctly. He has some tasks hard-coded for the game(Set up base, cover map with overlords, expand, etc) that have some slight deviations allowable but still rather hard in there and a horde of units that simply look for another target while avoiding things too hard for them. I dunno. When an AI can reason "If I attack here they will draw out their units so I can do this" I'll call it revolutionary AI. This feels more like some very good tricks.

The Overmind just utilises the resources it has very effectively, which is why it's considerably better than a lot of AIs on the market. You have to remember that it's also not allowed to cheat (every AI in every single game I've ever seen has cheated with bonuses in some way or another) and is capable of beating either humans or other AI of an equal programming level.

I think it's tasks have a lot more leeway (watch the video where he shows zones of attraction, it also shows some of the problem solving methodology and a "timeframe map" which sets up what tasks the AI should complete as it goes along) than other AI, too. It's not overly complex, but it prevents it getting stuck in a feedback loop if an unforeseen event happens (like he said in one of the videos, a human player dropped a vespene geyser before the AI could which ended the map right there and then).

My point on the zones of attraction is that it's a mechanic that a lot of other AI designers should take inspiration from. On the colony example: It'd be risk (determined by known troops nearby and size of the nation that owns the colony) / reward (determined by how prosperous the colony would make the nation percentage wise over a certain timeframe) and if the value is over 0.75 or something the AI immediately declares war. If it's between 0.25 and 0.75, the AI waits to see if circumstances improve over a certain timeframe and if a number of similar results occur within a timeframe (over 5 years the AI sees 0.6, 0.5, 0.61, 0.59, 0.55) then it launches an attack nonetheless.

This alone would give a complexity much larger than the current AI used by a lot of developers which, as said, is very deterministic. In EU3, the AI will usually declare war simply on nations it "hates" when it has the casus belli to do so. There's usually no real reward for it. It just does it for the sake of it due to it's programming. Which leads to things like a little tiny nation near you declaring war on you just because it hates you, and getting insta-annexed by the player.

And, sure, I'd love that level of AI. Unfortunately, most players aren't even that smart. :p If the AI did feints, like you said (false strike at one of the minor resource collecting bases in SC to draw troops there and then attacking / harrying another base), then that would be amazing. It's unlikely, though, simply due to how system intensive it would be. The Overmind guys said they could've done a lot more if they'd had the resources but they were experiencing system lag allowing the AI any more computing power for whatever reason.

Duke 2.0

  • Bay Watcher
  • [CONQUISTADOR:BIRD]
    • View Profile
Re: Goal of AI Design for Games?
« Reply #5 on: January 28, 2011, 12:41:31 pm »

 I'm rather sure the feint was an unintended side-effect of going after the tanks that were moving out to avoid the mutas, then when the tanks were dead and the goliaths were moving out the repulsion of the anti-air units and the attraction of the SCV's simply drew them away. The AI was not working for such a reaction, it just sort of happened.

 And I know that this is all some very good tricks for other AI designers to use, but it still feels like a lot of old concepts put together in an implementation like this. I know other AI designers have been utilizing zones of repulsion and attraction before, it's just that a lot of designers for games don't use them.

 Although ultimately we are nitpicking on small details here. It's impressive that they did this in such a complex simulation and avoided any major hang-ups. And it is brutally effective. I just see it more of a accumulation of previous concepts developers were either too lazy to add or didn't think to add despite knowing of the idea.
Logged
Buck up friendo, we're all on the level here.
I would bet money Andrew has edited things retroactively, except I can't prove anything because it was edited retroactively.
MIERDO MILLAS DE VIBORAS FURIOSAS PARA ESTRANGULARTE MUERTO

dogstile

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #6 on: January 28, 2011, 12:46:48 pm »

Actually, on the company of heroes AI. The AI will move up and use cover on its own, but only if you told it to attack a unit.

For example, if I tell my unit to attack a group of germans, and the germans retreat the better cover, my unit will chase, and when the germans stop, they'll duck behind a conveniently based barrel or wall.
Logged
my champion is now holding his artifact crossbow by his upper left leg and still shooting with is just fine despite having no hands.
What? He's firing from the hip.

King Cow

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #7 on: January 28, 2011, 12:49:15 pm »

One problem is that making AI more 'human' often means programing it to make mistakes like a human player would. Most people are not actually as good as they think they are without reloads. This always leads to people accusing realistic AI of being too easy and stupid.

I noticed this in MTW2 the tactics used by the AI are actually pretty close to real medieval tactics(which were pretty simple and not very advanced), but the human player being behind a computer screen and with practice knows better. So people accuse the AI of being dumb and not human enough.

Do people want a human like AI that is a bit stupid (like most of us) or a great player super AI to challenge us?
« Last Edit: January 28, 2011, 01:08:22 pm by King Cow »
Logged

Muz

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #8 on: January 28, 2011, 01:05:09 pm »

Umm.. goal of AI is to simulate people. The actual goal depends a lot on the game itself. I mean, if you have a game like pong or Starcraft, simulating personality is not that important. Whereas in games like EU3, you'd want them to know how to play the game and have a personality because it also involves politics and has to simulate working with people.

IMO, it should just be believable and capable of playing the game the way it's meant to be played. Obviously, better that you don't see the strings and can't manipulate it. But it won't get to that stage, which is why multiplayer games are so much better.
Logged
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Farseer

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #9 on: January 28, 2011, 01:08:19 pm »

I'm rather sure the feint was an unintended side-effect of going after the tanks that were moving out to avoid the mutas, then when the tanks were dead and the goliaths were moving out the repulsion of the anti-air units and the attraction of the SCV's simply drew them away. The AI was not working for such a reaction, it just sort of happened.

 And I know that this is all some very good tricks for other AI designers to use, but it still feels like a lot of old concepts put together in an implementation like this. I know other AI designers have been utilizing zones of repulsion and attraction before, it's just that a lot of designers for games don't use them.

 Although ultimately we are nitpicking on small details here. It's impressive that they did this in such a complex simulation and avoided any major hang-ups. And it is brutally effective. I just see it more of a accumulation of previous concepts developers were either too lazy to add or didn't think to add despite knowing of the idea.
Oh, I'm not saying the Overmind did feints. It certainly doesn't since it just makes a mass of brutally micromanaged mutas and uses them to slaughter everything whilst using any of it's additional resources (upgraded speedy zerglings if it has any left or drones if it doesn't) to check for additional bases. It's base macromanagement is absolutely amazing, too. :p

And I think I understand what you mean. You're saying the concepts have been around for a long time and so it's difficult to be impressed with an implementation of them. But sadly that's the state of AI development in gaming. Sure we might get the occasional basic game concept with advanced AI (the learning soldiers from that tactics game come to mind) but it's usually in a very basic game environment. When you introduce so many factors like Starcraft does, it usually doesn't get implemented.

I do understand that it's hard to get excited about when it's really not all that revolutionary, but it is a very advanced evolution of the concepts that's implemented in a fairly detailed environment. To me, the feint thing would probably seem very trick one trick pony like (since all it is is a simple "If Force Value in Area X ≥ Value 1, then move units to Area Y and create Value 2. If Force Value in Area X ≤ Value 1 and we have Value 2, then move units not in Area Y to Area X" or something along those lines) unless it was backed up by a lot of other complex AI.

The trouble is that commercial games usually don't allow a great deal of leeway in AI design. AI has to be at the usual industry standard or things could go wrong with it's implementation, which means game companies don't usually get a great deal of revolution in AI design, which is unfortunate because they have the most money.

I noticed this in MTW2 the tactics used by the AI are actually pretty close to real medieval tactics(which were pretty simple and not very advanced), but the human player being behind a computer screen and with practice knows better. So people accuse the AI of being dumb and not human enough.

Do people want from a human like AI that is a bit stupid (like most of us) Or a great player AI to challenge us?

I think the issue is a combination of both the fact that the AI can be very, very incapable in the Total War series (like routing and trying to run to the town center... through hordes of your units who happily slaughter them) because of either laziness or an unwillingness to design a decent AI (Creative Assembly are quite happy to lie about how good their AI is, though...) and, as you said, should we expect the AI to act like the player acts or how an actual medieval general would act? Personally, I think it should be the latter on lower difficulty settings and the higher on upper difficulty settings.

I think people want an AI that is stupid and fallible (like you said, like one of us :p) whilst still being capable of giving a challenge (like going against almost any player would be) through superior tactics. Sure, you could crush your enemies, but what's the point when you can force them to kill themselves? Even better when the AI is capable of utilising this concept too.

LeoLeonardoIII

  • Bay Watcher
  • Plump Helmet McWhiskey
    • View Profile
Re: Goal of AI Design for Games?
« Reply #10 on: January 28, 2011, 01:09:41 pm »

Immersion: Definitely, this is what I voted. You want a chicken to act like a chicken, you want a flock of birds to act like a flock of birds. More difficult is getting a human to act like a human. Breaking immersion ruins the game for me, moreso than AI failures in the other two areas I consider important (optimization and complexity).

Challenge: Absolutely not. You can ramp up challenge by changing the rules (all enemies do +1 damage), changing the game speed, changing the game environment (enemies spawn faster, you get fewer upgrades, the spaces are difficult to understand and navigate). In fact, one hallmark of terrible AI is that the game is too easy or too hard. Imagine a FPS where the enemies can spot you instantly if they get Line of Sight, and immediately and unerringly shoot you in the retina. That AI is actually easier to code than sort of dumb AI that often fails to notice you. Work on AI difficulty is generally on making it fallible, then on making it more competent. For that reason you might say AI development is about making the game harder. But there are so many other things you do to change game challenge that AI development seems like an end in itself rather than a method of controlling difficulty.

Ability to run on any system: It's complicated. I guess this is about hardware specs rather than software compatibility. We can all think of a game with low graphical load but heavy AI load, for which the game struggles and churns and by which it is limited. I think we are at a plateau of graphics where graphics could stop advancing and people would still be okay with that, because things look SO GOOD right now. But we're at a paucity of gameplay, where we have few "enemies on screen" as it were. Some games buck this trend, like Dead Rising (for certain platforms) but it seems like they're advancing how a few things look rather than the number and variety of those things available in the game. For that reason, AI optimization is a big deal because with cheaper AI you can have MORE of them active or you can have them making more complex decisions more often. That to me equals better gameplay.

Complexity: This is just the background work that results in immersion. You can be imersed in a game with 2 types of creatures, but with greater complexity comes greater world-level immersion rather than creature-level immersion.
Logged
The Expedition Map
Basement Stuck
Treebanned
Haunter of Birthday Cakes, Bearded Hamburger, Intensely Off-Topic

Draco18s

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #11 on: January 28, 2011, 01:12:55 pm »

Ain't nothing human about those mutas Overmind uses. To some extent a computer AI needs to know when to not use it's computer-fast ability to manipulate units in a way humans cannot. As cool as it is I know it's extremely annoying to see a computer control a bunch of units because the interface for me cannot handle doing such actions.

Regardless of the game, the AI will pretty much always end up like this.  If you limit its control over units (by say, restricting the number of commands per second or the number of simultaneous groups it controls) the AI can, in no way, match a human's ability simply because there will be flaws in how it acts and a human will always be able to exploit those flaws and the AI will be too trivial to defeat.

By allowing the AI an "unlimited" amount of control, the human has to work hard to find and exploit flaws in the programming.  Even once located, it requires constant work to thwart the AI.  Just like if they were facing another human being.  The circumstances are always different and the player is forced to use different tactics than they would normally.

In any event, an AI that issues commands faster than a human being is far preferable to an AI that outright cheats.
Logged

Farseer

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #12 on: January 28, 2011, 01:22:27 pm »

Regardless of the game, the AI will pretty much always end up like this.  If you limit its control over units (by say, restricting the number of commands per second or the number of simultaneous groups it controls) the AI can, in no way, match a human's ability simply because there will be flaws in how it acts and a human will always be able to exploit those flaws and the AI will be too trivial to defeat.

By allowing the AI an "unlimited" amount of control, the human has to work hard to find and exploit flaws in the programming.  Even once located, it requires constant work to thwart the AI.  Just like if they were facing another human being.  The circumstances are always different and the player is forced to use different tactics than they would normally.

The trouble with this is, as LeoLeonardoIII said, if you take it too far you get AI that can instakill from miles away with their rifle. You really need to have a reasonable cap instead of no cap at all in order for it work.

In any event, an AI that issues commands faster than a human being is far preferable to an AI that outright cheats.

I'm not sure if that's true for a lot of us. I'd rather play against an AI that cheats but is beatable than an AI that doesn't cheat but, due to vastly superior skills, is completely unbeatable. Sure, something like this would be great at top difficulty modes, but I don't expect to be fighting against SHODAN whilst playing a game on easy. :p

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Goal of AI Design for Games?
« Reply #13 on: January 28, 2011, 01:26:33 pm »

I think what an AI should do depends a LOT on the game in question.

A Strategy AI should go for challenge, complexity, and adaptability.

A Combat AI should be focused more on being interesting and providing an acceptable level of challenge.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Draco18s

  • Bay Watcher
    • View Profile
Re: Goal of AI Design for Games?
« Reply #14 on: January 28, 2011, 01:46:16 pm »

The trouble with this is, as LeoLeonardoIII said, if you take it too far you get AI that can instakill from miles away with their rifle. You really need to have a reasonable cap instead of no cap at all in order for it work.

Obviously.  The first issue with that statement is that the game allows insta-kills from excessive ranges.  FPS's aside where even a dude on the other side of a medium sized room (say, 30 yards) is almost invisible simply due to his pixel size (there are people who can still no-scope at this range, I can't), the AI's range should be cut off at distances that humans can rationally view.  That is, inside the fog radius (and not through walls, although some wall-shooting is allowed in games where shots penetrate--notably L4D and Men of War*--but at a reduced accuracy of some sort).

Quote
In any event, an AI that issues commands faster than a human being is far preferable to an AI that outright cheats.
I'm not sure if that's true for a lot of us. I'd rather play against an AI that cheats but is beatable than an AI that doesn't cheat but, due to vastly superior skills, is completely unbeatable. Sure, something like this would be great at top difficulty modes, but I don't expect to be fighting against SHODAN whilst playing a game on easy. :p

It all depends on how the AI cheats.  I doubt you'd like a game like Civilizations where the AI gets a 25% reduction in research times and cost.  They'd very quickly out-tech you to the point at which you couldn't win the Long Game.

On the other hand a 25% boost in resources is OK, simply because the AI isn't smart enough to use its units in the most intelligent way and will waste about 25% of them doing Dumb Things.

Going back to Star Craft and the Overmind AI, the AI only knows how to use Hydralisks, it isn't coded to utilize any other military unit.  And while its very good at using them, there are weaknesses there.

*Side note.  Men of War uses physics that are so accurate as to defy rationality.  A tank can fire a shell at another tank, have the shot ricochet off the target (doing no damage) and kill another tank.  I haven't actually witnessed that event, although I did completely murder an infantry unit that way.  You can also roll a tank up behind a building and fire through it, creating a small hole and using the building as cover while you rain death upon your enemies (up until the building collapses, anyway).
« Last Edit: January 28, 2011, 01:49:17 pm by Draco18s »
Logged
Pages: [1] 2 3 4