|
Your continuous donations keep RPGWatch running!
RPGWatch Forums » Comments » News Comments » bit-tech.net - How AI in Games Works

Default bit-tech.net - How AI in Games Works

March 13th, 2009, 07:04
UK tech site bit-tech.net has a geeky in depth look at the nuts and bolts of AI in gaming, from the basics of the state machine to how it functions in NPC view and pathfinding in terrain, destructible environments, and how it's affected by hardware acceleration.
Here's a bit from the conclusion about where it's headed in future:
AI is clearly becoming much more important in games, but it still has to compete with pretty graphics when it comes to processing resources, and itís often at the bottom of the pile.

Creative Assemblyís Richard Bull notes that "thereís still this disturbing mindset among programmers, particularly game programmers, that if the AI is taking any kind of considerable chunk of time, thatís a really bad thing. Itís only just getting to the stage now where people regard it as important enough to deserve this chunk of time in a game. If your graphics rendering is taking up 50 percent of your CPU time itís like 'well, never mind, it looks great', but if you try to tell people that you have this really intelligent decision-making system thatís taking up 30 percent of the CPU time, theyíll say 'you obviously donít know what youíre doing, itís badly programmed' and so on".

However, with GPU hardware support and multithreading becoming more widespread, hopefully, weíll see AI using a greater amount of resources. Just take a look at your CPU resources when youíre running Fallout 3 or GTA IV, and youíll see that your CPU is being hammered. Anything that can provide game developers with more AI processing power will be warmly welcomed by the gaming industry, and we can then progress to even more sophisticated AI systems.
More information.
magerette is offline

magerette

magerette's Avatar
Hedgewitch
RPGWatch Team

#1

Join Date: Oct 2006
Posts: 7,929

Default 

March 13th, 2009, 07:04
Man, I really hope this movement takes off. I've been saying for years that AI is the great, untapped potential in gaming and has remained so largely due to the obsession in the industry with eye candy and, in the RPG genre, over-sized worlds. *crosses fingers*
chamr is offline

chamr

chamr's Avatar
Mounted Highborn

#2

Join Date: Oct 2006
Location: CA, USA
Posts: 850

Default 

March 13th, 2009, 08:57
Interesting read for me. I've been working in fields vaguely related to AI (data mining and some dabbling with machine learning), but I dont have much knowledge of game AIs outside "simple" games like chess.

The first page has a good point (that cant be stressed enough) in that game AI:s are all about appearing intelligent rather than actual intelligence. It's Turing "intelligence" we want rather than intelligence as defined by the encyclopedia.

Using some sort of machine learning to tune AI behaviour in real time is quite far off though. Such methods essentially rely on statistical power, and a single player simply cant put in enough playtime to give enough data points for that to work without serious overtraining issues (overtraining is when you optimise your model to fit a few data points that arent representative)…

I'm not that pessimistic about the computational demands. AI uses much less data than graphics, and if GPUs become more flexible devices that can be tapped for generic programming tasks then it should be possible to offload much of the AI computations onto them.
Zaleukos is offline

Zaleukos

Zaleukos's Avatar
Bum

#3

Join Date: Nov 2006
Posts: 1,863

Default 

March 13th, 2009, 15:34
I would like AI to be not only about making the enemy more difficult. It should encompass all points. For example, if one dude sees your group coming, it should decide he can't take on you and go look for friends (not as a scripted event). Also, when enemy is wounded, maybe they should decide to run away instead of standing there waiting for you to finish them.
wolfing is offline

wolfing

wolfing's Avatar
Wonders what SasqWatch is

#4

Join Date: Sep 2008
Posts: 2,840

Default 

March 13th, 2009, 20:16
Originally Posted by Zaleukos View Post
Using some sort of machine learning to tune AI behaviour in real time is quite far off though. Such methods essentially rely on statistical power, and a single player simply cant put in enough playtime to give enough data points for that to work without serious overtraining issues (overtraining is when you optimise your model to fit a few data points that arent representative)…
I don't think that's what they meant. I think they meant collecting data points from many players and updating the thinking of the AI based on that. Not necessarily on the fly, but in an incremental fashion akin to patches. For example, they could collect data from the thousands of on-line players of DoWII, crunch the numbers, and then release an AI patch 2 months post-live that improves/expands the AI based on what was learned from real players.

Originally Posted by Zaleukos View Post
I'm not that pessimistic about the computational demands. AI uses much less data than graphics, and if GPUs become more flexible devices that can be tapped for generic programming tasks then it should be possible to offload much of the AI computations onto them.
I'm not so sure. It's not so much the data as the assessing of the world's current state, traversing the branching decision logic, weighing of the alternatives, and the making decisions. Multiplied by how many ever entites you have performing this "thinking" at any one time. Even just a few hundred NPC's/units/whatever doing this every second is a LOT of demand on a CPU.

@wolfing: absolutely. The possibilities for complex behavior from an improved AI are staggering. Think about playing an RPG one day that challenges you in a way similar to a real life Game/Dungeon Master. Obviously, we won't live to see the day computers approximate human thinking. But the gap between what games are doing now with AI and what a human opponent can do is so huge, there is immense opportunity for improvement.
chamr is offline

