Update #61: Inside Build 11: NPC Brains and Relationships

Archmage Rises is about a dream.  A dream to have a "real" world which enables real role playing, more than just fetch quests and killing giant rats.  To make this work the NPCs have to think, remember, and respond realistically.  Relationships need to grow and evolve over time, based on decisions the player makes.  This needs to be right, now, so it can be built upon going forward.  It's almost there.

In this update we show how a variety of interactions can grow a relationship.  And new ones become available as you increase or decrease the stages of the relationship.  Repetition doesn't work in relationships, so I had to retool the NPC brain to be able to efficiently store and quickly retrieve everything that happens to them (with timestamps) so they can react correctly to someone spamming the same choices.

Something I forgot to mention in the video, but is pretty cool, is with these data driven Interactions we could allow for player generated interactions.  I don't know if we'll actually do it, but the ease of the system now make it theoretically possible.

Then we do something we never did before: about half way through the video we dive into the code and show some of the efficiency gains from the refactoring.  We hope this is of interest to developers out there.

If you are interested, here is the list of outstanding tasks for Build 11.  It is still at 27.

This week's progress:

  1. Created new class Brain, made it associative, can now be attached to anything.  For instance, we can have a talking fountain or treasure chest.
  2. Redesigned mood to make it based on wellbeing.  They used to be separate, now they are the same.
  3. Added interactions play can do to raise/lower an NPCs wellbeing
  4. Discount % at shops is now based on level of friendship, and goes up as friendship increases
  5. Added max memory types to tune the brain to remembering certain kind of data and ignoring others.
  6. NPC and Player wellbeing moods now affect social interaction effects.  So being miserable is -20% to all relationships scores.  This means telling a joke when Miserable is only 80% effective
  7. Converted "talk time" into hours instead of units, some interactions are free, some take an hour, some take several hours. 
  8. Insulting someone is a free action (they don't make time for you), but they also don't want to talk to you anymore.  Talk time regenerates over time.
  9. Put in a new basic interaction Ask About Day
  10. Made a universal tooltip for interactions.  It can read the data and display it correctly, with all the right colors, icons, indentation, etc.  Took forever to get everything covered.
  11. Added base stats (think D&D's base 6 attributes) to all NPCs so they can do opposed checks.  Like perception vs persuasion or stealth.  Will need this for guards later.
  12. Add Flatter interaction which is Persuasion vs Perception with a bonus to relationship (the more they like you the more likely to accept your flattery)
  13. Added gift giving.  This was a big feature, the ability to give someone money or ANY item(s).  NPC accepts or denies based on value of the gift and the level of relationship and remembers previous gifts and compares them.
  14. Created new item transfer window that can take up to 32 items.
  15. Put in Personal Questions interactions