Advertisement

Dynamic World-Generated NPCs

Started by February 24, 2001 05:30 PM
27 comments, last by Nazrix 24 years ago
If you''re trying to come up with personality characteristic. Just think about everything you do for a week. Go to church? Piety. Buy fancy fur coat? Thrift. Giveing to the poor? Materialism. PLaying soccer? Interest - Soccer.

Or read a book. Ran over kid, yelled at father about what that kid might have done to your horses? Anti-social, Materialistic, (probably)not pietious, Self-centered, great Ego. actually, I got that one from Dickens...a good source for such things.
I''d rather not register... All those passwords to remember... Also, it is hard to become familiar with such a group of people that have been used to talk to each other on their own level. I dont think I''d understand ev''thing, sorry

Luna

(modification: I registered after all
Advertisement
quote:
Original post by Wavinator
Search space. You''re going to have a very large search space, with a lot of agents sifting through it in pursuit of their goals.



quote:
Original post by Nazrix
That is a problem whether you have random-generated NPCs or not though. Furthermore, there are ways around it. Such as, updating goals of NPCs that are further in larger chunks or less often.


Right, I was speaking more to the general concept of AI agents that generate plot. I believe it is possible, and want to try it, but just wanted to highlight some of the real challenges, random or not. (Didn''t mean to sound so pessimistic, btw )

The overall direction you''re taking probably would be coding a strategy game where the NPCs are units and the strategic actions they can take (and the subsequent interactions) become a kind of plot. X kidnaps Y; J wants you to help Z; Z is in love with and defends X; etc. etc.

This part of my post is slightly OT, but consider that your agents will have to search through a wide array of possible moves, and will need to consider the long term implication of each move. If they do any thinking about the consequences, this becomes long term planning. This is what I mean by the big search space. What does X "think" about when considering kidnapping Y; does X consider the impact? Or alternatives, such as bribing or killing Y. Each of these actions in turn have consequences. And the consequences have consequences.

Now, if you place the (much smarter) player on an equal footing w/ these agents, things get harder. You runy into the same issues that AI coders run in to with strategy games (AI dumb as a brick when moves a complex). Not impossible. But definitely not trivial.

quote:

Actually, the fact is that most of this stuff I was planning on doing before anyway, but the randomness could offer a lot more interesting situations.



Gotcha. You know how I feel about random (Austin Powers: "YEAH, baby!!" ) Lots of potential there, especially in terms of replayability. But you''ll need enough random elements (that matter) in order for players not to notice patterns too much. It''s this increase in elements that makes things tricky.

I just wanted to save you some of the heartache I''ve been encountering (I was trying to speak more to your last point, about the limits of the AI giving the limits of plot).

It would be interesting to consider all the possible actions and interactions the agents could engage in, and the ruleset used to solve them...

--------------------
Just waiting for the mothership...
--------------------Just waiting for the mothership...
quote:
Original post by Luna Zerana

Also, it is hard to become familiar with such a group of people that have been used to talk to each other on their own level. I dont think I''d understand ev''thing, sorry



Hey, everybody''s a newbie once, right? If you hang out long enough, you''ll easily pick up enough to attain guru status. (Uh, then you''ll evolve to a higher plane or board or something...)

Welcome!

--------------------
Just waiting for the mothership...
--------------------Just waiting for the mothership...
quote:
Original post by dog135

The problem is, when you interact with a randomly generated character, what do they say to you?




If communication is difficult, very special and unique, or drawn out, this is going to be a huge brick wall.

However, you can randomize if conversation is more abstract.

Remember the old Ultima''s? Name? Job? Family? etc.

Consider a more detailed but similar approach. Think about what exactly you want to get out of communication (the end goal).

For example, I''d think you''d want to know: About them (details, interests, current problems you can solve), their world / environment (recent events, lore, places), other NPCs (opinion of, history of interactions, possible help they could give you or quests you could solve), and the current state of the generated plot (your mission, what''s happened so far, what you need to do).

Somehow the "strategic plot generator" has to make this information available to the NPCs. Then the NPCs have to communicate it to the player in a fashion that is entertaining, managable, believable, and repeatable without being overly repetitive.

Specific, tailored sentences would be lost. But the hit you take in immersion from this could probably be more than made up for in richness of gameplay.

--------------------
Just waiting for the mothership...
--------------------Just waiting for the mothership...
quote:
Original post by Wavinator

The overall direction you''re taking probably would be coding a strategy game where the NPCs are units and the strategic actions they can take (and the subsequent interactions) become a kind of plot. X kidnaps Y; J wants you to help Z; Z is in love with and defends X; etc. etc.



That sounds more or less what I am thinking, yes.

quote:

This part of my post is slightly OT, but consider that your agents will have to search through a wide array of possible moves, and will need to consider the long term implication of each move. If they do any thinking about the consequences, this becomes long term planning. This is what I mean by the big search space. What does X "think" about when considering kidnapping Y; does X consider the impact? Or alternatives, such as bribing or killing Y. Each of these actions in turn have consequences. And the consequences have consequences.



I see what you''re saying. There''s the side of it where an NPC considers the long-term effects of a short-term goal, and then there''s the other side of it: NPCs having a long-term goal that they want to attain, and must go after short-term goals to attain it.

As for speed of searching through the wide range of possibilities, one possibilitiy is when the player is doing something slightly leisurely like resting, sleeping, docking his ship the NPCs would figure out what they want to do if they haven''t got a plan yet (this is kind of game-specific though) So, the NPCs will figure out what plans they want to execute for a few moments and it won''t interupt gameplay too much. Just a thought...

quote:

Now, if you place the (much smarter) player on an equal footing w/ these agents, things get harder. You runy into the same issues that AI coders run in to with strategy games (AI dumb as a brick when moves a complex). Not impossible. But definitely not trivial.



Yes, I see what you mean, although, as you said RPGs can get away w/ this more than strategy games since it''s often less win/lose.

quote:


Gotcha. You know how I feel about random (Austin Powers: "YEAH, baby!!" ) Lots of potential there, especially in terms of replayability. But you''ll need enough random elements (that matter) in order for players not to notice patterns too much. It''s this increase in elements that makes things tricky.



This is a big concern. NPC X can only kidnap NPC Y so many times, so many ways before it gets boring. Although, plenty of games really are that boring even w/ scripted plots if you ask me

Although, if we are able to have enough elements that can be combined w/ enough other elements and pull it off the rewards would be immense.

quote:

I just wanted to save you some of the heartache I''ve been encountering (I was trying to speak more to your last point, about the limits of the AI giving the limits of plot).



I appreciate the voice of reason






Need help? Well, go FAQ yourself.
What a plight we who try to make a story-based game have...writers of conventional media have words, we have but binary numbers
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
Advertisement
1. Plot generation. Pre-generate a tree that the NPCs can traverse to create a plot. Say the first few nodes weed out the plots that would be inappropriate for the NPC - age, sex, death, etc. Then the next few would give you a bsaic plot (1 of The Thirty-Six perhaps), and then a choice of variations on that theme. From there you link to the current list of NPCs and Items to see who and what can be used in your quests.

2. Goals. I call these Intentions, and implement them like so:

You have Goals & Plans. Goals are what you want to accomplish now, and Plans are what you need to accomplish now to fulfil a Future Goal. Both are then either committed or non-committed (whether you''re actively trying to accomplish them, or are going to get around to it soon) and Committed Goals are further ordered by priority in your Queue.

3. Processor time. This takes tweaking, but, you have your AI running at a set speed when the player is active, then as soon as he or she gets to a point where FPS aren''t important (buying, talking, sleeping (?), etc., crank it up as high as you can, and precalculate as much as possible.

It can be done, just remember : Simplify, people



"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..." -- Merrick

"It is far easier for a camel to pass through the eye of a needle if it first passes through a blender" -- Damocles
"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..." -- Merrick
Alright, I''ve read through this topic and I''ve decided to put in my two cents. I''m going to focus more on implementation and goal issues rather than random generation. My ideas are more amenable to a long term solution that may be useful in a couple of years, as opposed to six months from now.

Using Soar (What''s Soar, you''re probably asking), I programmed a production system which enabled an agent to receive information from another agent. Let''s call the receiving agent A and the information providing agent B. Agent A would then build what I called a ''hypothesis acording to B''. Agent A would ''remember'' this info but not incorporate it into agent A''s own hypothesis about the world immediately. If the ''hypothesis'' does not conflict with what agent A knows about the world, agent A will then assimilate the ''hypothsis'' into agent A''s own belief about the world. But agent A would also keep the fact that this info came from B. If, on the other hand, the ''hypothesis'' conflicts with what agent A knows about the world, agent A would not assimilate ''hypothesis'' into agent A''s beliefs, but keep the information as a seperate ''hypothesis according to B''. Also, agent A would note that agent B is either providing false information, doesn''t know any better, or entertain the notion that agent A has incorrect information to begin with. If, later, agent A receives some more information from B that conflicts with agent A''s ''hypothesis accroding to B'' then agent A can draw the conclusion that agent B is also illogical.

An example:
-----------
Agent A believes the gun is in the top drawer of the cherry dresser that is in the guest bedroom of the Smith house. Agent A also knows that if X is in Y and Y is in Z then X is in Z. Agent A also knows that if X is in Y and Y is NOT in W then X is NOT in W. So agent A infers and knows that the gun is in the Smith house and also knows that one house is NOT in another house so the gun is not in all other houses. We''re talking about a particular gun here.

Agent B comes along and informs agent A that the gun is in the Reynolds house. Agent A forms a ''hypothesis'' noting that agent B believes the gun is in the Reynolds house. The production system automatically calculates the contradiction here and so agent A decides to not incorporate this information into A''s knowledgebase. Simultaneously, agent A draws some conclusions about agent B''s knowledge.

Let''s say instead that agent A has no knowledge of the gun''s whereabouts and agent B comes along and informs agent A that the gun is in the Reynolds house. If agent A has no prior knowledge that agent B is illogical or lies or is stupid, then agent A can eventually assimilate this information into A''s own knowledge.

This all works. And it can go a long way towards handling goals. Soar is also able to manage multiple simultaneous goals both long and short term. Additionally, Soar is able to run multiple independent agents simultaneously which can communicate with one another.

I had some things to mention regarding random generation but I''ll save that for another post.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
quote:
Original post by morfe
1. Plot generation. Pre-generate a tree that the NPCs can traverse to create a plot. Say the first few nodes weed out the plots that would be inappropriate for the NPC - age, sex, death, etc. Then the next few would give you a bsaic plot (1 of The Thirty-Six perhaps), and then a choice of variations on that theme. From there you link to the current list of NPCs and Items to see who and what can be used in your quests.





This is a very fine idea, but I am more thinking along the lines of Wav's final post in the Strategy as the main plot thread. I think it would allow for plots to be made up of NPC's actions which are used to attain their goals rather than a pre-made plots with variations. Then, it is easier for the player and other NPCs to do things that alter the game environment that will altimately alter what NPCs want to attain.

Perhaps what you're proposing and what Wav is talking about will generate a fairly similar end result though.






Need help? Well, go FAQ yourself.
What a plight we who try to make a story-based game have...writers of conventional media have words, we have but binary numbers


Edited by - Nazrix on March 1, 2001 3:36:48 PM
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi

This topic is closed to new replies.

Advertisement