chamr

chamr's Avatar
Mounted Highborn

#5

Join Date: Oct 2006
Location: CA, USA
Posts: 850

Default 

March 13th, 2009, 21:43
But in many cases isn't "intelligent AI" nothing more than "lemming AI" and not really intelligent as we know it - in extreme cases it can even be nothing more than "padding AI"

For me, sporadic, scenario-reactionary, incident-tendency or best of all specific scenario generated AI routines tend to pull players into a higher level of gaming immersion and greater reality, it is the repetitious element in AI structures that are off-putting.

There is still a long way to go before intelligent AI becomes "reactionary" intelligent.
Wulf is offline

Wulf

Wulf's Avatar
Inquisitor

#6

Join Date: Oct 2006
Location: North-West England
Posts: 1,096

Default 

March 13th, 2009, 22:56
Originally Posted by Zaleukos View Post
Using some sort of machine learning to tune AI behaviour in real time is quite far off though. Such methods essentially rely on statistical power, and a single player simply cant put in enough playtime to give enough data points for that to work without serious overtraining issues (overtraining is when you optimise your model to fit a few data points that arent representative)…
Could work in MMORPG's though. Lots of players, lots of data points.
Prime Junta is offline

Prime Junta

RPGCodex' Little BRO

#7

Join Date: Oct 2006
Posts: 8,540

Default 

March 13th, 2009, 23:03
By the way, there's one game that does AI IMO extremely well: Dwarf Fortress. I don't think it's technically particularly fancy — a state machine with a goal engine just like described in the article — but it's very rich in states, including a great many that bring those bearded little buggers alive — emotional states, for example.

For example, you might issue an order to kill the kittens that have been overbreeding in the fortress, but then the dwarf who gets the task might get so smitten by the kitten it's taking to the butcher to be turned into kitty-burger that he adopts it instead. And if the kitten gets subsequently killed, the dwarf will get upset about it. If he's already stressed-out, he might even fly into a rage and break stuff or even assault other dwarves. The dwarves make friends, get into spats with each other, fall in love, get married, have children, adopt pets, have preferences about the kinds of foods, drinks, and minerals they like or dislike, some dwarves might enjoy working outside while others prefer to stay underground, some enjoy fighting while others enjoy quieter pursuits and so on. And all this is reflected in their behavior.
Prime Junta is offline

Prime Junta

RPGCodex' Little BRO

#8

Join Date: Oct 2006
Posts: 8,540

Default 

March 14th, 2009, 15:58
This article seems not have a word about dialogs/talks. My bet is that there's just no attempt about it in gaming.

About a state machine with many states or parameters the problem is more the design of each state and consequences than its programming.
Dasale is offline

Dasale

SasqWatch

#9

Join Date: Oct 2007
Posts: 2,096

Default 

March 14th, 2009, 23:32
Originally Posted by Prime Junta View Post
By the way, there's one game that does AI IMO extremely well: Dwarf Fortress. […]
While that is formally "AI", it would be much more impressive if the computer could play by the same rules as you and be a challenge. I mean, to draw an analogy, in a RTS, it is almost trivial to program your units to return fire, seek cover and otherwise react, but it's much harder to make the opposing computer player use actual tactics. So yes, Dwarf Fortress is impressive enough, but it's not the end-all - the dwarves just have lots of options open and the smarts to seek cover food when needed.
VPeric is offline

VPeric

Sentinel

#10

Join Date: Oct 2006
Location: Serbia
Posts: 580

Default 

March 15th, 2009, 07:57
Of course DF is not the end-all. However, it is an example of a novel and creative way to use AI to give depth to the game. If all it had was really smart combat AI, I kinda doubt too many people would bother to play it.
Prime Junta is offline

Prime Junta

RPGCodex' Little BRO

#11

Join Date: Oct 2006
Posts: 8,540

Default 

March 16th, 2009, 22:24
The interesting thing about AI, is that the most efficient and "hard" AI is usually the simplest one - whilst the more human-like behaviour tends to be much easier to defeat, because it deals with too many factors to effectively correlate them all.

Even if they some day succeeded in emulating human intelligence, they'd still need to make it an efficient gamer. That's quite a feat - and people tend to forget that while a child is typically a very easy opponent in a complex strategy game, the child is still infinitely more intelligent than any AI we'll see for years and years.

Then again, some people are impressed simply with a range of actions - like in Dwarf Fortress - because simply having different reactions to situations can appear "human" in nature. But only if those actions have some kind of intelligent motivator and long-term plan, would they actually mirror something like that which is happening in the human mind.

So, I think perception of AI is also a problem.

With all that, I believe Galactic Civilizations (1 and 2) is known for its multi-threaded and sophisticated AI. I haven't personally gotten into that game, but I wonder if it's as good as I've been hearing.
DArtagnan is offline

DArtagnan

DArtagnan's Avatar
Waste of potential

#12

Join Date: Oct 2006
Location: Denmark
Posts: 13,046
RPGWatch Forums » Comments » News Comments » bit-tech.net - How AI in Games Works
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 01:09.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Copyright by RPGWatch