[MUD-Dev] Efficient AI?
olag at ifi.uio.no
olag at ifi.uio.no
Thu Mar 3 14:27:22 CET 2005
I just thought about how to implement efficient markov chain based
AI for a MUD. Maybe this implementation strategy is unworkable, or
maybe it is well known, but it might be worth a discussion.
ASSUMPTIONS
1. Selection the next ideal state is based a complex function F
and a wide array of parameters
2. You can create a hashing strategy which approximates F. (by a
genetic algorithm for instance)
3. Picking the wrong next state isn't critical.
4. Life-like AI is more important than smart AI
5. Efficiency is more important than accuracy.
PSEUDO CODE
switch (cleverhash(npc.stats, npc.environment, npc.eventhistory)
+ npc.anger * random()) {
case 0-9: if this_state_is_fatal(npc.stats) select a safe state
else set_state...; break;
case 10-19: if this_state_is_fatal...
...
case 20-39: if this_state_is_fatal...
case 40-45: ...
case 46-100:
default:
}
EXPLANATION
The basic idea is that you can find a clever hash function that
will get you to a reasonable state most of the time, but that you
sometimes will end up with the less perfect state. However, it is
life-like to make errors, so that might not be a problem for a
MUD.
Each state is indexed by an interval. Similar states have index
values that are close to eachother. The size of the interval
reflects the probabilty of that state. A random factor is added to
make behaviour less predictable and the more upset the NPC is
(npc.anger) the less predictable he becomes.
Is this workable? Is it possible to construct such hash-functions
from a perfect heurtistics, by using a genetic algorithm? I should
think so.
Ola.
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list