[MUD-Dev] TECH: Complex NPCs
Robert Zubek
rob at cs.northwestern.edu
Tue Apr 2 18:54:25 CEST 2002
On Sun, 31 Mar 2002 07:56:24 +0000
tryguy74 <tryguy74 at hotmail.com> wrote:
> I base my speculation on "The Sims". Essentially, I'd like to
> dulicate this kind of functionality to a text-based
> environment. I've been thinking of what functionality I'd like my
> NPCs to have, and The Sims' npcs have most of the underlying
> intelligence I'd like. I've read that The Sims' technology is
> based on fuzzy state machines and a-life. This makes sense.
Here's what I pieced together from GDC presentations and talking to
developers:
Sims' autonomous behavior is an interplay of their internal drives
and what the environment offers. Each sim has the individual drives
that need to be satisfied - hunger, energy, etc. - which are simple
scalar values. Also, each object in the world projects a vector
field (*) attracting sims to the object. The vector field's
attraction for each sim is a function of the drive that the object
satisfies - for example, a fridge is going to strongly attract a
hungry sim, but only weakly influence a satiated one. Furthermore,
the attraction function is usually nonlinear with respect to the
sim's needs - for example, attraction of the fridge as a function of
hunger might be superlinear (ie. very strong when hungry, much
weaker when not quite so hungry), while the attraction of other
people as function of social needs might be sublinear (ie. weak only
when feeling socially 'fulfilled', quite strong otherwise), etc.
[* It's not necessary to represent it as a field of directional
vectors - it could also be represented as a heightmap, and following
the vector field would be implemented as hill climbing.]
In order to do navigation and action selection, at every iteration
cycle and for every sim one can take all of the vector fields
emitted by the environment, modify their strength based on the
current sim's needs, collapse them into one vector field via a
mechanism such as vector summation or vector-max, and then follow
the resulting field. This has the effect of moving the sim closer to
the strongest attractor.
Then there are optimizations one should do. Some of the computation
(such as the initial vector field) only needs to be done once when
the object is placed in the world. The strength adjustment and
collapsing should also be doable just once for the sim's current
position and not for the entire vector field. Finally, one needs to
add mechanisms to get out of local maxima - such as simple
pathfinding or timeouts.
Hope this helps,
Rob
--
Robert Zubek
rob at cs.northwestern.edu
http://www.cs.northwestern.edu/~rob
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list