NPC AI and Learning.

Michael Hohensee michael at sparta.mainstream.net
Sun Sep 7 15:46:18 CEST 1997


I believe there was a thread on the subject of how to make NPCs
act/fight in a more intelligent manner.  Instead of writing complex
programs, or mirroring the actions of a (supposedly) intelligent player,
one could institute a learning process for NPCs.

The idea (cheerfully stolen from one of the "Berserker" stories) is
based on the fact that for any given situation, there are a certain
number of possible actions to take.  Which action is actually taken by
the NPC is determined randomly from the availible choices. 

If the NPC is successful (ie, wins a game, gains something, or survives
a fight) the choicelist stays the same.  If the NPC loses, all choices
it selected are deleted as possibilities for future events.

At first, this creates increadably stupid NPCs.  They'll go around
hitting themselves in combat, attacking walls, trees, and large
monsters, and basicly losing at every turn.  But as time goes on, they
lose less and less, as the negative behaviors are wiped from the
possible choices.

So we end up with fiendishly efficient NPCs, while retaining a random
element for variety. :)

The only problem with this is the tremendous overhead it would generate
if implemented per creature.  Perhaps a better way would be to have one
unified "action bank" which all NPCs draw from.  That would be something
special.  If Bubba the goblin slayer goes out and stomps lots of goblins
to dust, they'll eventually become more resistant (as possible) to his
attacks.  If Bubba then tries to seek greener (and wimpier) pastures,
he'll find that the neighboring orc tribe has heard about the new goblin
tactics, and have an interesting time of it. :)

This effectively makes killing creatures very difficult.  The only safe
way I can see to kill NPCs under this system would be to either grossly
outclass them, or kill them instantly, before they can react. :)

Any comments on this?

--
Michael Hohensee       michael at sparta.mainstream.net
http://www.geocities.com/SiliconValley/Heights/9025/
      Finger me for my PGP Public Key, or use: 
http://sparta.mainstream.net/michael/pgpkey.txt



More information about the mud-dev-archive mailing list