Game Development Community

high pop AI

by William Finlayson · in Technical Issues · 04/29/2001 (7:29 pm) · 23 replies

Bit of a cryptic title, but a start.

In a game going to be based on my parseg idea, I want to have LOADS! of NPC's running around. In most games with a lot of NPC's, only a few are ever of any interest, others are just scenery. I want to be able to fill villages with NPC's and to be able to interact with them all.

The first major thing I was thinking of doing was not to get rid of the distinction between 'important characters' and 'background characters', but instead, allow dynamic promotion/demotion. The game is content is produced on the fly depending on the palyer's actions, so you don't know what NPC's are going to be used and when. So if a player leaves an area for a long time. Important NPC's should be demoted to save on CPU usage.

The important NPC's should have personal knowledge and social bonds and their own personality. So that they can convey their knowledge of the game-world as they see it. Obviously if you have a lot of NPC's and they all have individual personalities and knowledge, it's going to take it's toll on your system. BUT I want all NPC's to act realistically in view of the player.

The system I have devised for this, is a 'social group structure'. All the 'backdrop' NPC's will belong to one or more of these social groupings. Knowledge is an important feature in the game, but background NPC's can't have individual knowledge. Instead, the knowledge that a social group has is stored. Diferent groups would be families, all the workers at a certain place could be a group, a guild of fighters could be a group etc. The groups have simple rules of what knowledge is of interest for that group, and how well it is shared amongst that group. So a band of fighters will be interested in battles accross the land, but not that interested in the new houses built in town X. In tightly knit groups, information will flow freely between all in the group, but members of looser groups may not know the full knowledge set of the group.

An NPC can be in as many groups as possible. By only tracking knowledge for a group, and only some knowledge at that, it greatly reduces processing time to work out who knows what. Only when an NPC is interacted with, does the knowledge from groups come into play. This way the player can interact with background NPC's, and they will have a fairly realistic base of knowledge for who thay are/what they do. Active NPC's will also have social groups, but they will also be abl;e to gather knowledge of their own accord.

If a backdrop NPC is interacted with several times, the world-govenor AI may decide that it wants to use that NPC in an event as the player is obviously interested in them (events are what the story of the game is built on). Incase of that happening, the NPC would be promoted to an active NPC. When doing this, you want the NPC to gain more personality, but you want to do it so that it coincides with theit life as part of the background. As a start, group knowlege would be given to them, but then a personality needs to be created.

In creating personalities, I propose personality templates, and modifiers.

Templates, would be a standard personality set, based upon whatever job that NPC has. But not all farmers are going to be alike. Modifiers will be imposed upon personality values also be each social group they were part of, and the place thay lived, as well as a certain ammount of randomness. This will hopefully produce an NPC with a unique character of their own, while still being realistically based on their circumstances.

Next, how to make NPC's WANT to abide by a society. I was thinking of using a wants/needs system, where the NPC will get urges food/sleep etc, and then try and fufill them. Obviously some of them would be affected by personality, like aquire wealth - get a job or steal? Maybe that would be dictated by lawfulness. Anyway, I have found it hard thinking of a way to implement rules imposed by society into this. ie - don't steal, don't murder, and que in an orderly fashion. These could be hardcoded, but then I though that maybe a 'society' structure could be used, setting regulations and rules upon that character's actions. By having that in a society object, nothing is hard-coded, and diferent NPC's can live in diferent societies. The society models would try to impose those rules and regulations, but depending on the character's personality, they may wish to break a rule. If they are very unlawful, they are not likely to follow rules, and if a lawful character has been starving, then their hunger may override their want to abide by society, and they might steal food. An improvement on that would be adding a 'local society' structure which would modify the weighting of 'society' rules. So in a town where there are constant raids, there could be a modifier to the societies rules in that town - for example, it may be more acceptable to walk around armed. Another things that would modify the character's behavior is a 'job' structure. This would allow for more artificial actions like bake bread. Ordinarily, it would be hard using a want/need system to get a character to make more food then they need, but if it is a requirement of their job then it is not a problem.

Obviously this is just a high level view of the NPC AI in parseg, there is a lot more AI in the game, but I thoughtI'd limit this thread to the NPC AI.

