Sign in to follow this  
dwarfsoft

Best way of defining NPC behaviour

Recommended Posts

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. :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Hrm, well, we could use a simple model, like this one:
Maslow's Hierarchy of Needs

As for goals...that one is harder, I mean there are the obvious ones, greed, lust, power, fame, fortune (difference between this and greed is that one should be considered more evil, while the other is neutral/good), hrm, many others do exist.

One of the main problems I can see is that as our list grows, so does the computational power required to actuate that list. So the more concise it is, the more power we can spend on accurately modeling it. Then again, the more complex the model, the more accurately it will model reality. Choices, choices...

Share this post


Link to post
Share on other sites
Quote:
Original post by dwarfsoft
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.

I am actually implementing a need driven behavior model for our NPCs myself.
Basically needs are used to calculate the actions an agent will perform, but the agent goals will be used to calculate (or better: modify) the weights of the needs.
Say an agent has the goal to be the MOST FAMOUS agent on the world. That's the goal. There may be a rule set saying you gain fame when surviving danger (for example slaying a dragon) or you gain a high ranked political position.
Let's asume the agent decides to head out for danger (As he is strong and no whimp but not rich to brible himself into a political position.)
The need for DANGER of the agent now is set to a higher level, as he now heads out for dangerous places.
Now there is a rumor spreading in the city telling about some bandits bringing DANGER in a forest outside the city. This is being added to the knowledge of the agent, and matches his need for DANGER.
Finally the rumor about bandits in the woods will attract the agent in his search for becoming famous.

Maybe he kills the bandits in the woods and gets his hands on some money, and suddenly the next rule for modifiying needs fires: the agent has money and will bribe into a political position.

Share this post


Link to post
Share on other sites
Quote:
Original post by dwarfsoft
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.

I agree. In fact, I think that for such a game, the background story should be very fleshed out. Something that I always dislike about modern RPG games, pen and pencil included, is that the background isn't really that well fleshed out. It's hard to get immersed in the world when you can't even relate to the NPCs backgrounds because you know nothing really about the world they grew up in.

Things like bandits, why are they bandits? is it just because they are inheritly evil? not likely. Most often it would probably be some great loss, like their homes being destroyed, war, etc. These things would drive the person to become a bandit.

Now taking that into account, is it right to kill the bandits? Perhaps if you solved a problem elsewhere, the issue might disolve on its own. Such as deposing of an evil king.

Take magic for instance. How and why? Who discovered it? If no one knows, fine, that works for me. But things like: why did they have powerful magic way back when, but not now? Did it somehow decline in power? Or is it just that all of the great wizards died out in some war, leaving only partially trained apprentices behind to salvage their work?

It's things like that which make me grind my teeth. I don't feel as drawn into the story as I would if i had the same amount of information on the background of the place as the average child in such a place would.
Quote:

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).

EXACTLY!!!!
How do you hear about this great evil dragon? How did the villager that told you hear about it? Presumably he was told by a traveller, what kind of a traveller? well, a trader most likely. How did the trader hear about it? Well maybe he was in the village when it happened. So as he's travelling, he tells others, and in turn attracts hero's, not just you, but many others. Some drawn by the lure of the dragons treasure (they always have treasure.), others by their good hearts (HAHAHAHAHA! Yeah right.), and still others by the fame that they will get for killing this evil dragon. Thus we have setup the scene for a competition, whereby whomever can kill the dragon wins...or do they? I mean remember, what happens in the dragons cave stays in the dragons cave...so should you happen upon the hero fresh from his slaying of the dragon, and slay him...you might very well claim credit!

Share this post


Link to post
Share on other sites
The game that I'd most like to see done would be an MMO that's populated by NPCs and players can immerse themselves in a world that lives and breathes even without their intervention. Like some have said, there would be heroes and villians in the world.

It would be pretty grand, with different cities and races and governing bodies. So the goals of NPCs wouldn't just be living and killing. They would have political agendas and kings could declare war on other nations or improve the social lives of their subjects by building up their cities. Perhaps the player might even play the king and take on these responsibilities on their own.

We would make this game go without restrictions but the world will react accordingly to players' and NPCs actions. So if you're a PKer, you'll have to fight off the guards if they see you. If you're too powerful, then vigilante groups or other higher powers will intervene.

In fact, perhaps someone who is cunning enough may try to plot the end of the world by turning nations upon each other with some treachery. So there wouldn't be a single goal for players to reach, but they can certainly form their own.

However this kind of seems to be rather unrealistic when looking at the games of today. Plus we might need very powerful servers in order to support the simulation of the game world and its NPCs. But how feasible would a game like this be in 5 or so years?

Share this post


