Best way of defining NPC behaviour

Started by
41 comments, last by C-Junkie 19 years, 7 months ago
Well, I have spent far too long away from the dreams of creating games, but now I want to try and rekindle some of those thoughts so long ago that were expressed across these boards. So the question is going back to the basics of NPC actions. Basically what I would like to see is NPC's who are autonomous. They have their own goals and needs and can gain more goals or needs as they progress. They do require interaction from a Player Character to trigger their actions, and they are free to interact with other NPC's. This is an idealistic view, correct? Well I would like to see what ideas we can create as to how we might go about this. Do we need to think of NPC's as need driven (need to eat, drink, escape) or do we think of them as goal driven (desire power, desire wealth, desire freedom) or some mismatch of both. Previously there was a lot of discussion about Needs driven NPC's that had a priority for each need. They would be following a certain need until such time as another need gained high enough priority (or they lowered the priority of the first need) for a different action to result. Discuss. :)
Advertisement
Wouldn't it be cool if one day we could create fully autonomous NPC behaviour that could produce a simulation consisting of a few million of these agents?

Then we introduce players to the equation where they can fully interact with these agents. It's sort of an MMO but with more NPCs than actual players. In fact, you can't tell if a person is a player or NPC without talking to it.

As for your question, I think NPCs should be both need and goal driven as we all humans are. I feel that NPCs should 'work' without player interaction. The interaction between players and other NPCs should be the same for most parts, except in the language used to communicate to humans.

You also have to factor into account the psychological side of needs and goals. NPC A might forgo the need of food in order to save NPC B. This would likely be some sort of fuzzy system whereby needs, goals, desire and character traits affect the outcome.
Quote:Original post by dwarfsoft
Well, I have spent far too long away from the dreams of creating games, but now I want to try and rekindle some of those thoughts so long ago that were expressed across these boards.

YAY!
Quote:
So the question is going back to the basics of NPC actions. Basically what I would like to see is NPC's who are autonomous. They have their own goals and needs and can gain more goals or needs as they progress. They do require interaction from a Player Character to trigger their actions, and they are free to interact with other NPC's.

Do you mean: "don't require interaction from a Player Character to trigger their actions"? because if that's the case, then things could be very interesting (i'm thinking maybe a fable like world...except with much less player impact)
Quote:
This is an idealistic view, correct? Well I would like to see what ideas we can create as to how we might go about this.

A fully autonomous world is probably a bit idealistic, but it sure would be fun to make!
Quote:
Do we need to think of NPC's as need driven (need to eat, drink, escape) or do we think of them as goal driven (desire power, desire wealth, desire freedom) or some mismatch of both.

Hrm... both, imo. An NPC should have a few basic needs (survival for instance). However, they should also be goal driven, or perhaps we should say ambition driven. I would think that different NPC's would express different levels of these goals and needs. So, you know, a blacksmith would take pride in his work and strive to be the best blacksmith.
Quote:
Previously there was a lot of discussion about Needs driven NPC's that had a priority for each need. They would be following a certain need until such time as another need gained high enough priority (or they lowered the priority of the first need) for a different action to result.

Weights and balances, perhaps... With some way of applying them to inputs, thus enabling their behavior to differ based on "personality"

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quote:Original post by Washu
YAY!

YAYX0R times 2!
Quote:
Do you mean: "don't require interaction from a Player Character to trigger their actions"? because if that's the case, then things could be very interesting (i'm thinking maybe a fable like world...except with much less player impact)


Meaning that each NPC goes around in its own little story being need and/or goal driven and the plot continues to expand (or even finish) with just this NPC and other NPC's it meets. The Player then could come into the middle of a story, which is where the whole idea turns from the pre-scripted kind of stories that we are subject to at the moment.

Each NPC effectively lives out their existence as a stranger to the PC whether or not the PC has ever come close to interacting with them. Obviously this would only be a small(ish) number of NPC's because millions would require more computer power than is currently possible.
Quote:A fully autonomous world is probably a bit idealistic, but it sure would be fun to make!


