[MUD-Dev] [MLP] NPC Complexity

Kwon Ekstrom justice at softhome.net
Sat Apr 20 10:00:54 CEST 2002


I haven't replied to much lately, works been giving me some pretty
hefty deadlines, but I have a few spare moments.  I've been meaning
to reply to this AI thread since AI is something I intend to work on
a great deal for my game.  I've got a variety of ideas that should
be easy to extend and could perhaps turn into a powerful motivator
over time.

About a year and a half ago there was a thread about AI where
someone came up with the idea of Layered AI... which I took and
solidified.  The discussion about it seemed highly theoretical and
too complex... and tried to make it do things better suited to a
standard practices.

Anyway, each creature in the game would maintain a list of personal
AI's, this is for the most part empty.  When events get passed to
the Creature, it passes them to the AI object first.  If the
Creature doesn't have any personal AI's, it passes it up to the next
layer, the Racial AI.

Talking with a friend of mine, who is more interested in a
self-evolving game with more realistic NPC's, we refined this to
allow Kingdom/Town AI's which would define how different NPC's in
the game would interact with each other.

In a state of war for example, different NPC's would fight each
other, other NPC's could be given Bandit AI's and work in groups in
this mannor with a shared AI.

From: "Sean Kelly" <sean at ffwd.cx>
> From: "shren" <shren at io.com>

>> I've always wondered what would happen if monsters spawned out of
>> other monsters and wandered in packs from there instead of
>> spawning in a specific site.  Every time you kill an orc, an orc
>> pops out of another orc.  Even if you started off with the orcs
>> evenly distributed across the world, after a period of play
>> they'd be compressed out of regular player areas.

> Popped out of another orc somewhere else in the world?  Seems
> reasonable.  Though with the incredible monster turnover in most
> games, you would end up with tremendous orc populations in less
> traveled parts of the world.  It would likely take some careful
> tuning :).

I imagine this would generate a society shift in how the players
interacted.  Explorers would become more important.  You would
definitely start to see players work in groups telling each other
where they find things.  What would make it interesting is if you
gave your NPC's an exploration drive.  So although they start to
group together, they would try to expand the territory they're in.

The major problem I find with this is that not only a specific type
of NPC will get concentrated into that area, a likely result will be
a mud barren of mobs where all of the mobs reside in some rarely
visited part of the world.  That's why a drive to expand will become
necessary.  Give an optimum density before mobs get agitated and try
to find a more suitable home.

With the Layered AI you could have the mud group a set of your mobs
together and assign one mob a "leader" role (making it active and
the rest just follow the lead, this will cut down processing
resources and solve alot of problems with members wandering off and
getting lost)

This could generate a "roving band" of orcs to harrass the
neighboring areas.

>>> Fascinating would be virtual villages and towns which responded
>>> to surrounding events. If NPCs left villages (and closed
>>> shops/abandoned buildings) and moved to the city (Growing the
>>> city and the guards/tax revenue there) due to player
>>> combat/banditry in the region, would other players respond to
>>> put down the bad guys so they'd continue to have shops to do
>>> business with?

> This was a feature I had originally thought was going to be a part
> of UO.  The initial hype seemed like things like monster raids of
> towns would not be unheard-of.  But I guess even if this were
> worked into the code, the destruction of the ecology guranteed
> that it would never happen in practice.

Me and a friend of mine discussed this possibility with the layered
AI.  Scion wanted the opposite, he wanted NPC's to build villages on
their own.  We figured that you select an arbitrary room as the
"center" of your village.  Then villagers pick "roles", I figure
that if one villager gets assigned the role of mayor then assigns
the roles to the surrounding NPC's it'd work a little smoother.

Then you pick an axis to build your main road on, and the villagers
line up and build their shops.  Most of this happens behind the
scenes over a variety of time.  Likely a 30 minute timer so that
players in the area see a town get built, but it doesn't really get
built, it just appears over a period of time.  (I'm a big fan of
making things look realistic without wasting the time on doing each
step... smoke and mirrors if you will)

There was alot of discussion on trade and trade envoys.  The
resulting thing was over time nearby villages are found (via
explorer mobs) and roads are built between cities and trade is
generated. (marked rooms)

We discussed roving bands of "unaffiliated" NPC's which would find
these roads and lay in wait for NPC's.  If no players are in the
area it just compares the groups... if PC's are there to witness
then it starts a fight (Bandits prefer to kill PC's first so we can
then revert to simple number crunching to determine who wins)

Villages would then attempt to hire PC's as guards... it'd be slow
boring work, but will have decent rewards.  We theorized over time a
village may come to know and recognise PC's who help them often.

The idea is to give the world an evolving appearance, and encourage
PC's to interact in beneficial ways, while doing what they like most
(killing).

>> They can be a whole lot more, but you have to pay a huge bill in
>> CPU time.  I used a multi-user HP box to run my grass/shrub/tree
>> simulation, and it used enough power on that box that I came to
>> the attention of the system administrators.

> Yup.  This wouldn't work on a shared system.

My system uses localized events with a simple integer ID so objects
can quickly discard events they don't recognise.  Most of the world
maintains a "vaccuum" where only certain events are propogated (time
changes)

It should be able to create more diverse behavior in the mobs while
merely sipping system resources.

-- Kwon J. Ekstrom

_______________________________________________
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