Where's the good AI?
UltimaGecko
hates endnotes Join Date: 2003-05-14 Member: 16320Members
in Off-Topic
<div class="IPBDescription">...I don't just want shiney stuff.</div>So, in one of my common (far too common, I'd say) mélanges of thoughts, I was wondering where all the good AI in games is nowadays...
(fear the post length...)
Now, this isn't necessarily to 'praise' the old games, because let's face it, the computer cheated all the time in Colonization, only those damn pickpocket kids in Fallout 2 ever moved, and the only reason you could spy on the enemies in Goldeneye was because they couldn't 'see' you through windows. There's other, subtle stuff as well, like mad, hierarchical scripting to give the appearance of 'unpredictably smart AI', but there's just not much going on.
So while my Pentium 3 from 1998 had 500Mhz, and could run Civilization 2 and Half-Life, why haven't I seen improvement since we've gotten 800% as much processing power and graphics cards to free up even more CPU cycles? Why does it still - for lack of the perfect, descriptive word - suck? The CPU still needs to cheat in Civ4, enemy tactics haven't really improved in 5+ years and I still haven't seen a nuclear war created by sentient national defense networks.
I see shinier and shinier graphics, but the AI just gets more and more stagnant. Some will most assuredly disagree with me here, but the best (FPS) AI that I can recall is still Halo, because the big battles forced the AI to do unexpected and fun things (but they was still some scripting and repetitiveness (...in AI, not the Library, we all know you hated it, everyone did)).
I'll take one of my favorite (and astounding) examples of a <i>part</i> of effectively implemented AI: Medieval Total War.
First, let's just avoid the whole world map...since the computer was astoundingly bad with invasions, army maintainence, diplomacy, economics and pretty much everything else. The one shining example is the battlefield AI. Although it does suffer from little quirks that let you know you're playing against a machine that excels at micromanaging (you've got to expect that they're going to pull back their horse archers whenever you attack, even if there's some far more important battle going on), the best part was that different difficulty levels would change which tactics were open to the computer. It's the only game that immediately springs to mind where the computer's 'thinking' was influenced by the difficulty, instead of statistical bonuses to make their army harder to kill.
(The specific 'changes' were that the computer would use less flanking and wouldn't perform a pincer on 'easy', but unfortunately, normal through very hard saw no 'AI differences', unless you count aggressiveness and 'starting wars for no apparent reason, with no apparent goals, with no chance for success' an improvement.)
Next, look at the sequel, and you've got Rome Total War, where the game is 'prettier' (being the weirdo I am, I still prefer the old Risk-style map), but the AI is worse. Before the simple expansions the AI was horrendous, charging their general willy-nilly into your phalanxes and performing useless manuevers and never taking morale into account (I didn't buy any expansions, so I don't know what they got around to potentially improving). Patched, the AI battle experiences in both games are essentially identical (assuming they fixed it up a bit in the patches). We got Medieval 2 Total War, which is basically Rome copied with graphical improvements and a new time setting, but the AI remains the same.
However, there's 4 years between M:TW and M2:TW, and you've got no improvement (I'd even got so far as to say a <i>worsening</i> of the battle experiences in some ways).
Let's take another, broad example: strategy games. Despite unbridled graphical advancement we still have AIs that need to cheat to compete. Just look at the Civilization 4 difficulty modifiers (more happiness, more unit support, different goody hut bonuses), but the only way the AI ever changes is it 'becomes more aggressive'. Europa Univeralis is similar, you're in your third version, but somehow the AI sometimes just seems to devolve in newer game iterations. EU is an especially bad case of 'shiney syndrome', because it not only plays easier with a 2D map (that is: worse graphics), but it would also run easier, as well. A game that gets graphical upgrades for no apparent reason and computational downgrades does not constitute a good choice for a sequel in my book.
Coincidentally, one game that did a half-decent job of scaling difficulty was Age of Empires 2, however, even on the highest difficultly levels the computer is absurdly dense and fails in most assaults because it doesn't properly muster its forces or gets pathfinding errors (or, often in Black Forest maps, it just walks past your settlements, finds a wall, and then walks back around the entire map to attack your partner...just like a human would, right?).
Now, the annoying phenomenon is not only limited to strategy games, shooters seem to have been developing an AI-inferiority tendency over the last few years as well. We all marvelled at the grunts in Half-Life, flanking around the giant crates and flushing us out with grenades, but why are the Combine so boring? They throw grenades, and they flank, but the limited game environment makes it seem worse than the original. They charge at you more frequently, it seems, as if you're playing Serious Gordon Freeman...
Luckily FEAR and STALKER (...always the capitalized acronym games, I guess) seem to have slightly improved on AI aspects, but are still heavily scripted and predictable.
The problem persists in more abstractly affected genres, as well. Oblivion's RadiantAI was supposed to revolutionize the way we saw people going about their daily lives in a video game. Fable was supposed to be similar (earlier). They both manage to create the exact same effect: villagers come within a close proximity of eachother, chat about 5 sentences and then depart; some people walk around as if they actually work, but do nothing of any apparent importance. Unfortunately the combat AI for such games is almost - by some sort of strange arbitrary rule - worse than shooters.
That's not to say these games aren't fun, many of us enjoy Halo, Half-Life, EU, Oblivion, Total Wars and a multitude of other games, but - as the 80's and 90's ADA slogan goes - where's the beef? Why has my processor gotten so much stronger, but the AI gotten weaker (or stayed the same or had - at best - very modest improvement)? Where's my believable, immersive, human world?
I want less shinies, I want more smarties.
(This has grown much longer than intended - remind me not to decide to write things at 4 in the morning before planning to take an exam. Also, a majority of that stuff up there is all opinion and truthiness.)
(fear the post length...)
Now, this isn't necessarily to 'praise' the old games, because let's face it, the computer cheated all the time in Colonization, only those damn pickpocket kids in Fallout 2 ever moved, and the only reason you could spy on the enemies in Goldeneye was because they couldn't 'see' you through windows. There's other, subtle stuff as well, like mad, hierarchical scripting to give the appearance of 'unpredictably smart AI', but there's just not much going on.
So while my Pentium 3 from 1998 had 500Mhz, and could run Civilization 2 and Half-Life, why haven't I seen improvement since we've gotten 800% as much processing power and graphics cards to free up even more CPU cycles? Why does it still - for lack of the perfect, descriptive word - suck? The CPU still needs to cheat in Civ4, enemy tactics haven't really improved in 5+ years and I still haven't seen a nuclear war created by sentient national defense networks.
I see shinier and shinier graphics, but the AI just gets more and more stagnant. Some will most assuredly disagree with me here, but the best (FPS) AI that I can recall is still Halo, because the big battles forced the AI to do unexpected and fun things (but they was still some scripting and repetitiveness (...in AI, not the Library, we all know you hated it, everyone did)).
I'll take one of my favorite (and astounding) examples of a <i>part</i> of effectively implemented AI: Medieval Total War.
First, let's just avoid the whole world map...since the computer was astoundingly bad with invasions, army maintainence, diplomacy, economics and pretty much everything else. The one shining example is the battlefield AI. Although it does suffer from little quirks that let you know you're playing against a machine that excels at micromanaging (you've got to expect that they're going to pull back their horse archers whenever you attack, even if there's some far more important battle going on), the best part was that different difficulty levels would change which tactics were open to the computer. It's the only game that immediately springs to mind where the computer's 'thinking' was influenced by the difficulty, instead of statistical bonuses to make their army harder to kill.
(The specific 'changes' were that the computer would use less flanking and wouldn't perform a pincer on 'easy', but unfortunately, normal through very hard saw no 'AI differences', unless you count aggressiveness and 'starting wars for no apparent reason, with no apparent goals, with no chance for success' an improvement.)
Next, look at the sequel, and you've got Rome Total War, where the game is 'prettier' (being the weirdo I am, I still prefer the old Risk-style map), but the AI is worse. Before the simple expansions the AI was horrendous, charging their general willy-nilly into your phalanxes and performing useless manuevers and never taking morale into account (I didn't buy any expansions, so I don't know what they got around to potentially improving). Patched, the AI battle experiences in both games are essentially identical (assuming they fixed it up a bit in the patches). We got Medieval 2 Total War, which is basically Rome copied with graphical improvements and a new time setting, but the AI remains the same.
However, there's 4 years between M:TW and M2:TW, and you've got no improvement (I'd even got so far as to say a <i>worsening</i> of the battle experiences in some ways).
Let's take another, broad example: strategy games. Despite unbridled graphical advancement we still have AIs that need to cheat to compete. Just look at the Civilization 4 difficulty modifiers (more happiness, more unit support, different goody hut bonuses), but the only way the AI ever changes is it 'becomes more aggressive'. Europa Univeralis is similar, you're in your third version, but somehow the AI sometimes just seems to devolve in newer game iterations. EU is an especially bad case of 'shiney syndrome', because it not only plays easier with a 2D map (that is: worse graphics), but it would also run easier, as well. A game that gets graphical upgrades for no apparent reason and computational downgrades does not constitute a good choice for a sequel in my book.
Coincidentally, one game that did a half-decent job of scaling difficulty was Age of Empires 2, however, even on the highest difficultly levels the computer is absurdly dense and fails in most assaults because it doesn't properly muster its forces or gets pathfinding errors (or, often in Black Forest maps, it just walks past your settlements, finds a wall, and then walks back around the entire map to attack your partner...just like a human would, right?).
Now, the annoying phenomenon is not only limited to strategy games, shooters seem to have been developing an AI-inferiority tendency over the last few years as well. We all marvelled at the grunts in Half-Life, flanking around the giant crates and flushing us out with grenades, but why are the Combine so boring? They throw grenades, and they flank, but the limited game environment makes it seem worse than the original. They charge at you more frequently, it seems, as if you're playing Serious Gordon Freeman...
Luckily FEAR and STALKER (...always the capitalized acronym games, I guess) seem to have slightly improved on AI aspects, but are still heavily scripted and predictable.
The problem persists in more abstractly affected genres, as well. Oblivion's RadiantAI was supposed to revolutionize the way we saw people going about their daily lives in a video game. Fable was supposed to be similar (earlier). They both manage to create the exact same effect: villagers come within a close proximity of eachother, chat about 5 sentences and then depart; some people walk around as if they actually work, but do nothing of any apparent importance. Unfortunately the combat AI for such games is almost - by some sort of strange arbitrary rule - worse than shooters.
That's not to say these games aren't fun, many of us enjoy Halo, Half-Life, EU, Oblivion, Total Wars and a multitude of other games, but - as the 80's and 90's ADA slogan goes - where's the beef? Why has my processor gotten so much stronger, but the AI gotten weaker (or stayed the same or had - at best - very modest improvement)? Where's my believable, immersive, human world?
I want less shinies, I want more smarties.
(This has grown much longer than intended - remind me not to decide to write things at 4 in the morning before planning to take an exam. Also, a majority of that stuff up there is all opinion and truthiness.)
Comments
Well, the Halo 1 AI was pretty effin' awesome. <img src="style_emoticons/<#EMO_DIR#>/tounge.gif" style="vertical-align:middle" emoid=":p" border="0" alt="tounge.gif" />
<!--QuoteEnd--></div><!--QuoteEEnd-->
No it wasn't. It rolled now and again and that's it.
HL2: Episode One had an excellent A.I. sidekick (Alyx) through the whole game, and she was actually useful throughout the game.
AI is hugely complex to get right, and lots of resources needs to be spent on research. You can't show great AI on the back of a box, while you can with graphics. "True" gamers only constitute a minority of the buyers, sadly, which makes getting the attention of casual gamers/mothers looking to buy presents/cool kids at school etc etc more important since they make up a bigger group of buyers, and getting their attention is best done by being able to show off with really shiney graphics.
When it comes to FPS games, the AI hasn't changed too much. Halo 1 was the only game I can think of where different enemy units would work together to try to get you. There wasn't much of an increase in the intelligence in Halo 2 and other games in general. (In fact in Halo 2 there were several glitches in the AI. Aliens would run into walls and brutes would sometimes just stand there and not attack). What annoys me the most is that when playing on harder difficulties of a FPS the enemies don't get any better, they just do more damage and there are more enemies.
Also in most FPS games it is possible to just stay behind some cover and pick of the enemy one by one until they are all dead and they wouldn’t really do anything about it other than just stand there. I would like to see them do things like all throw grenades at your position to try and flush you out, or take cover or maybe even all rush your position, if they can hit you.
After getting a kill in a large crowd of enemies, the guys around the corpse won't panic or do anything about it which always just seemed stupid to me, I can't think of a game where that doesn't occur. I think the best example of this occurring is in the game "The Darnkess," if you used creeping dark to get into a room full of enemies and you killed one, the other people don't make any significant responses to that. Sure they commented on the fact that one of their own just died, but there was no panic, no running around, they would just stand there as I killed them. If the guy you were talking to just had his face ripped off and his heart eaten by a big black tentacle, you wouldn’t just stand there. But still the game play was good enough for me to shrug off the bad AI.
I'm kidding, but like, kinda not. It has nothing to do with the AI, but it's probably the most frustratingly "realistic" game I've ever played. Like, if you do ANYTHING wrong it's game over. Even walking behind the bartender's counter will get you a game over! Also, it taught me how to be extremely OCD about making nobody's around when I kill a guy (someone sees or hears you kill someone: game over) and making sure the body stays hidden (this came in very handy for Hitman 2, one of my favorite espionage games ever).
I actually think, to a certain point, that the Metal Gear Solid series AI is great. The big thing for me was in MGS 2 when a guy saw you, and you knock him out before he radios for help, and then alter on "omg he's not repsonding to his radio! Send in a search team!" and then you're like OSHI and get out of their way...So they go over to the guy, wake him up, and instead of going back to business as usual, the guards like "OMG THERE WAS THIS GUY" and then it's caution mode! I don't know if that really counts as AI or scripting, but either way I was like "Hey...That's kinda cool. I wasn't expecting the bad guys to actually act that pseudo-realistic." If by "AI" you mean "enemy behavior," then yes, MGS series has great AI.
Lets take Oblivion for example. At its current state NPC in Oblivion have a plan that they follow (go to work from 8:00 to 16:00 then go to the local pub and from 16:00 to 20:00 then go home and sleep from 20:00 to 8:00)
but during its development there was a needs system in place that controlled the characters action. (sleep, hunger, money etc) characters also has any action available that the pc had. This resulted a in a huge performance hit and b in situations like:
Geoffry is hungry, but has no money. Because earning money would take too long he simply steals food or money to buy food. But this results in Geoffry going to Jail if someone sees him and alerts the guards. If Geoffrys aggression rating was high enough he sometimes would also kill an NPC off and steal that NPCs food.
This resulted in a pretty much deserted gameworld, because most NPCs were either dead or in jail after a while.
Part of the reason why AI never improves is because AI will never play the game better than the person who coded it, and as hard as game designers and builders try, they don't usually end up being any better players than the top 50% of the playing community. Therefore AI intelligence doesn't scale, they just make it cheat if they need it to be more difficult.
There are some exciting advances in AI development.... Because we're getting to a point where we have alot more processing power to play with, we're getting to a point where AI designers are now using layered design methods to make complicated AI's have simple interfaces for modification work. Radiant in Oblivion is a good example... even though it's notoriously broken in it's lower levels <img src="style_emoticons/<#EMO_DIR#>/tounge.gif" style="vertical-align:middle" emoid=":p" border="0" alt="tounge.gif" />... Basically if I want to code an oblivion character's AI, I don't need to edit hundreds of thousands of lines of code, I just tell the AI it's a butcher, and this is where the butcher shop is, and this is where the meat is, and the character gets tired from this time of day to this time of day normally. The AI handles all the path finding and automatically generates relationship networks between the AI entity and other entities along it's route, and such stuff that I would have to manually think of and create with hundreds of thousands of programmed interactions.
The long and short of things is, AI really has advanced a fair bit, but the people coding the AI's still aren't smart enough to make the AI play the games well.
Guh... Oblivion's guard AI was stupid. They didn't put any effort into line-of-sight calculations or last-known-position, they just made them telepathically know where you were at all times. Really pathetic.
The AI in operation flashpoint and armed assault were both really good. The squad movements like advancing, flanking, retreating and whatnot were really well done. If you reveal your position by shooting full auto from behind a bush you can expect a tank shell up your nose in fairly short order. If you shoot and change position regularly then you're generally safe. OFP and AA are the only super-realistic millitary sims that I've actually enjoyed. Mostly because realism was king. KING. The fun from gameplay is a much slower reward than the instant gratification from most other games. The joy comes about through careful planning, positioning and execution of an assault and having it come off with no fatalities. There's quite often times that even just standing up or moving too quickly can get you and your entire team killed in a matter of seconds. It doesn't matter how good you are. If you try to run and gun you can expect to hear a few clicks of bullets zipping past your head before you hit the ground dead. 90% of the game is getting into position and waiting. Actual shooting is very rare indeed.
--Scythe--
Also I don't know if anyone else noticed (or if it's just me seeing things that aren't there), but the shotgun combine would use cover way more than the SMG combine, to get closer to you and nail you point blank. Which sucked.
And yeah, the Guards in Oblivion were really annoying. Especially the way you can commit a crime in one city, immediately escape on horseback to another city, and the guards there already know about it. And the fact that they know where you are. Always.
Make 2 combine units fight each other and I imagine the AI would appear a little more impressive.
Well, HL2 is kind of a hard situation... How do you make an AI intelligently fight superman? You can program in all the military formation knowledge in the world, but most of that stuff is based on some logical assumptions about the ability of your opponent. He's not supposed to be able to breach any line you make by killing half your force with a toilet, and then flanking them while not really making any effort to avoid fire, right out in the open.
Make 2 combine units fight each other and I imagine the AI would appear a little more impressive.
<!--QuoteEnd--></div><!--QuoteEEnd-->
Now see, this is why gamers make superior military men.
We EXPECT the toilets to fly at our head. But we are ready. We sir, we <i>catch</i>.
The answer is simple, the ai is hardest thing to program in a game and those who do it you'll never notice it. I didn't think stalkers ai was good till i sniped one person with the gauss rifle. One of the bandits turned around, saw his friend dead, and pulled out a shotgun and blew the other guy away. My jaw dropped just to think that the ai thought that his friend killed the guy next to him and he turns around to kill him instead of the usual 'oh we know where the guy that shot him instantly is' bull######. That and the ai wanders around, with some mods to add the blood suckers in random spots, base camps become a battle for survival or you drive a car <img src="style_emoticons/<#EMO_DIR#>/tounge.gif" style="vertical-align:middle" emoid=":p" border="0" alt="tounge.gif" />
<!--QuoteEnd--></div><!--QuoteEEnd-->
I honestly never saw anything like that.
I have sniped a good number of people, and all it ever changes is that they go into "oh crap, some one is trying to kill us" mode.
Oh well, I also had a tendency to promptly run in and blow things up, but that is just because I am silly like that.
The best AI ever: Mission Impossible 64. =P
[MSG thing]
<!--QuoteEnd--></div><!--QuoteEEnd-->
As you said, neither of those are really AI. Both are scripted events happening every time in response to another event. At enemy knockout, count to 5 then send soldiers.
If player enters zone, end game.
No it wasn't. It rolled now and again and that's it.
<!--QuoteEnd--></div><!--QuoteEEnd-->
I don't think that's an entirely fair assessment. One of the coolest aspects of Halo is the simulated chain of command that the 3 main enemies had; the grunts would panic and start to run around/away if a lot of elites are getting killed, jackals will shirk away from battle and pull back to their friends. They uses grenades frequently (compared to most games), they (as astutely noted) roll, they retreat (unfortunately advanced tactics like pincers or feigned retreats are generally only scripted or luck).
One of the coolest things was the first time you come outside (on the ground level) in Assault on the Control Room and the battle between the marines and covies is different almost every time, because they're actions aren't prescripted (unfortunately their placement is mostly prescripted with some randomization) - but sometimes you can take your time and the marines will be able to hold their own, other times they'll get pounded by the wraith right away and need your help immediately (or they're all dead from that one shot...).
Unfortunately they'd occasionally suffer from pathfinding errors, and they'd make common AI mistakes and they'd become easy to exploit, and the 'war' never felt fluid, it was just one small (or slightly larger) individual fight that you just kind of destroy and it has no greater impact on what you do next. It was the first game in a long time where the individual unit AI wasn't completely dense and it sort of emulated interaction between your enemies, but since then I've seen no improvement (I'd argue Halo 2's AI was worse than Halo's...especially since the Brutes are like more retarded - but stronger - versions of the flood). Hopefully Halo 3 will see some really nice battle AI, but I think they kind of threw it off with the jackal snipers and the more idiotic elites.
Despite that, it's what I consider one of the best improvements in FPS AI lately (FEAR might be better, but I've only played the demo, and it seemed to have relatively high amounts of scripting).
"look at that thar purty ger-naa--"
*booom*
<img src="style_emoticons/<#EMO_DIR#>/biggrin-fix.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin-fix.gif" />
I had once placed a mine near a door and expected them to drop from their scripted heli and barge through, but none came and I didn't see anyone. After some time I hear falling glass and footsteps ABOVE me and soon a pack of soldiers came down the very same stairs I had used. This had me impressed.
They AI burn the bodies of their enemies in stalker. (not manipulated in anyway using carry/whatever)
<img src="http://img67.imageshack.us/img67/925/xr3da2007032723412058is6.jpg" border="0" alt="IPB Image" />
More games should have something like Path of Neo where the enemies learns your attack pattern if you do it over and over again. Even if this isn't necessarily AI it makes you think their being smart.
Another unmentioned game, the SST FPS, had some partly impressive AI. Im not talking about the bugs individual AI but their swarm AI. They always let the nearest bug get their own space and didn't advance until a space opened up around the player. So even if u had 100 bugs at only you there would only be 8-10 attacking you at the same time, no clipping or pushing generally occurred (except in boxes and tru thin walls). It also made them occupy a lot more space then many enemies would and thus seem more swarmy.
Dwarf Fortress?
<!--QuoteEnd--></div><!--QuoteEEnd-->
...no.
Smart AI would be able to GET OUT OF WATER BEFORE DROWNING.
In my experience, developers are not to be trusted concerning their statements about AI. I remember Turok: Evolution (awful, AWFUL game) was supposed to have this revolutionary "dynamic squad" AI. Specifics were not to be found, but upon playing the game I realized "dynamic squad" AI meant the enemy stood still while firing at you and they would fall down when you killed them. Woo. Now I doubt all claims that games like Bioshock have concerning their AI.
I don't think that's an entirely fair assessment. One of the coolest aspects of Halo is the simulated chain of command that the 3 main enemies had; the grunts would panic and start to run around/away if a lot of elites are getting killed, jackals will shirk away from battle and pull back to their friends. They uses grenades frequently (compared to most games), they (as astutely noted) roll, they retreat (unfortunately advanced tactics like pincers or feigned retreats are generally only scripted or luck).
<!--QuoteEnd--></div><!--QuoteEEnd-->
I've never seen Jackals pull back to their teammates, hell, they don't even move much so you just run up to them and bash through their shield.
Don't get me started on the little flying ones.
I think this anecdote displays all the main reasons why Halo was a leap forward for FPS AI. The grunt running away shows off the fact that they gave the AI for each enemy type an actual personality. The grunt leading his allies to me shows the use of teamwork, and the fact that they actually have to communicate with each other rather than relying on a hive-mind.
That they don't magically know where I am, but can remember where I was and formulate a guess as to where I went is the one to pay attention to, though. The fact that the AI can put up a decent fight without cheating at all is a major achievement, and it really improves the game more than you would think. On legendary (heroic and lower are so easy that it doesn't matter what the AI does), the game is sort of like the Ninja Gaiden of first person shooters. It's tough as nails, but completely fair. Whenever you die, it's almost always completely your fault.
It's worth noting that this encounter didn't involve the enemy outsmarting me with a brilliant tactical maneuver and end with my death. Rather, it involved the enemy making an honest mistake, and ended with me killing all of them with a single plasma grenade. The worst programmer in the world can make enemies that can defeat the player 90% of the time, but that doesn't make it good AI. Good AI is fun to fight, and carries the illusion of real intelligence. Enemies that can challenge the player <i>while following all of the same rules as the player</i> are Halo's biggest achievement, and what every semi realistic shooter should strive for.
Lets just take some look at the development process:
Pitfall: Continuous process: Crocodiles open and close mouths at predetermined intervals.
Prince of Persia: Basic IF THEN: If players steps near hacking door, then the door starts hacking.
Prince of Persia: IF THEN combined with randomness: If player attacks and is in range and random 5 equals 2 then block attack. If player is in range and random 2 equals 1 then attack player. etc
In modern games we still have the same basic IF THEN AI, but we also have a separate pathfinding.
Castle Wolfenstein: IF THEN: If enemy player in range then shoot.
Doom: IF THEN combined with randomness:If enemy player in range and random 10 equals 4 then move closer to player else start shooting.
I will stop now cause when you get to modern games things get a little more tedious and I dont want to write several hundred lines of IF THEN (which is still basically modern AI) instead I will just pick a few examples and simply point out how they work.
Tic Tac Toe:
There are only a few moves, so an short IF THEN can cover ANY situation thus a correctly written TTT AI will never loose due to the nature of the game.
Chess: Chess is way more complicated than TTT, but it is still a rather simple game with a number of limited useful moves (although the total number of possible moves is infinite) so by having a huge library of games available and brute-forcing the chess AI can beat nearly any opponent.
Half Life 2 EP1: Well, we have pathfinding which in this case means finding a non obstructed way from a to b which is wide and high enough to fit the NPC through. There is just like in chess and infinite number of way how you can move from a to b, but only a limited number of useful moves. Pathfinding is normally not able to take such things as cover into account, unless the map designer places certain brushes or markers on the map which tell the AI: In this area you have additional cover, here you will receive damage over time etc.
So without the aid of the mapmaker pathfinding is not able to find the optimum route from A to B.
Besides pathfinding we also have certain combat routines for alex they look something like this:
If lightlevel around enemy is bigger than 10 and enemy is in range and los is not obstructed then shoot.
If ownhealth is lower than 20 then retreat in direction of gordon.
Then we have also those nifty animated combat moves. Those are actually quite simple. Alex does not use them on purpose, instead the game checks if alex and the enemy are correctly aligned. If they are then the special move is executed.
So, what would be a good AI?
Well, a good AI would be able to play a computer game without having direct access to the code. So a real AI would not control its NPC from inside the game but instead from with simulated keyboard and mouse input.
A good AI could play any game by monitoring humans playing the game and then simulating the players input and also analyzing what good moves are and what bad moves are.
In order to realize such an AI we would need:
Code that monitors player input.
Code that judges player input on their usefulness.
Code that writes a library on useful actions and when to take them.
Code that executes those actions.
This AI could idealistically play any game.
Problems:
Performance. Monitoring everything in a map and every player move is going to suck the life out of any PC.
Do we want this? The AI will eventually end up better than the player it learned from, because it knows every move and it is faster/more precise.
It is not real AI cause it does not think for itself. Instead it mimics human behavior.
It would take alot of time to get such an AI trained.
How do we determine what a good action is? Different game have different goals and different rules. And because we want it to play any game we would need a way to read human emotions when playing the game. (happy=good, sad=bad)
So thats it. Just some thoughts on why current ai blows.
Stuff
<!--QuoteEnd--></div><!--QuoteEEnd-->
No no no no no no no.
There's no such thing as "Real" AI. We're talking about <i>artificial</i> intelligence, here. As long as the <i>illusion</i> of intelligence is preserved, the method used to achieve it is irrelevant. Brute force methods such as the one you described are not even remotely feasible right now. Maybe in a decade or two.
Have you ever played Metal Gear Solid 2 or 3? Everything is completely scripted in those games. Every guard follows a scripted patrol path. If a guard sees you, he'll alert every other guard in the area and they'll try to surround you, every time. If he has a radio, he'll run away and call for backup, every time. If he loses sight of you, he'll try to search for you by following premade "search" paths. When backup comes, they'll follow the same "search" paths as the other guy, every time. And what is the end result? Enemies that can react realistically to just about every situation that is possible in the game.