PAI – Giving the characters some character

Data is Nice and all, but…

Last time I talked about the data formats that were forming part of the core of Interrogative, and how that opened up a lot of ground for me in terms of bringing new features to bear. This time, let’s talk about our NPCs’ personalities

Through all of the incarnations of AI that I’ve worked on, the general theme is that if an NPC represents a character, then there should be some way to codify that character. Some AI accomplishes this through variables for emotions, using the old Belief-Desire-Intention techniques, straight scripting, or more recently, Behavior Trees. These are all great- you should use what you need to use and not much more, but for the purposes of a role-playing game with deeper characters, I needed a Personality-based AI (PAI).

My first attempts at PAI were based on Fuzzy Cognitive Maps (FCM). Up to 25 character traits were used, which all had influence on at least one or two other traits when changed. Each change of a trait trigger a recalculation of all of the others, not unlike a neural network being fired from any individual neuron. Literary archetypes were tested in the system, and surprising results came up almost immediately. The one that sticks in my mind the most is the use of humiliation on the Muse archetype’s personality until  she “snapped” and the traits went from generally mild and “absorbing” of the attacks on her character straight to being vengeful and angry (don’t piss off your Muse, people).

The biggest issue with FCMs was that they were complex things that would compute in a loop if you let them, and then you had to track upper and lower bounds for the character traits to keep some personalities from going off into crazy-land. You also had to track “resting values” for the traits, because as an NPC changed, they couldn’t stay there forever (the Muse, above, would probably return to a resting state fairly quickly). It also had too much potential for the NPC to have to change their character traits often, and by large amounts, to deal with those both liked and hated. That’s not quite how people generally work- we don’t have such huge mood swings in such short spans of time just to deal with people we have different opinions of. Stability of the characters was lacking, even though the system did have some neat advantages such as allowing the NPCs to more easily mask their emotions (masking was a character trait in most of my later FCMs that had a superficial effect on the behavior of the NPC).

Moving from FCMs, I wanted a set of stats that could describe a baseline personality with less interdependencies between the values, and more stability. For Interrogative 1 and 2, I settled on a small set of personality attribute ranges that were as follows:

  • Altruism: Ranged from “Predatory” to “Sacrificing”.
  • Openness: Ranged from “Hermit” to “Exhibitionist”.
  • Discipline: Ranged from “Uncontrolled” to “Obsessive”.
  • Dominance: Ranged from “Inferior” to “Oppressive”.
  • Sensitivity: Ranged from “Unfeeling” to “Unstable”.
  • Trust: Ranged from “Discrediting” to “Reliant”.

Each attribute showed extremes of spectrums, with a “normal” range being described as “Neutral”. A character with neutral Altruism would be neither too selfish nor too giving. Some very simple math allowed me do testing in Excel. Still, the model had some issues.

The first issue was that the personality traits were still transforming on a per-situation basis. Not permanently, but the math I used required that the traits change to deal with reactions and then be factored into the emotions that the NPC felt, which then were used to select actions to execute. This was an additional problem, because the selection of actions based on emotions was simplistic. I also needed to calculate these traits in particular orders to account for “dominant traits” of a personality. The end result was a model that was a bit rocky, but very fast in terms of math.

Enter Science!

Wanting to create a better personality model led me to look into the personality models that were currently out there in the world of psychology. As the previous set of character traits were based partly on the Big Five personality trait theory (and then combined with traits that then changed it considerably), I decided to look past that into others, and found the work of Raymond Catell.