Well, the idea is that we first have to start taking steps towards it before it can eventually happen.

Quote:Hrm... both, imo. An NPC should have a few basic needs (survival for instance). However, they should also be goal driven, or perhaps we should say ambition driven. I would think that different NPC's would express different levels of these goals and needs. So, you know, a blacksmith would take pride in his work and strive to be the best blacksmith.


How then do we balance the needs vs goals. This became one of the pivotal points to the downfall of the NPCAI/IOL project (other than time constraints of the members). Do needs totally outweigh goals, if so then the characters are always thinking only of their food status at the time instead of becoming totally driven to mad power types of people. Goal driven creates a more interesting character, and need driven creates a more realistic character.

Quote:Weights and balances, perhaps... With some way of applying them to inputs, thus enabling their behavior to differ based on "personality"


Personality is a great topic. How do you define the personality though? Do you think of it as a static personality created by the game designer, or more of a dynamically (randomly) created character. How then would you control a consistent character.

Questions, questions.
Quote:Original post by dwarfsoft
Well, I have spent far too long away from the dreams of creating games, but now I want to try and rekindle some of those thoughts so long ago that were expressed across these boards.


[grin] Now all we need is a return of Naz and Landfish, then the boards will implode!!!! (Hey, you see I'm still trudging along... least now I don't feel so lonely!)

Quote:
Do we need to think of NPC's as need driven (need to eat, drink, escape) or do we think of them as goal driven (desire power, desire wealth, desire freedom) or some mismatch of both.


I think you can get some interesting (if not necessarily brilliant) behavior from needs. Goals, OTOH, can require you to match wits with the player, which is the classic problem AI developers have in RTS and turn-based strategy games. Goals require alot of preprocessing, decision space searching and preplanning if these goals are to outwit the player, let alone other NPCs.

One gameplay challenge would be to give the player enough information so that they could be active participants in the events of the world, figure out and counter what certain NPCs were doing and make meaningful changes without being overwhelmed.


Quote:
Previously there was a lot of discussion about Needs driven NPC's that had a priority for each need. They would be following a certain need until such time as another need gained high enough priority (or they lowered the priority of the first need) for a different action to result.


Gameplay again: The one major problem I have with this idea is getting it beyond the interesting ant sim stage. Let's say you wound an villain and they now have a need to heal. As a player, you can consider all the supply points for a need (the doc's office, the general store, etc.) but does this simply mean you head of the NPC at the pass (predictably) or does it mean that the NPC is smart enough to leave a false clue and ambush YOU at the doc's office?





Quote:Each NPC effectively lives out their existence as a stranger to the PC whether or not the PC has ever come close to interacting with them. Obviously this would only be a small(ish) number of NPC's because millions would require more computer power than is currently possible.


For the effort, you'd definitely want the player to somehow be able to tap into these stories. Having said that, you might fake more NPCs by allowing life stories to initialize at different places. It wouldn't be a complete sim, but it would have the illusion of such.


Quote:
How then do we balance the needs vs goals. This became one of the pivotal points to the downfall of the NPCAI/IOL project (other than time constraints of the members). Do needs totally outweigh goals, if so then the characters are always thinking only of their food status at the time instead of becoming totally driven to mad power types of people. Goal driven creates a more interesting character, and need driven creates a more realistic character.


How about characters made of different weightings of both? The adventurer that thinks only of his stomach versus the villain that bleeds to death trying to kill you.

Quote:
Personality is a great topic. How do you define the personality though? Do you think of it as a static personality created by the game designer, or more of a dynamically (randomly) created character. How then would you control a consistent character.


I like the dynamic idea, but without control. But then, I'd like more anarchist story environments I could step into. :)
--------------------Just waiting for the mothership...
Quote:Original post by dwarfsoft
YAYX0R times 2!

YAYX0R times 3!
Quote:
Meaning that each NPC goes around in its own little story being need and/or goal driven and the plot continues to expand (or even finish) with just this NPC and other NPC's it meets. The Player then could come into the middle of a story, which is where the whole idea turns from the pre-scripted kind of stories that we are subject to at the moment.

