First, let me say that in my currect project, all my NPCs are given an AI state, whether it be to do nothing or try to kill the player, ... simple stuff.
Defining NPC behavior, I think, should all be a matter of AI; since an NPC *should* be made to replace a PC, it should act like a PC. The problem is, as others have pointed out, that actually realistically programming this is unfeasable.
So we have scripts. In my project, a script consists of an AI state, and several lines of text that the NPC cycles through during user interaction.
Scripts are used to make up where technology fails us. We can't programmically create a perfect player facsimile, so we script a psudo-player who will have certain characteristics of a PC, but will also have certain obvious limitations.
Quote:Agreed. I mean, if your shop is on fire, you don't just keep on trying to sell your wares. |
So from this mindset, we would not allow the shop to catch fire, and if we did, we would already have prepared a script to accommidate this eventuality.
Though I'm not arguing scripts are bad. The problem is, that at some point in the game you will run out of scripts, unless you constantly update them (which, again, is unfeasable), simply because you
can't predict every eventuality.
So this is where the AI solution steps in. With AI, whether it be an ANN, or a simple heuristic, (with or without a script) it should preform dynamic actions. I'm not suggesting that we all go out and write (or attempt to) ground breaking MORPG AI that behaves exactly as a human would. No. What I'm saying is have the AI try to play the game as the human plays the game.
For example. In my project, you start out next to a castle with a guard. The guard is friendly, and will talk to you. If you try to assault the guard, he will take on to this, and become unfriendly to protect himself. If his friends in the castle see that their friend outside is getting rough housed, they'll defend him, and so on. The problem is, it is all scripted, and will happen the same way every time you play the game.
I think the solution behind this is genetic algorithms. If you slay the guard, and then the castle garrision comes out, and you slay them and take the castle, then the incident should be recorded, so that when you come to the next castle in the kingdom, they'll wisen up and not open the gates for you.
The key behind this is that you, as a programmer, do not have to anticipate every eventuality. Because, frankly, thats near impossible without making so few options for the player so as to make the game boring. The NPCs themselves would learn from their own mistakes, and build their own database of eventualities, and in this way become "smarter".
And then you can work from there: multiple generations of AI; parents and childern, the genetic inheritance of knowledge, characteristics, etc., so that you could train a system of NPCs to your liking, then lock the databases. Or keep them unlocked.
I've always found that genetic algorithms can often produce strange, but oddly pleasing results.