Link to post
Share on other sites
Quote:
Original post by Washu
EXACTLY!!!!
How do you hear about this great evil dragon? How did the villager that told you hear about it? Presumably he was told by a traveller, what kind of a traveller? well, a trader most likely. How did the trader hear about it? Well maybe he was in the village when it happened.

I think this was discussed already multiple times here.
For each information you had not only remember the information itself, but who told you, and further more, you have to remember who told you who told them about it, and so forth...
After this, you had to set up a network of trust so you can ignore information from people you know they are lying (but on the other hand, they may only be lying to you but they tell the truth to others...)
It CAN be done, but I doubt you will have much resources left to do the actual game itself. Maybe you place all this knowledge handling on a dedicated pc...

On the other hand, if you only want the game to envolve and have the spreading about the information, this would be pretty manageable.

Share this post


Link to post
Share on other sites
Like I was attempting to say before my computer crashed: I really am not looking at getting this idea at all put into a game with current technology the way it is (it is quite literally unfeasible to get it working realtime, at least for large numbers of autonomous NPCs). Instead I am thinking of just developing a proof of concept for a smaller cluster of NPC's and then see if it is at all possible to expand that to a cluster (or few) of those NPC clusters.

Although, if there were a working p2p game network that was running the services accross multiple machines it may indeed be possible with as much as 20 NPC's per PC. In theory it should be possible (given enough users), but of course then comes technical implications like hacking and cross-checks ...

Anyway back on topic. Even with a large list of possible goals or needs really each character only requires a few of them to become interesting. A maximum of 10 would give them enough diversity to be individual (especially with different weightings) and then anything that was going to be too intensive to add can be fudged if need be.

Share this post


Link to post
Share on other sites
Quote:
Original post by dwarfsoft
Anyway back on topic. Even with a large list of possible goals or needs really each character only requires a few of them to become interesting. A maximum of 10 would give them enough diversity to be individual (especially with different weightings) and then anything that was going to be too intensive to add can be fudged if need be.

That's the idea I am trying to bring to life in our project. There is a customizeable set of needs, and each need will modify the behavior of the agents.
Some will be lazy and try not to move at all, while other are curious enough to run around the world, exploring the last point on the map. Some are whimpy and walk only beside the city guard, while other are sneaky and even avoid to be close to any guard.
And actually it is working out nice (for a few agents), I am heading to do some bigger population with more different behaviors in the coming month.

Biggest pro for need driven behavior is you (or the designer) don't have to script your NPCs but rather describe their behavior (wow, what a surprise).
But this is the biggest contra too: you can't have them move from place A to B and back again. The NPC may suddenly leave the path and head somewhere else.

Asking me as a designer I would prefer not having to script each seperate NPC on it's own, and as a gamer I prefer some more unpredictable behavior.

Also I don't like to kill a NPC and see it sespawn a minute later. With respawning you can simply run a single script on every instance of a guard.
I prefer the "perma death" of NPCs. They may respawn (or been reborn), but at another location and have to be asigned by some instance to their job. With this aproach you can't rely on scripting, as you never know how many instances of guards are around, so a reasonable solution is to work with the flexible need driven behavior.

Hope this makes any sense at all, heading home from work now ;)

Share this post


Link to post
Share on other sites
Well, really there is no need to wory about "forcing" an NPC to do what you tell it. All you need to do is give that particular goal or need a high priority. It will happen sooner rather than later, but at least it will still seem like the NPC has a mind of its own in the meantime.

What I would like to see is some not so common goals to be altered by events that happen to the NPC. So they decide they want to go and see the city of the juggernauts for example. Once they get there they find out that there is a great tale in the making and that many heros are fighting to invade Kingdom X because of the long hatred between your people.

Now depending on whether the personality of the NPC decides that these Kingdom X folk aren't to be trusted then suddenly the NPC gets the bright idea to fight them (or at least enlist). If it knew someone from Kingdom X and disagreed with this philosophy then there might be more diplomatic choices... But wouldn't it be fun to see the difference in the world that this could create.

Share this post


Link to post
Share on other sites
Quote:
Original post by dwarfsoft
Like I was attempting to say before my computer crashed: I really am not looking at getting this idea at all put into a game with current technology the way it is (it is quite literally unfeasible to get it working realtime, at least for large numbers of autonomous NPCs). Instead I am thinking of just developing a proof of concept for a smaller cluster of NPC's and then see if it is at all possible to expand that to a cluster (or few) of those NPC clusters.

As far as I can tell, I'm working on exactly the same concept you're talking about. One difference, however, is that I am taking a top-down approach in implementing ambitions. I'm giving priority to noteworthy, big-story types of ambitions (whether it be the nature of the ambition, or because the agent is powerful/resourceful), and spreading them wide across the game world. I've never been one to be impressed by having NPCs making trips to the fridge or whatever. I haven't decided yet if I'm going to make the more mundane things dynamic or scripted, but I have decided that only characters within relevant range of the player will get processing time for such things. I suppose it's possible the mundane could have a butterfly effect and possibly seed a heroic story, so in that sense I would be limiting story generation, but if I make it that far, a handful of templated scripts could compensate for that to a degree.