Exactly, hence even if the player never meets an NPC, that NPC could have an indirect effect on the future of the PC.
Quote:
Each NPC effectively lives out their existence as a stranger to the PC whether or not the PC has ever come close to interacting with them. Obviously this would only be a small(ish) number of NPC's because millions would require more computer power than is currently possible.

Hrm, stranger, perhaps not. Consider this: NPC concocts a plan to make money, he bribes some gangsters, they rob a bank. the PC stops the gangsters, and the money is returned. You are still a "stranger" to the NPC, however you are now a nemisis of his. He does "know of" you.
Quote:
Well, the idea is that we first have to start taking steps towards it before it can eventually happen.

I agree, little bits of individualistic growth on the parts of NPCs would help to further us torwards a fully autonomous world.
Quote:How then do we balance the needs vs goals. This became one of the pivotal points to the downfall of the NPCAI/IOL project (other than time constraints of the members). Do needs totally outweigh goals, if so then the characters are always thinking only of their food status at the time instead of becoming totally driven to mad power types of people. Goal driven creates a more interesting character, and need driven creates a more realistic character.

Well, depends. See, a heroin type NPC will tend to ignore his needs and work more for his goals. However a civilian NPC will be more concerned with his or her needs than with goals. So the real question is: How do we generate the characters such that we will have a diverse mix of goals and needs, but that the majority of the characters focused on needs more than goals. As long as those needs are met, they will pursue their goals. But when those needs are not met, they behave like most civilians, duck and run.
Quote:
Personality is a great topic. How do you define the personality though? Do you think of it as a static personality created by the game designer, or more of a dynamically (randomly) created character. How then would you control a consistent character.

Hrm, this is one of those design time vs creation time problems. Now, some of the characters will have to be created at design time. These character should be story points. People of interst, atleast initialy. However, I would hope that we could generate a diverse world at creation time (like when the game loads up). This world should be populated by vilians and heroins. The player should then just like an ant in a nest. He's not fixed and can do his own thing, but there is an overarching story to be told. The same goes for the NPCs... be amusing if your game won itself because an NPC hero rose up and completed the quests while your PC was out getting drunk, gambling and playing with the wenches.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quote:Original post by Wavinator
[grin] Now all we need is a return of Naz and Landfish, then the boards will implode!!!! (Hey, you see I'm still trudging along... least now I don't feel so lonely!)


Let all our workdays be slow and we all have time to browse the Game Design forum ;)

Quote:I think you can get some interesting (if not necessarily brilliant) behavior from needs. Goals, OTOH, can require you to match wits with the player, which is the classic problem AI developers have in RTS and turn-based strategy games. Goals require alot of preprocessing, decision space searching and preplanning if these goals are to outwit the player, let alone other NPCs.


So basically you are suggesting that there be a needs list, a goal list, and a % balance between the two.. Like, say, 60% to 40% or 20% to 80%... so perhaps the different lists are polled that percentage of the time?

Or instead do we just have a single queue with needs and goals intermixed and individual needs or goals are weighted to be more important than others. This would be more process intensive I would believe but I think this might be the balance that would create the most interesting characters.

Quote:One gameplay challenge would be to give the player enough information so that they could be active participants in the events of the world, figure out and counter what certain NPCs were doing and make meaningful changes without being overwhelmed.


The way I see it, every character in the game should have their own personal story, no matter how mundane. The player simply must interact with NPC's until she finds herself an interesting story in which to participate. One way or another, the player will eventually find an NPC that knows of an important story of another NPC (this is what I'd like to see: NPC's communicating information with each other).


Quote:Gameplay again: The one major problem I have with this idea is getting it beyond the interesting ant sim stage. Let's say you wound an villain and they now have a need to heal. As a player, you can consider all the supply points for a need (the doc's office, the general store, etc.) but does this simply mean you head of the NPC at the pass (predictably) or does it mean that the NPC is smart enough to leave a false clue and ambush YOU at the doc's office?


