Touchy subjects, Opinions, and other things getting thrown into Interrogative 3

Whew! Just closed out the 0.8 milestone forĀ Interrogative 3 this weekend, and I only had one task carry over into the next milestone. There’s a really good reason for that happening, too, but first, a few tidbits on what got added during this milestone, since the last week or two have been quiet…

With the Trait Modifiers in place, I figured something that would be useful would be to be able to tag facts and dialog with PAI (Personality-based AI) traits and their values. In this way, you can get a character to state something specifically reflecting the state of that particular trait, and it works much the same as the standard Knowledge Levels do (I will do a blog post on that specifically next week, but it’s mentionedĀ here), except the tags and levels are procedural. Any time the NPC needs to access its Knowledge Levels, those that relate to traits are pulled directly from the current traits levels (current, because they can be seen as possibly being in flux due to Trait Modifiers).

Another goodie that made it into milestone 0.8 was the ability for the NPC to ask random (or not so random) questions regarding its own knowledge to the player. My aim here is to provide the character creator the tool to be able to reference a piece of knowledge that the NPC knows and use it as a question for the player. Currently, the matching algorithm is simple string matching, but that will change later as more complex question features are added.

The above Q&A feature also necessitated the creation of a Working Memory component for the NPC class. In the above case, it allows the NPC to stash the question away in memory to be referenced later when the player comes back with an answer. The component is flexible enough to be used almost like a conversation blackboard, but with support for many data structures (extensibility for the win!). This is also going to come in handy for near-future features that I’m working on now.

Interrogative 3 – Milestone 0.9: Opinions and Story

This one is going to be a doozy. The problem with scoping the later milestones such as this one is that there’s a number of extremely hard problems that I need to solve before I implement those solutions. It’s not enough to say that you’re going to tackle this huge AI problem. You really do have to solve it- or solve it enough to be satisfactory to a wide spectrum of developers.

So here’s a partial list of the issues I’m looking to solve (once you’re done reading this list, you can then say “yeah, he’s probably going to have to move his milestone date back a bit from the end of February”):

  • NPC responses to statements: One of the things I didn’t mention above was that I had also began implementing the feature where you could make statements to the NPC, to which they would respond- both within the Knowledge Levels they have for the subject at hand, as well as taking into account their PAI traits. That is something of a tall order, and involves decomposing statements either chosen (canned), or typed and sending them to the server, which will then decide just what you were trying to say when you said that, and whether you get back informative dialog, emotional dialog, or if the server should call the callback that makes the NPC to play the “smack player upside head” animation. Utility Theory only gets you so far here, because characters (as with people in real life) do not evaluate situations perfectly rationally, and the stronger a character’s feelings about a thing, the less rational the evaluation of that thing is. Opinion-based decision making is a good way to go, though, towards solving some of this. You thought I was going to say “goal-based”, didn’t you? Well, I did. Goals can be thought of as highly-active Opinions. A good way to think of that analogy would be to think of the people who see someone doing something foolish and mutter “there should be a law against that” before moving on with their lives, and the people who say “there should be a law against that” before calling up the city council, getting petitions together, and attempting to get that law created. Both of those people have the opinion, but only one acted on it. There’s a lot more to it, such as how you handle tolerance for other Opinions, how you can use them to select actions to possibly perform, what you can actually represent with Opinions, changing Opinions, etc.
  • Scenario generation: Opinions only really shine when you have them conflicting, and when a player sets out to resolve conflicting Opinions, then that player is engaged in a Scenario. This is a loosely-based construct that allows NPCs to play their part in stories that are also loosely-based on the Scenario which spawned them. All of this looseness is due to the ability of the player to be able to resolve these stories using a wide variety of methods (or a narrow variety, but that gets into the editor, which we won’t address until the next milestone, when it starts getting prettied up). Story generation has been used in many games to various levels of success, and it’s something that Interrogative 3’s NPCs are built for. Implementing a good Opinion/Goal system for the NPCs will allow me to more easily create a kind of Story Director, as is implemented in many games, to help guide a story along and give the player a more flexible story experience.
  • Dynamic dialog: The two above features are good, but only limited in usefulness if the dialog system stopped being functional when dealing with Opinions, Scenarios, and the conflicts that they cause. Luckily, the implementation of dialog in relation to Opinions can do a good deal of the work.

And that, in a nutshell, is Milestone 0.9…

Next blog: Knowledge Levels, tagging knowledge, and NPCs who believe stupid things…

Leave a Reply