Share this post


Link to post
Share on other sites
Quote:
Original post by dwarfsoft
Well, really there is no need to wory about "forcing" an NPC to do what you tell it. All you need to do is give that particular goal or need a high priority. It will happen sooner rather than later, but at least it will still seem like the NPC has a mind of its own in the meantime.

Glad you see it the same way like me. Personally I HATE NPCs doing their scripted business and never care about changed environment.
And as a plus I like to play my own game and being surprised about the action of the NPCs. Giving them just a goal and some behavior parameters and finally watch this turn out into actions I didn't think about is almost a game itself to me.

Quote:
Original post by dwarfsoft
What I would like to see is some not so common goals to be altered by events that happen to the NPC. So they decide they want to go and see the city of the juggernauts for example. Once they get there they find out that there is a great tale in the making and that many heros are fighting to invade Kingdom X because of the long hatred between your people.

Now depending on whether the personality of the NPC decides that these Kingdom X folk aren't to be trusted then suddenly the NPC gets the bright idea to fight them (or at least enlist). If it knew someone from Kingdom X and disagreed with this philosophy then there might be more diplomatic choices... But wouldn't it be fun to see the difference in the world that this could create.

Probably the control of a single agent is the same like playing a complete army in an RTS.
In a RTS you as the comander have global GOALS (usually survive and destroy the enemy). You pick some STRATEGIES for your army that are fit to help you getting closer to your GOAL, and on the lower level you have to pick some TACTICS that help you to perform your STRATEGY.

Now how can this mapped to NPC behavior?
As there are multiple layers of comand in military, there are multiple layers of decision finding with agents:
An agent has GOALS (survive, become rich, kill the murders of his parents).
To survive, the STRATEGY is to stay away from danger, and drink/eat regulary.
To drink regulary the agents TACTIC may be to stay close to a river.
The goal of "become rich" will make the agent move to locations with much business, or to areas with resources that can be sold for a good price elsewhere.

