NPC Personality Traits

I’m working on a personality-driven relationship system for NPCs. An NPC is defined by a set of values. A number in the range -1 to +1 specifies how the NPC feels about the value, where -1=disagrees, +1=agrees.

Are the 5 values below comprehensive enough to represent a broad range of NPCs in a way that’s useful in a game? Are any redundant or unnecessary?

  • Charity: -1=greedy, +1=altruistic
  • Integrity: -1=treacherous, +1=loyal
  • Orthodoxy: -1=anarchist, +1=conformist
  • Violence: -1=pacifist, +1=warlike
  • Wit: -1=unintelligent, +1=insightful/shrewd

Examples:

  • Dim-witted but honorable warrior: Integrity +1, Violence +1, Wit -1
  • Greedy, sneaky, cowardly wizard: Charity: -1, Integrity: -1, Violence -1, Wit +1

To provide some fuel for discussion, the original prototype used these values:

  • Initiative: -1=cautious/timid, +1=courageous/foolhardy
  • Belligerence: -1=peaceful/weak, +1=violent/strong
  • Intelligence: -1=foolish/uncomplicated, +1=clever/pedantic
  • Altruism: -1=cruel/self-reliant, +1=compassionate/gullible
  • Integrity: -1=backstabbing/unfettered, +1=loyal/dogmatic

A related procedural quest generation project defines NPCs using motivations instead of values. Those motivations are:

  • Pleasure (“kill the orcs and bring me the fine elven wine from their treasure room”)
  • Reputation (“kill the orcs to make me look good as mayor”)
  • Justice (“kill the orcs because they killed our mayor”)
  • Security (“kill the orcs to keep me safe”)
  • Conquest (“kill the orcs to clear the land for my realm’s expansion”)
  • Wealth (“kill the orcs to free up my trade route”)
  • Guidance (“kill the orcs to learn how to become a better warrior”)
5 Likes

Looks good to me. Really good… again, I think you’re pushing in the right direction. Everybody’s going to be doing this sort of thing in ten years, but props to you for being on the forefront.

Thanks! I’m really grateful for your and @Teila 's feedback on this. I think I can rework the procedural quest generator to use those 5 values also. It just involves tagging actions with those values instead of the motivations so the planner can choose actions that fit the NPC.

Sorry to be a bit abstract, but it seems like you could possibly have a longer list of traits and then define characters with an arbitrary number of traits from the list.

In other words, you could have a longer list (more than 5 traits) if you wished, but not require that all of the characteristics be established or defined. The ones that ARE established could provide motivation, and the ones that aren’t could be where the person behaves in an inconsistent or arbitrary fashion.

I can’t remember seeing a system like this in any game I’ve played, and I think this is the sort of procedural/randomly generated content that actually works well - you can still hand-craft the important stuff in the quests, but make the whole process leading up to the quest more organic by tying in the NPCs personalities into it.

I love it! Can people have a value of 0 as well or it’s always defined as either black or white?

I think it’s great, will those values be exposed to the player or will only show through dialogues and actions?

Yes! Thank you! That’s the whole idea. In the related thread, I mentioned one of the motivating events: in Mass Effect 1, if you accidentally drive over too many monkeys on a planet, a companion gets upset. But, since it’s scripted, you can flatten as many monkeys as you want on any other planet, and she won’t care. This is an attempt to fix that.

I can’t claim credit for originality, though. This has been an academic research topic for a few years, with playable prototypes written for environments like Neverwinter Nights. I’m just trying to bring it to Unity in a useful way.

People can have a value of 0. Someone who doesn’t have an opinion about violence would have a 0, while a pacifist would be -1 and a brawler would be +1. A value of +0.1 means you’re slightly in favor of violence.

I’m thinking of changing the scale from [-1,+1] to [-100,+100]. This might be more intuitive. Thoughts?

What you choose to expose to the player will be up to you as the game designer.

This is the dilemma, and one of the reasons why I’m seeking your opinions. It’s critical that NPCs’ traits have some overlap with actions’ traits. If not, the actions won’t have any relevance to the NPCs, and the NPCs won’t form any opinions about them.

As the list of traits gets longer, actions are less likely to overlap with NPCs’ traits in an interesting way.

Should the system leave this up to the game designer to worry about instead? I’m trying to keep it as simple as possible. I feel like the 5 traits above are fairly comprehensive, but I don’t want to hamstring designers by forcing an unchangeable list on them. If your game has no concept of violence, the violence trait is kind of irrelevant. Thoughts? Ideas?

Could we maybe click traits on and off? So have a longer list but we can turn them off if we don’t want to use them. I guess the question then would be…how many should be in the list and how cumbersome would that be? I get the dilemma. :slight_smile:

Ideally, the way to do it would be to allow the designer to put in their own traits and number values for those traits through an easy to use editor. That may be beyond the scope of the project though. :slight_smile:

Easy enough to do. I initially steered away from this only to keep the system as simple as possible. But it sounds like it’s worth a little extra setup effort for designers.

I could provide a few trait templates, with accompanying personality archetype templates, such as:

  • RPG traits: Combat, Exploration, Service, etc. Plus archetypes for bold fighter, cautious scholar, sneaky thief, etc.

  • Romance-oriented visual novel traits: Mystery, Generosity, Boldness, etc. Plus archetypes for narcissist, awkward introvert, etc.

