Advertisement

NPC Behavior

Started by November 17, 2004 10:53 AM
11 comments, last by GameDev.net 20 years, 2 months ago
I have lately been thinking alot about game design, that of non-player characters in particular. Namely, the issue of creating a model that provides for realistic, dynamic behavior. I'm going to jump right into the current system I have been invisioning .... For personality, I think the best course of action would be something like a Myers-Briggs Type Indicator . Rather then locking it into explicit categories, I feel the proper course of action would be to lock each variable into a range, therefore we could represent an individual who is slightly introverted, rather than extremely introverted. However, MBTI alone is not enough to represent the personality. Two (and there are likely others) that I feel will influence the behavior of the NPC are Bartle type (I realize that this system refers to people who play MUDs ... but NPCs are intended to be seamless and I believe their actions are highly influenced by this system) and alignment (not in the sense of karma, but rather the players natural inclination towards good or evil). Now I understand that there is some overlap here, and probably missing elements, but until I read up some more, I will leave it as is. Beyond the personality, we have mood. A player's personality is somewhat abstract; although it influences his behavior, it takes into account no external stimuli (I am not ballsy enough to try and design dynamic personality, although I am sure it can be done). The mood, however, is the personality's response to the environment. An INTJ evil killer's mood would almost undoubtedly respond different to the murder of his mother than that of an ESFP good socialiser. Exactly how the mood responds I have yet to work out. In fact, I haven't even discovered how to represent the mood. There are many elements, and their relationships are quite unusual. A player who is happy is by definition not sad. A happy player is also not angry. However, an angry player can be neutral (neither sad nor happy, just angry) or angry and sad. Not to mention I am not confident in my current classification of mood types either ... I feel I have grossly under-represented the mood. The player also has certain attributes which define his capabilities in the world. This is your bread-and-butter off most RPGs ... the STR/AGI/CON/DEX/INT/WIS/CHA combo. There is a question of whether some of the personality based attributes (Charisma and to a certain extent, Wisdom) have a place, given the MBTI. To that, I have no answer as of yet, so I have chosen to include them for completeness. Although these attributes have a great influence on gameplay dynamics (damage done, chance to block, spell success, whatever), they seem to offer little value to behavior. As well, these are static in nature. Although they can be developed as the player develops, attributes such as these are not really derivatives of others (whereas mood is derived from personality), nor are there any external inputs. So now, we come to behavior. Some behavior (pathfinding mechanics) is rather trivial, and is not influenced by the developed model. However, higher level behavior would be strongly influenced by this model. In fact (ideally), every player action would be the result of applying the environment to the personality/mood combination. In essence, personality + environment -> mood mood + environment -> behavior The scope of the behavior is based upon the character's physical attributes. If a character with low strength is enraged to the point of attacking another character, he may throw a rock at the enemy. An exceptionally strong character may throw the enemy at a rock. Either way, the combination of his mood (infuriated) and the presence of a character who he feels hostile to (environment) leads to him physically attacking the player. Moreover, a merchant who travels from one town to another, trading goods for a profit, has a naturally ambitious personality. If he discovers he can sell items for more profit at a town other than his destination, he will be likely to travel there (assuming he is adventurous enough, and with a capable constitution to survive the journey). In this case, behavior is based little on mood, but this is a situation in which the NPC is not giving an emotional response, therefore personality plays a stronger role. I hope I'm not just rambling now. This post may be a little rough; excuse me, I have class in 5 minutes and as such am forced to cut it short. However, I would appreciate responses to what I wrote, and corrections are even more appreciated. Thanks.
I think that designing a game is much more like drawing a cartoon and much less like building a machine.

It is true that any computer game is, in essence, built like a machine (by coding). This is especially true for dynamic behavior as you describe. I think however, that the experience of a player is more like a cartoon: You don't have to create a whole underlying world, rather, just enough to create the illusion of a whole world. A cartoonist's success relies on creating illusions with just a few lines.

What is the point of creating such a realistic dynamic behavior apart from the challenge to do so?
Advertisement
I hate to say it, but I agree. I used to spend a lot of time trying to plan the most realistic AI that I could afford to build - complete waste of time.

There is nothing wrong with defining behaviors, or strong AI. Just don't go overboard with it. Complex AI is hard to tune, harder to fix, and a nightmare to scale. (To me, at least). The key is to concentrate upon the *illusion*, and not the simulation, unless your interest is purely academic, and not actual production - in which case, rock on!

"This I Command" - Serpentor, Ruler of C.O.B.R.A
Quote:
Original post by zarthrag
unless your interest is purely academic, and not actual production - in which case, rock on!


Will do ;)
I wonder whether you really need to do all that work detailing the personality outside of emotions. Maybe have emotional tendencies, and needs or something.