(The "kill murder of parents" goal for agents is really a big task and I probably have reached goal "become rich" when I can code this behavior in a few lines of code with taking less than 1% of CPU time. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by OmniBrain
Glad you see it the same way like me. Personally I HATE NPCs doing their scripted business and never care about changed environment.

Agreed. I mean, if your shop is on fire, you don't just keep on trying to sell your wares.
Quote:

And as a plus I like to play my own game and being surprised about the action of the NPCs. Giving them just a goal and some behavior parameters and finally watch this turn out into actions I didn't think about is almost a game itself to me.

Heh, that's the nice thing about a suitably developed goal oriented AI, it's behavior should change from run to run, but should stay relatively consistant globaly.
Quote:

Probably the control of a single agent is the same like playing a complete army in an RTS.
In a RTS you as the comander have global GOALS (usually survive and destroy the enemy). You pick some STRATEGIES for your army that are fit to help you getting closer to your GOAL, and on the lower level you have to pick some TACTICS that help you to perform your STRATEGY.

Hrm, about the only RTS, or RTT games that actually allowed for that are the total war games. The rest mostly rely on building up a massive army and then just using overwhelming force (very boring)
Quote:

Now how can this mapped to NPC behavior?
As there are multiple layers of comand in military, there are multiple layers of decision finding with agents:
An agent has GOALS (survive, become rich, kill the murders of his parents).

So, we have agents that represent a general character or set of characters? Now, when i say set of characters, think of a kingdom that is being invaded... Each person in the kingdom will have goals. However the kingdom as a whole has some overwhelming goals.
Quote:

To survive, the STRATEGY is to stay away from danger, and drink/eat regulary.
To drink regulary the agents TACTIC may be to stay close to a river.
The goal of "become rich" will make the agent move to locations with much business, or to areas with resources that can be sold for a good price elsewhere.

hrm...i think we need a better set of terminology than strategy and tactics.
Quote:

(The "kill murder of parents" goal for agents is really a big task and I probably have reached goal "become rich" when I can code this behavior in a few lines of code with taking less than 1% of CPU time. :)

Remember, he did say that he was targetting platforms of the future, so we can imagine that CPU power is not an issue.

Share this post


Link to post
Share on other sites
Well I think the problem might be simpler if put in 'layers'

layer 1 : basic human instincts, like survival (dont stand in a burning building, or fight or flight reactions

layer 2 : basic needs based on percents of importance food, drink, sleep

layer 3 : small goals like open shop, or take flowers to girlfriend

layer 4: grand goals like rule city, become king, take over world

something like that with layer 1 being most important and the latter layers being less, of course this would be based on a npc's 'character' greedy, frinedly, power hungry and so on.

also if the different attributes of an npc, such as personality are modeld off of real people who can be categorized into groups that could simplify things,
like you have the politician type, poet love child type, angry violent type, crazy programmer type. These would all have similar goals and needs.

I remember back when I played Ultima 7, and I got into the debugger, and it listed what the npc's were supposed to do at any certain time in the day. This is of course a perdictable and unchangeable thing, but it made them seem so much more lifelike than most npc's i see in modern games. Even modern rpg's the npcs just seem to stand around. Looks like more games could at least use a list or somthing to make things a little more realistic.

Share this post


Link to post
Share on other sites
Quote:
Original post by SelethD
layer 1 : basic human instincts, like survival (dont stand in a burning building, or fight or flight reactions

layer 2 : basic needs based on percents of importance food, drink, sleep

Ok, these two should really tie into each other, the goals at layer 2 should be dictated by the needs of layer 1.
Quote:

layer 3 : small goals like open shop, or take flowers to girlfriend

layer 4: grand goals like rule city, become king, take over world

In this case however, i would think that layer 4 would dictate layer 3s goals. Because the over arching goals should be powered by the smaller goals. So each smaller goal should be a step on the road torwards achieving a grand goal.
Quote:

something like that with layer 1 being most important and the latter layers being less, of course this would be based on a npc's 'character' greedy, frinedly, power hungry and so on.

Only problem I have with this is that layer 1 being the most important would perclude heros. As survival would end up preventing the hero from stepping into situations where he will most likely die.
Quote:

also if the different attributes of an npc, such as personality are modeld off of real people who can be categorized into groups that could simplify things,
like you have the politician type, poet love child type, angry violent type, crazy programmer type. These would all have similar goals and needs.

ugh, real people are so shallow...who would want to mold game characters after them. However, the grouping idea would give some idea as to what initial weights each of the goals should be given, and then with minor randomization, it would be adjusted to make the characters unique.
Quote:

I remember back when I played Ultima 7, and I got into the debugger, and it listed what the npc's were supposed to do at any certain time in the day. This is of course a perdictable and unchangeable thing, but it made them seem so much more lifelike than most npc's i see in modern games. Even modern rpg's the npcs just seem to stand around. Looks like more games could at least use a list or somthing to make things a little more realistic.

Yeah, even in mmogs. Of course, the real problem is managing all of that information. Even for a relatively small number of NPCs, building a system like what we are discussing, and keeping it stable is not easy. That is perhaps the hardest part, keeping it stable, as most cases will degenerate fairly rapidly, or oscillate between two or more degenerate states.

Share this post


Link to post
Share on other sites
since we are wasting imaginary processing power anyway...

each NPC could also have a set of beliefs/morals, which could help dictate how they try to accomplish their goals. for example, say two NPCs are starving and poor; one might go beg or find any crappy job (cleaning stables? not too bad if you need the cash) to earn some money, whereas another might turn to a life of crime. this would help give more diversity to the behaviors, i think.

i could ramble on, but i'd rather just toss that in and watch some more. :)

EDIT: the thing that made me say this (and which i forgot to include at first) was Washu's comment about there being no heros. there still could be, for those NPCs whose beliefs included helping the innocent, saving the world, and always doing the right thing, even at the expense of their own personal safety and well-being.

mmmm... although, this could possibly be simulated just by adjusting the weights of those goals and such anyway...

Share this post


Link to post
Share on other sites
Quote:
Original post by krez
each NPC could also have a set of beliefs/morals, which could help dictate how they try to accomplish their goals. for example, say two NPCs are starving and poor; one might go beg or find any crappy job (cleaning stables? not too bad if you need the cash) to earn some money, whereas another might turn to a life of crime. this would help give more diversity to the behaviors, i think.

Hm, if I haven't mentioned it before I should jump on now.
You have goals on the different layers, and there are rules how to transpose the goals from layer to layer. These rules now define the way how an agent will solve any problem/goal.
Either you only activate some rules for a lawful character on how to get money, or you define the rules more complex to fire different unlawful ways to get hands on money if a "morale" attribute is low enough.

So from top to down a character would decide for a solution to reach a given goal, and this will set up new goals on the next layer.

Just as example:
goal:Survive (rule:eat regulary) -> goal:get food (rule:go to public food storages) -> goal:head to apple trees ==>> result: char moves to closest apple tree

a less lawful NPC could fire (rule: burglarize into food shop)


the trick now is to decide which goal on each layer you want to follow, or do it the fuzzy way and calculate the strongest goal on the lowest layer to perform it (a goal on the lowest layer should result in an easy, single action).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this