Designers could start with a template or specify their traits from a blank slate.

By number values do you mean the scale? ([-1,+1] versus [-100,+100])

1 Like

I personally like -100, +100. In my mind, it gives me more variety. I realize a .01 is as different in that scale as 10 is in the 100 scale but it just makes more sense to me. :slight_smile:

I like the sliding percentages scale as it makes it more natural to adjust as a consequence of actions during play (if that is desired).

Would it be that difficult for us to adjust the numbers in code? I mean, couldn’t one make whatever they want appear in the panel as long as the math is created in the code to convert the numbers. :slight_smile:

Also, can we decided what is shown in the panel? I personally want my players to see the actions of the NPCs and how they respond to them rather than numbers so would prefer to hide those. I suspect that we can just do that in our own UI but just want to make sure.

I think it’ll be easier all around to stick with a consistent scale. The scale [-100,+100] seems to be popular, so that’s what I’ll go with. I agree with you and @hopeful that it’s more natural than [-1,+1].

Showing the numbers will be up to you and your UI. There are plenty of hooks to the data, such as OnGossip, OnWitnessDeed, OnAffinityChange, etc., as well as direct access to all the numbers through a single component named Faction. The panel in the testbed scene isn’t part of the system itself; it just pulls data from the Faction component to give a better idea of what’s going on in the scene.

There’s also a collection of add-on components to do things like play animations OnGossip, so in the most common instances you won’t have to do any scripting.

One trait I could see adding, possibly, if I was to use a system like this in my game, is “willingness to negotiate.” Some NPCs would have a willingness to negotiate while others wouldn’t.

In stories, you often have two factions pitted against each other. Yet some individuals in both factions, despite their animosity, will be willing to deal with each other. You find the right two to negotiate with, and you might be able to bring about a truce or some other bargain.

It’s not like these individuals are less loyal (although they may, in fact, be less loyal) or different in any other trait, but rather they are just mentally open to the idea of striking a deal.

If you have a game story scenario that deals with a lot of villains, probably most of them will be willing to negotiate. However, some villains will be of a more fanatical type (or whatever) and they won’t be interested in any deals or in certain types of deals. I don’t know how detailed you could get on modeling behavior, but “willingness to negotiate” is something that could potentially carry a lot of weight in a game.

This is another great argument for letting designers specify their own list of traits specific to the game they’re designing. I’m leaning toward that now instead of hard-coding the list. It puts a little more responsibility on the designer, but I think it’s worth it.

Another consideration is overall discipline. Some people are inherently more consistent in their behavior because they have either had a lot of training or they lead an introspective or inspected life.

Others, however, just bounce around. They may have reasons at the time for why they do this or that, but there’s not a lot of consistency over days and years. You can’t easily predict what they will do next, except possibly for a few areas of clear behavior pattern.

So some individuals will adhere closely to their behavior model and others will be more loosey-goosey. One way to reflect this would be to have something like an AD&D-like order / chaos type modifier that affects the entire motivation calculation. Another way, maybe, would be to leave all inconsistent motivations undeclared, so that when calculation time comes in these areas the motivation is by whim.

In this way, the player encounters some NPCs who are reliably consistent and some who are unreliable and inconsistent.

Diplomacy maybe? One of my favorites. :slight_smile:

There was a great talk about this at GDC’s Game AI Summit a few years back by Stephane Bura. He suggested a 45 element model based on the Big 5 Factors of Psychology (Ocean Model), which sounds pretty complex, but also make a lot of sense.

You can find his slides here, you need to have Vault access to get the talk. http://www.gdcvault.com/play/1015385/Beyond-Eliza-Constructing-Socially-Engaging

The good stuff starts on slide 45.

One thing that Stephane said in the talk, that I think is very relevant, and actually totally blew my brain out of my skull and up to the ceiling of that room is,

If you rate the character motivations, and their potential actions using the same personality system, you can get a utility value of any behavior by taking the scalar product of the motivations

Interesting, Dan. I don’t have Vault but the slides looked good.

Our original goal was to have actions in the game affect the personality traits of the NPCs but we are wondering if that might be too much for a game that might have a lot of NPCs. I am still on the fence about it and Tony’s asset is really tempting. It would be so much easier than our original plan. :slight_smile:

Indeed, the reason I posted it was to hopefully inform what @TonyLi is working on. One of the salient point’s of Stephane’s talk was that storing the personality factors in a vector provides a number of useful advantages. Individual personality traits can be described as combinations of motivations, (like the love and shy in the slides 48 & 53) and then character personalities can be made by quickly composing multiple personality traits (love + shy).

Actions can also be described in the same format (like seduce on slide 49) and the single numerical utility for of those actions can be computer quickly and easily by taking the scalar product (like dot product of two vector3’s) which is mathematically very efficient and scalable. The idea was that it would be efficient enough to work for something on the scale of an MMO.

I don’t know how his experiments with it came out, he wasn’t at GDC the following year, and I only got a short amount of time to talk to him last year, as he’s quite busy (his company got acquired by Sony and is working on AI for Everquest Next)