Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NPC brains

7 views
Skip to first unread message

Duane Morin

unread,
Mar 5, 1994, 6:22:26 PM3/5/94
to
Ok, as many may have guessed by my recent plethora of postings, I know
very little about IF state of the art. Heck, all I really know is a bit
here and there about natural language, and some basic AI. IF intrigues
me because it seems like as good a place as any to explore both of these
topics without worrying about "ultra cool 256color super vga graphics".
(I discovered with much wonder that a personal quest of mine, to develop
realistic personae for "virtual worlds" rather than dealing with the
graphic engine, already exists, namely "Oz." Neat.)

Anyway. Instead of making statements now, let me ask a question. I
think it would be neat to have NPCs have a sort of knowledge frame of
their own, and perhaps some motivation/goals of some sort. Is this
standard for NPCs? For example:

You are in a large cave. There is a troll here. There is a bunny rabbit
here.

The troll comes over to you and says, "Me hungry."

>Tell troll, "Rabbit is food."

The troll thinks for a moment. The troll grabs the rabbit and eats it.

...

Now, internally, the troll character would have a "need" somehow defined
as hungry. The statement "rabbit is food" goes into his knowledge frame
as is(rabbit, food) or something like dat. Having gained new knowledge,
he then processes some internal script like:
If hungry()
{ find_food(); get_food(); eat_food(); }

And find_food would same something like:
For all objects available(X)
if is(X, food) return X;

And so on. Sure, there'd be a bunch of different cases that the author
would have to think up. But there could also be a pool of public knowledege
that all characters could have without having been told, which could
possibly carry over from game to game.

Keeping it simple, one could make up several personalities:
random dwarf - wanders around, looking for items of value. Prefers
gold.
random gnome - collects shiny things
ogre - breaks breakable things

and so on. I think it'd be kinda fun having to grab up objects out of
an ogres way before he smashed them. Or, maybe even setting something
up to lure the ogre into a room to smash a chest that I don't have a key
to.

So, someone tell me. Do NPCs already do this? Can they? Will they ever
be able to? Note, I DONT mean setting up special cases for every NPC,
I'm talking about giving them a little knowledge, and a script, and
letting them do whatever they want.

Duane

Steven Grady

unread,
Mar 5, 1994, 9:35:42 PM3/5/94
to
so...@schunix.dmc.com (Duane Morin) writes:
>Anyway. Instead of making statements now, let me ask a question. I
>think it would be neat to have NPCs have a sort of knowledge frame of
>their own, and perhaps some motivation/goals of some sort.

On a similar note, a few years ago I toyed briefly with the idea of
modeling different sources of belief. I came up with a few
types (lessee if I can recall..):
internal state (hunger, health, etc)
direct observations (seeing a tree in the park)
being informed of something (John said there is a tree in the park)
(There were a couple more, but I can't remember them any more.)

The idea was to have NPCs with limited knowledge, whose knowledge base
could be expanded by interacting with characters (or other NPCs), and
similarly, could be _lied_ to by characters (and perhaps NPCs, although
things start to get pretty complicated then). There would be a level
of belief (internal state was certain, direct observations would be
initially certain, but possibly fade over time [complicated], information
provided by others would depend on the source's believability). Initially
information would default based on the gullibility of the NPC, but perhaps
as information was contradicted by other sources of information (e.g.
direct observation), the source's believability (in the NPC's eyes)
would decrease. My hope was that something like the following could
take place:
You are in a large cave. There is a troll here. There is a toaster
and a rabbit here.

The troll comes over to you and says, "Me hungry."

Tell troll, "Toaster is food."

The troll thinks for a moment. The troll grabs the toaster and eats it.
The troll spits out the toaster, yelling "bleah!".

The troll says, "Me hungry."

Tell troll, "Rabbit is food."

The troll thinks for a moment. The troll says "No believe you" and
eats you.
[RESTART?]

I used Duane's example here, but it probably would be easier to just
deal with physical facts (e.g. where to find food, rather than how to
define it).

Unfortunately, I can't remember any more of my original thoughts, but
perhaps this might trigger some discussion. (Needless to say, I never
actually implemented anything.)
--
Steven
"Did you know the phone company uses the bone marrow
of Third World babies to make microchips?"

Duane Morin

unread,
Mar 6, 1994, 8:44:46 AM3/6/94
to
In article <grady.7...@xcf.berkeley.edu> gr...@xcf.berkeley.edu writes:
> You are in a large cave. There is a troll here. There is a toaster
> and a rabbit here.
>
> The troll comes over to you and says, "Me hungry."
>
> Tell troll, "Toaster is food."
>
> The troll thinks for a moment. The troll grabs the toaster and eats it.
> The troll spits out the toaster, yelling "bleah!".
>
> The troll says, "Me hungry."
>
> Tell troll, "Rabbit is food."
>
> The troll thinks for a moment. The troll says "No believe you" and
> eats you.
> [RESTART?]
>
>Unfortunately, I can't remember any more of my original thoughts, but
>perhaps this might trigger some discussion. (Needless to say, I never
>actually implemented anything.)

Sounds good to me! How come you never implemented anything? Did you
run into a technological roadbloack, or just time/resource tradeoff?

>--
> Steven
>"Did you know the phone company uses the bone marrow
>of Third World babies to make microchips?"

Duane


Steven Grady

unread,
Mar 7, 1994, 3:16:48 AM3/7/94
to
so...@schunix.dmc.com (Duane Morin) writes:
>In article <grady.7...@xcf.berkeley.edu> gr...@xcf.berkeley.edu writes:
>>Unfortunately, I can't remember any more of my original thoughts, but
>>perhaps this might trigger some discussion. (Needless to say, I never
>>actually implemented anything.)

>Sounds good to me! How come you never implemented anything? Did you
>run into a technological roadbloack, or just time/resource tradeoff?

OK, maybe "needful" to say. It was a time/resource tradeoff, and still
is. I read this newsgroup, and maybe I'll start contributing more of
my ideas to it, but I haven't actually tried to implement any of these
ideas, so it seems somewhat like cheating (i.e. I know I feel more
comfortable when someone else proposes an idea that they've actually
tested -- like the MIT Media Lab's great policy of only producing demos
that are actually based on the technology they're working on, as
opposed fake run-throughs which assume things work the way they hope).

One problem is simply that to implement some simply nifty idea (e.g. a
few years ago, I posted a magic system which people seemed to like),
you need a framework in which to implement it. Unfortunately, it's too
easy to say: "the framework depends on all these basic ideas, so I
better solve every one of my fundamental problems before I start
implementing". As a professional programmer I know that trying to get
the entire system designed before implenting anything is impractical, but
since I don't have customers demanding an interactive fiction program
in the next six weeks, I fall prey to the attraction of "doing it
right". The 2nd waffle theory doesn't seem as apposite when you are
in research mode.

This is one reason I'm very impressed with the people in this newsgroup
who have gotten off their duffs and actually implemented something,
in addition to talking about theories. Hell, I get stuck just trying
to decide what language to right in ("I know C best, it's a good
opportunity to learn C++, ooh wouldn't Sather be cool (if only 1.0
were released), Prolog would make some of these problems so much
easier (and a few basic things so much harder), Lisp/Xlisp/CLOS is
the perfect language for the design (but not a real implementation),
etc).

Steven
gr...@xcf.berkeley.edu
"Mind your manners, son! I've got a tall pointy hat!"

0 new messages