Who says that it can't heal itself over time? Give more options as to how tasks can be done. There should be some inherrant illusion of intelligence, so by showing the player that there are more ingenious ways of achieving tasks in the world they are performing dual tasks for the game world. They are giving the player a more enhanced experience by being unpredictable as well as being teachers ;)

In your situation I would like to see the NPC able to heal itself away from the player, but expect what the player will do (from its interactions and known actions in the past) and react to give itself more chance based on the guestimation of the players actions.

Quote:For the effort, you'd definitely want the player to somehow be able to tap into these stories. Having said that, you might fake more NPCs by allowing life stories to initialize at different places. It wouldn't be a complete sim, but it would have the illusion of such.


Yes, this is true. Of this game world I would definitely not expect all the stories to have started during game time. Some would have started and finished long before the player got there, some would be just starting, and others would be just finishing, some would start based on current events and the effects they have on the world. It would be something to behold, different stories coexisting and cointeracting. But this is still just a dream, we'll need something more concrete first before we can work towards such game design paradise ;)


Quote:How about characters made of different weightings of both? The adventurer that thinks only of his stomach versus the villain that bleeds to death trying to kill you.


Now this is something that I'd like to see. And also see if the system would work to incorporate a kamikaze soldier ..

Quote:I like the dynamic idea, but without control. But then, I'd like more anarchist story environments I could step into. :)


Agreed :P
Quote:Original post by Washu
Hrm, this is one of those design time vs creation time problems. Now, some of the characters will have to be created at design time. These character should be story points. People of interst, atleast initialy. However, I would hope that we could generate a diverse world at creation time (like when the game loads up). This world should be populated by vilians and heroins. The player should then just like an ant in a nest. He's not fixed and can do his own thing, but there is an overarching story to be told. The same goes for the NPCs... be amusing if your game won itself because an NPC hero rose up and completed the quests while your PC was out getting drunk, gambling and playing with the wenches.


I think here you have just summed up the game world I would like to create. And to boot what if there were multiple hero's that wished to save the world, and what if they just couldn't bear that anybody else save the world except them. Some would work in teams and others for their own merrit. Wouldn't it be great to see a few PC's and lots of NPC's rushing toward the end of the game both fighting off each other and striving to be the first. How great would it be? It's like the game has a mind of its own, and it wants to be beaten and won, and it would rather it won itself and left us humans to wonder why machines are better than men... er... well, you get the idea...
Quote:Original post by dwarfsoft
I think here you have just summed up the game world I would like to create. And to boot what if there were multiple hero's that wished to save the world, and what if they just couldn't bear that anybody else save the world except them. Some would work in teams and others for their own merrit. Wouldn't it be great to see a few PC's and lots of NPC's rushing toward the end of the game both fighting off each other and striving to be the first. How great would it be? It's like the game has a mind of its own, and it wants to be beaten and won, and it would rather it won itself and left us humans to wonder why machines are better than men... er... well, you get the idea...

Heh, that sounds about along the lines I was thinking. Hrm, multiple hero's... It could certainly crop up. Depending on their goals they might be egomaniacs, and thus try and win without the help of the others, maybe even going to such extremes as to kill the other hero's. Add to this another layer, what is the reward for winning the game? Fame and Fortune? Eternal life? Power? Or perhaps each hero has heard of a different reward, thus changing how they approach the problem. Considering the heroin that hears about great heaps of gold form whomever kills the dragon...he's motivated by greed.

He's also going to be more likely to spend funds on eliminating the other hero's, and more than likely will betray those that help him. So, how do we model this in a manner that is replicatable in a game? I think the first step is to define the exact needs and goals we want a character to be able to have. Given a set of these we can decide which ones they have, and what the weights are on a given need or goal. Or we need to figure out some other system which will allow us to programatically create the traits we desire.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Really there should be a standard set of goals and needs that are common amongst the NPC's. Some would be mandatory (food and drink etc) and others would be either low or non-existent in some NPC's (greed, bloodlust, etc).

So what should we be looking for as our main driving point of NPC's?

This topic is closed to new replies.

Advertisement