Skip to content
Robert de Forest edited this page Jan 28, 2019 · 1 revision

NPC Programming With Values

NPC and disconnected player behavior is derived from the evaluation of dozens of competing decision systems. Values encapsulate actor preferences modulo the contexs they are evaluated in.

Some Examples

Using Maslow's hierarchy for reference:

  • physiological : stay warm/cool/dry
  • safety : avoid known dangers and unknowns in general
  • social : maintain friendships, follow rules
  • self image : keep a job
  • personal goals : save money for the future

Actor 1: "Gary" The Town Guard

When Gary wakes up:

  • His physical comfort requirements are already met
  • He wakes up in his own bed so his safety concerns are minimal
  • Since he has a job he wants to keep he knows he needs to get to his post by second morning bells
    • this creates a goal object
    • it has value based on Gary's Values and world knowledge
    • He wants to conform to social pressures, so he wants to dress himself appropriately before leaving.
      • this creates another goal object which becomes a dependency of the first
  • Gary would also already have longer-term goals such as
    • starting a romance
    • saving up for a plot of land
    • having children

The goals then compete based on there values and opportunity costs. In this case, getting dressed wins because I haven't supplied morning routine goals. Once he's dressed that goal is realized and goes away. The next goal I described is going to work, so he does that. If getting dressed had a risk of making him late for work, the judgement would be a comparison between how badly he wants to be dressed vs how badly he wants to be on time.

Actor 2: "Felix" The Feline

Felix inherits the default needs and wants all animals have and adds:

  • Dominating humans as demonstrated by their petting
  • Maintaining territory
  • Procreation
  • Curiosity
  • Novelty

When Felix isn't eating, drinking, eliminating or sleeping, he fills his time by weighing the above. Boredom motivates him to wander. Loneliness motivates him to seek affection from humans.

Interaction Between Actors

World knowledge includes the ability to cooperate to accomplish shared goals. Gary the guard and Corinne the constable might cooperate to bring a hooligan to the town jail.

Value Object Model

Values are built on top of the Euclidic/Relationship system. A value is an assertion about how actors weigh objectives. Each value's subject is a concrete actor like Gary or an abstract actor like People. The relation type of a value is something like "like", "seek", "need", "dislike", "avoid", or "abhore".

Clone this wiki locally