Events could have an emotion rating, modified by the NPC's emotional tendencies. Slapping a guy's girlfriend could have a +5 Anger rating, which to a low Anger person could translate to +2, and to a high Anger person +10. They could also have different modes of expressing their emotion. One high-Anger guy might challenge you to a fistfight or duel, while another high-Anger guy would smile sweetly & run off to hire an assassin. (Not sure whether that'd hafta be hard-coded, or if some other aspects of personality could decide what they'd do. You have to make them consistent though...a guy who thinks with his fists usually doesn't wake up one day & decide to get revenge in a less traceable way.) Actions such as beating you up would satisfy them and thus lower their Anger back towards whatever normal is for them.

Needs could get as specific as you wanted them. Your ambitious merchant could have a high Money need, and when he's not satisfied with his income, he could try to do various things to get richer. (How to explain the difference between people who are satisfied once they get a raise, and people who keep having to get richer and richer to be happy? You could either put something in the personality itself, or have an Ambition need separate from Money or Fame or whatever, that eventually makes a previously good enough level of wealth not good enough anymore. It'd probably have to be something in the personality part, since this could apply to other needs too.) Even a guy with a low Comfort need could eventually be unsatisfied living in a roach-infested dump with moldy pizza all over the floor. Especially if he gets a new girlfriend.

In fact, you might even be able to get away with having it entirely need-based. The "personalities" could be sort of like the ones on the Sims, as opposed to the running needs-meters that change during the game. It all depends on how complex you want it, and how it'll affect actual gameplay.
If a squirrel is chasing you, drop your nuts and run.
The goal of the NPC's should be not to detract from the game. The total amount of effort put into them should be no greater than other elements of the game. If you are spending years making the ultimate hi-tech game, then more time is spent on NPC behavior and modeling. Though I still doubt they do as much as you are suggesting. 99% of the people out there forgive NPCs if they aren't super sophisticated as long as they don't detract from the game. The OVERALL gameplay should come first.
Advertisement
Right, IMO, NPC AI is a kind of technology waiting for a breakthrough. Normally, you only use mastered technology in making a game. Technological breakthrough is a separate process isn't normally included in game making, simply because you cant tell precisely the time frame and financial requirement for a technological breakthrough to occur.

It's like the car production process. You get your R&D funding to do a separate project to create an engine, well test it till you think you have mastered the technology of how that engine is made. Than you open another project to mass-produce the cars, then you earn money from car selling. Then you set aside some of your profit back to the R&D for a engine breakthrough, during that research period, you continue to use the old technology to produce the engines and cars, till someday an innovation is done by the R&D project. Then you may consider to produce your cars using the new engine type.

Alternatively, you just buy an existing mature engine technology to make your car, ie, let others do the R&D job.

[Edited by - Hawkins8 on November 18, 2004 3:36:05 AM]
So why not create a game as a R&D project? You could make simpler games for your bread & meat, and in your spare time fiddle with new ideas & see if you can get anywhere. Of course the problem with that is losing track of the "feel" of your innovations, but it'd probably be doable if you have time to do it.

Someday maybe we'll have games filled with NPC's that act like real human beings and deliver a different game experience every time you play. It might not be this year or next year, since non-game AI isn't very well done yet either, but sooner or later I can see it happening.

But it'll never happen if people never try to do it.
I think you should think about the idea form the other direction rather then first designing a system of NPC decision making. Instead design a system for environment representation, which will determine the inputs available to the AI. Once you have that you can start working out some behavioral modeling to determine actions.

Inputs -> Decision Model -> Output
Quote:
Original post by Anonymous Poster
So why not create a game as a R&D project? You could make simpler games for your bread & meat, and in your spare time fiddle with new ideas & see if you can get anywhere. Of course the problem with that is losing track of the "feel" of your innovations, but it'd probably be doable if you have time to do it.

Someday maybe we'll have games filled with NPC's that act like real human beings and deliver a different game experience every time you play. It might not be this year or next year, since non-game AI isn't very well done yet either, but sooner or later I can see it happening.

But it'll never happen if people never try to do it.




Exactly, couldn't say it better myself. R&D seems to be ignored in the industry with the giants focusing on making their cash cows with a catch-22 paradox (that works anyway), disregarding the fact that more and more players are looking for a breakthrough to occur to the MMOG industry with questions like "Why today's MMOs look all the same".

While academic efforts are put forward to the technologies needed for making the cash cows, such as the 3D theories, client/server network programming, server technology and so forth. I dont mean anything goes wrong with that, yet there could be some other areas may academic efforts be put forward to, including NPC AI, and actually all the theories hidden behind a MMOG, as it seems to me that game making is usually taken as a process of how ideas are coded into a game, rather than a process of how a human brain is stimulated (a hidden area usually being ignored).

This topic is closed to new replies.

Advertisement