Without going into a psych lesson, Catell identified 16 personality traits that describe most personalities fairly well, and here are my takes on the traits (you’ll note that the extremes of these traits are pushed out somewhat further than Catell had stated, and some adjectives associated with these traits are different than what you would find on the web, because I needed the traits to cover more ground):

  • Warmth: Ranges from “unfeeling” to “nosy”. Represents the tendency to care for others. There is such a thing as caring too much, just as there are those who don\’t care for others at all.
  • Stability: Ranges from “unstable” to “tranquil”. This traits represents how emotionally stable the character is. Lower extremes should be used with care, as unstable personalities are unpredictable.
  • Dominance: Ranges from “feeble” to “oppressive”. At low extremes, the character is incapable of asserting themselves, whereas at high extremes, they have a difficult time trying not to dominate others.
  • Tension: Ranges from “apathetic” to “tormented”. Generally dealing with frustration levels in the character’s base personality.
  • Liveliness: Ranges from “inactive” to “vigorous”. Pretty much as advertised. Characters at the low extreme are pretty inert as objects (think of the guy who sits in front of the TV all day) compared to the non-stop ball of energy that is the high extreme.
  • Social Boldness: Ranges from “agoraphobic” to “exhibitionist”.  Represents the social-skin-thickness of the character. Low extremes are characters who probably have a hard time leaving the house, where high extremes are characters who let it all hang out (which can result in citations in some jurisdictions).
  • Conformist: Ranges from “corrupt” to “moralistic”. Conformity to the values of the character’s ascribed culture and morals is the important distinction here. Moral high-horses are available in every stable, and those considered “morally corrupt” are found in every culture and belief system as well, and sometimes it’s hard to agree between belief systems what is corrupt. However, the extremes consist of those who are generally agreed upon to be bad in any belief system or culture (murderers and those who cling too close to literals).
  • Adaptability: Ranges from “fundamentalist” to “experimental”. Not Conformity, but a close cousin that has to do with the character’s ability to tolerate or adapt to differences. The low extreme is the fundamentalist who clings to their belief system fervently, whereas the high extreme are those who push boundaries in thinking on subjects.
  • Vigilance: Ranges from “unconditional” to “oppositional”. A measure of trust- low extremes are blindly gullible, where high extremes wouldn’t believe the truth if it smacked them in the face (“this cake- while delicious- is a lie!”).
  • Openness: Ranges from “non-disclosing” to “involved”. Very useful for characters who will be tasked with guarding information. At the low end, getting information is like pulling teeth (literally), whereas at the high-end, the character will be a lesson in TMI at every turn.
  • Anxiety: Ranges from “fearless” to “desperate”. Anxiety here is generalized about life in general, and is the baseline for all other anxiety or courage. The low extreme exhibits unnatural nerves of steel as found in dare-devils. The high end feels doomed at every turn.
  • Individualism: Ranges from “zealot” to “heretical”. Represents how closely a character identifies with being part of a group rather than being an individual. (Next step up from “zealot”? “Sycophant”).
  • Perfectionist: Ranges from “uncontrolled” to “obsessive”. The low extreme may just be wallowing in their own filth, where the high extreme needs to turn lights on and off multiple times to ensure that they are turned off.
  • Sensitivity: Ranges from “cruel” to “refined”. The high end is extremely sensitive and attentive to beauty in the world, as opposed to the unfeeling utilitarianism of the cruel character at the low extremes.
  • Reasoning: Ranges from “less intelligent” to “more intelligent”. Filed under “duh”, these adjectives need to be rethought. Basically, represents the range of intelligence in a character, or the “depth” of thought (if thinking in chess terms).
  • Abstraction: Ranges from “more direct” to “less direct”. Related to Reasoning, and also in need of better adjectives, this represents how “imaginative” the thoughts of the character are. “Less direct” translates to more creative means with dealing with problems (using intrigue and politics, for example, instead of a frontal assault, to take over a kingdom). At the low end, you’ve got those who like straightforward plans, and at the high end are those whose plans are roundabout. High levels of Abstraction work best with intermediate to high levels of Reasoning (imaginative plans that are not deep are often impractical- which is also a feature of high levels of Abstraction).

That’s a lot of traits, but the important thing is not the amount of traits, but being able to describe a character, which is why the extremes of these traits do not match Catell’s work. But since Interrogative is aiming for approximation and not simulation, liberties get taken to keep things as simple as possible for this system. If you want to see a personality described with this system, take a look at the following screenshot of Interrogative 3’s tool with an NPC Template “Most Interesting Man In The World” loaded. The current trait levels are highlighted in the red box:

Pictured above: The Most Interesting AI In The World…

As you read those traits, you can get a clear picture of just what kind of character we’re aiming to create. The personality traits only serve to quantify that. Also, Interrogative 3 has about 42 personality templates to choose from, including the literary archetypes (templates can also be blended together, and have certain sets of traits increased or decreased in order to bring out or subdue certain traits). And yes, “Most Interesting Man In The World” is among the templates.


The traits range from -1 to +1, with 0 being “neutral” and 10 gradations between that and each extreme, giving 21 adjectives for each trait. Trait levels can then be combined to determine a number of interesting things such as the general self-esteem of a character, how likely the character is to seek vengeance, forgive, respond to stimuli that makes it sad, scared, angry, etc. And those functions form the core of a Personality-based Artificial Intelligence (PAI) that has its bedrock on personality traits and emotions. The tool also comes with some handy comparison functions that allows you to see the character through the eyes of some of the more popular RPG alignment systems out there, alongside many other personality measurements…

Above: Estimates and metrics help you gauge the qualities of your character.

All of that said, as of this writing there may be a 17th trait added, due to the incomplete nature of most trait-theories compared to fully describing humans’ personalities, and if I cannot describe the new trait using the existing ones in a simple manner. If I do, I’ll likely have a blog post about it, as PAI is set to have many more blog entries to come. Either way, you can see that the current set of character traits, being loosely based on actual research, have a bit more “resolution” and “range” in describing personalities, especially those that can be described as extreme. And unlike the previous versions of Interrogative, these traits are not designed to change in the normal course of interactions, but serve as a baseline of qualities. However, they can be modified in certain situations such as the charming salesman who is a jerk to his family- that, however, is the subject for a later blog.

Next: Trait Modifiers, or the case of Jekyll and Hyde…

Leave a Reply