So, what does everybody think? Feel free to comment, but realize that this is just an overview, and is not a full implementation. It is still very much at the design stage. If anyone else has any ideas pertaining to this then please let me know.
Page«First 1 2 Next»
#21
07/12/2001 (3:54 pm)
I was giving some thought to the one guy knows everything problem, and I think it is a case of weighting the information... Taking the example given further up:

farmer Joe
Groups: Farmer, Family
Primary Group: Farmer

farmers wife Jane
Groups: Family, Local Church
Primary Group: Family

Priest Joseph
Groups: Local Church, preisthood(national)
Primary Group: Local Church

Pope John
Groups: Preisthood
Primary: Preisthood

Instead of say having groups and primary groups weighting these groups with say a percentage or out of 10. For example.

Farmer Joe
Farmer - 8
Family - 3 (He isn't a good husband or father!)

farmers wife Jane
Family - 8 (His wife however is a good mother and wife!)
Local Church - 4 (Attends and believes but doesn't get involved!)

(The other's aren't needed in this example)

Now what I was thinking was information again could have an amount of importance. For example Farmer Joe hears that Farmer Bob has been struck by blight and lost his crop this year. Now this comes with a weighting of say 8 in importance, because Farmer Bob is next door, so he knows the information. Not being a good family man however he fails to pass this information to his wife. So it doesn't spiral down the chain and end up at Pope John. So the weighting of the various groups controls how the information is passed, for example Farmer Joe is far more likely to know many minute details about his farm and his surroundings, but his low family rating means that whilst his wife tried to pass information onto him via the family group link he is only receptive to the most important of information, small incidental bits of information aren't passed to him, therefore instead of Jane and Joe knowing the same information with minor differences, over the course of the game Jane and Joe have an area of common knowledge, but because of the weightings in how information is passed they know alot that each other don't.

Make sense? Stupid? Any opinions?

Owen
#22
07/12/2001 (4:09 pm)
Say at the beginning of the game the situation is that there are a predetermined number of groups with a random/fixed number of generic npcs created and assigned to those groups, with some characteristics, i.e baker, builder, e.t.c so that their location makes sense, however very minimal information, to atleast help keep things small to start with. Now you grab an NPC at random to talk to, first-encounter. The system checks his affiliated groups and assigns values to those alligiences for information passing. It then checks whether any groups have had contact with the player before and the if any special circumstances exist between the player and that group (essentially what his reputation is), a high reputation, or very low, combined with the information weighting system and a certain level of randomness will decide the NPCs initial reaction to the player. It may be that you've grabbed a builder, who is not closely affiliated to his builder group, which is lucky because you were caught roughing up some builders in the next town and that builder group want you beaten up on sight, however this builder doesn't know so his initial rep and response is neutral. A builder with close links to the builder group may recognise you and attack. Once you have completed your chat with this builder the system tracks what you requested. If you simply asked directions the information about that builder is "destroyed" and he goes on his faceless NPC way. However if you actually take interest in him, ask how work his, enquire generally about him, or insult him viciously, the NPC is promoted to individual status which, as was suggested above, could be a "group" of one with a time setting. A simple enquiry about how is work would say create a time setting for this group of 10 game weeks, during this time you could track him down and talk to this particular NPC again, doing this increases/resets the time setting for that NPC, failure to talk to him allows the system to destroy the NPC, afterall if you disappear for a game year say and return that builder could have moved town, died, there are a 101 reasons why he may not be there so the player may not miss his absence. Obviously there comes a point where the interaction with an NPC is classed as significant and that NPC becomes a permenant NPC group, like say the Local Church, e.t.c and starts to function like anyother complete group and can be looked up at any later time.

This possible system would serve 2 purposes that is save on time, as the more groups you have the more affiliations you have the more information has to be passed between them hence increased processing time, plus if each NPC creates a new permenant group whenever talked to or interacted with the size of the save, or group database would increase hugely. A system of destruction must exist, as most of the time the player is simply interested in directions and an idle chat or some form of generic information which can be obtained easily from anyone, and this particular NPC is the "lucky" one picked and his/her/it's later destruction goes unnoticed.

Owen
#23
07/30/2001 (11:02 pm)
another way would be to not only give the information weight but give it scope.

World
Country
State
County
Town
Group
Individual

Invasion of the Southern Wastes: World Scope
Blighted Crop: Town Scope
I have athletes foot: Individual Scope
Page«First 1 2 Next»