Hey Guys.
Nice to see that some people like to discuss these topics…
I wanted to share some views on this with you, just some little thing here and there.
(There are some talks about these things we made at Cons, Conferences etc, there is a PhD thesis coming along (slooowly… )
What makes an NPC tick/think
One key component of any NPC is the decision-making mechanism (DMM). You can call it its brain. But basically what it does is “selecting an action to do”. If the NPC is beyond an automaton, it may take various inputs into account (perception, hearing, commands, internal state etc.) - either external or internal. The NPC decides ( If it is rainy, go Home / If it is sunny go to beach). A rigid script is only a text of commands (actually the most simplistic approach).
So basically the NPC is doing the same thing as You are doing - looking at the world and thinking what can it do next. (this is why we dont call our NPCs actors, since they are not reading a script )
If there are no inputs, its the same, the NPC is just an stupid automaton without reactions (an movie script). The decision making mechanisms vary - e.g. finite state automata, event based scripts, decision trees, behavioral trees, classical planning etc.
There are two big groups of such DMM’s - reactive and deliberative. Where reactive mechanisms only take the current situation into account and deliberative try to look ahead (i.e. plan something). There are various hybrid architectures, but that is rather complicated to get working.
Actually even the Game AI has moved beyond the “rigid” concepts into much more fluid and autonomous ones. It is long time not true that the AI cannot think on its own, since it depends on how you view this trait. The question here is only, how complex the thought process has to be, and how “reasonable”. And how much will we get computational power to do it right In most cases, games are developed in the "lets not spend that much time on AI lets make it look more shiny "
Here it is where the “illusion of intelligence” comes into play - we humans actually perceive only the illusion of intelligence by its demonstration that we try to map to our own intelligence as a reference. Thus comes the believable illusion of intelligence. If you look up stuff like The Chinese Room or The Touring Test you will get the picture of what I’m talking about.
About rigid scripts
The above me described “movie scripts” or those by Dan described “player centric design” is one way to approach it, when there is no intention to build actual artificial simulated life. Life is by definition dynamic, it changes, adapts. And that is the most key thing in an game AI - the capability to adapt.
Others
There are various ways to do it, Sims (Affordances of Needs) did it very good, Black And White did it in a really cool way (actual learning), Noone Lives Forever (STRIPS like planning) was superb. We call ours the “Injected Intelligence” ™
How is it done at KC:D
It is rather complicated We even publish academic papers about it
http://artemis.ms.mff.cuni.cz/main/tiki-publications.php
To not go into any boring technical detail, we dont do scripts in a traditional way. Our core AI technology is build around the notion of Behavioral Trees that we modified very heavily to serve our dark needs. And by heavily I mean truly heavily. (It is based on If-Then trees from Joanna Bryson and reworked (if someone can dig up my master thesis, you can read up the deep technical details of a lot of our stuff)
Simply, there are several various components to our AI - high level, executional and low level. Low level are mostly those that manage stuff like navigation and pathfinding, NPC2NPC communication, animation stuff, data scopes etc. The execution level is more like a script but not that much - is much more complex, due to its parallel nature (coroutines is the keyword if you like technical details). On the top, there are planning mechanism, either rigid or adaptive, where actually an NPC decides what to do based on its goals, tasks, needs. Finally there is a connectivist level, which provides the NPC world with relations to all what is in the virtual world.
Where is the NPC’s working place? What is the relation to the player? How much does it like to go to a tavern in Samposh? all these questions can be answered rather simply (math magic )
And finally we have the Injected Intelligence - imagine it like this - your head is completly hollow and you walk around the world with the intention to do something. You are drawn to stuff (or you just high level plan it), like you want to work, go to a party at the tavern, etc.
Since you have the connections/relations to places and stuff, you just request something that is to your liking (a place of “fun” or example).
But what to do at that place. … since you are hollow, lets fill that void.
Just ask the place “How to do Fun”. Place can tell you executional detail (“Look for a cup, fill it up, drink it”). But how to drink? You dont know … but you want to drink, just ask the cup “how to pick it up and party”. Do you catch the drift? The intelligence is spread across places and things, it is hidden in various places, the NPC just needs to ask. We call it intelligence decomposition and and intelligence injection
And to just spark your mind - imagine that the conectivism level is adaptive, that it may change based on actions (either player’s or NPCs) and events. That even you can create new connections, that you can get new connections by talking to other NPCs (e.g. 2 NPCs meet at the tavern and one tells the other about the nice old rich herbalist - aaah lets make a connection there, lets head there some day to talk)
But that is only what can be told there is much more dark magic beneath the hood. And by dark, I mean truly dark magic.
And just a small AI goof - the AI world sees the Player as a very simplistic NPC, and actually the Player has internal AI that integrates him into the AI world the same way the NPCs do integrate… When you do something in the world as a player, you actually do it as an NPC
Respects
We have drawn most of our inspiration from Sims, where they solve a similar issue, but a liiitle bit differently.