What have I been up to lately?
Working on Interrogative!
A lot of the work lately has not been the cool AI stuff, but rather futzing around with the tool and getting other things working for being able to post demos. With current browsers shunning NPAPI plugins, Unity’s webplayer is no longer a feasible way to put up demos, and their WebGL target is having issues with the SQLite plugin I’m using to store data for Interrogative’s use. And with Flash being shunned by, well, everyone, I begin running out of choices for how to get demos up on this site. This is frustrating, because I’ve had a demo since before March…
I try not to dwell on that, though I’m looking for a suitable way to get that task done, and in the meantime, I’ve abstracted out the MySQL layer for the tool so that it could also be used with Unity (the tool is written in C#) when I start selling it in the Asset Store. I may also have an implementation for one of the SQLite plugins out there as well. These data access layers will be unsupported, but I’ve put the time into trying to get them a bit polished so that they’re not inefficient (maybe not the fastest, but not slow either). Running a test for basic queries, I can do 1000 in 0.2166616 seconds on my dev laptop with normal tasks running. Unsurprisingly, you can run 5000 of those queries in 1.0138701 seconds. That’s not bad performance for MySQL, even if the laptop is pretty hefty (8-core i7 with 16GB RAM and two SSDs).
Something else that happened was the delaying of a feature. One of the things that I’ve wanted to do is to have a user select some answers to “moral questions”- generally stating how likely an NPC would be to react in certain ways, and then be able to randomize personality traits based on those answers. Long story short, there’s a lot more moving parts for that to happen without taking a long time to debug the results, and since I have bigger fish to fry, this feature is being lumped in with a feature set that is slated to come to Interrogative in the next version: Parametric generation of NPCs. It’s basic to that functionality, so it’s delay is actually sensible.
And what about those bigger fish that need frying?
So, some of the things that are still needing to be knocked down for Interrogative are (this list is subject to change, with tasks being added, removed, delayed, etc):
- I’ve moved the conversation testing GUI to its own tab, and need to revamp how conversations can be tested. I’m going to be pulling in some basic NLP stuff I have from the Unity demo into the tool so that you can type out your queries and statements, in addition to buttons and drop-down lists. The NLP I’m using for the front-end part (not being used by the NPCs) needs a bit of touching up, but I’m hoping to get most basic typing covered.
- For testing purposes, I need to implement a TraitModifier “stack” so that TraitModifiers can be added and removed during the conversation for testing purposes. Previously, it was pretty clunky and limited, so I need to improve that.
- For conversation functionality, there’s a few things that I’m looking to implement:
- NPC statement responses: That’s a deceptively complex task heading, as it encompasses a lot of things. The NPC has to know what’s being said (semantically), understand what it means- generically- to him/her/it, and respond according to their personality. This goes well beyond threats and yo-momma jokes, into more subtle stuff. Right now, I’m covering less subtle statements, since the more-subtle meanings of statements will take months to wrangle and get into a future version of Interrogative (but it will happen).
- Flavor text within Dialog Templates: Right now, Dialog Templates are pretty straight-forward, and I’d like to shake that up by using inputs from the NPCs personality to be able to generate snippets of “flavor text” that can be inserted into the dialog to make it more personalized towards the NPC’s personality. As with Dialog Templates, this will be a customizable thing.
- NPCs interacting with each other in a conversation: As a first pass, this will be limited. Ask two NPCs a question, and you can get two answers. Depending on their personalities, however, you may want to have an NPC correct the incorrect answer of the other NPC, or have them agree with the other. Conversation is very much turn-based, by nature, and so it’s not that hard (conceptually) for the NPC that goes second/third/etc to simply agree with another NPC’s answer, if it is the answer they would have given. It’s also a good place to insert that flavor text!
- Incomplete information model: This is more complex. Knowledge, previously explained, is assigned to the NPC via knowledge tags and knowledge levels, giving it a certain “depth” of knowledge for a certain category. However, this simplistic way of doing things is not the only way, and certainly not the most powerful. As an option, for those creating more narrative-heavy games, for example, another way of assigning knowledge to NPCs would be to represent knowledge levels at the object and attribute/predicate level, so that NPCs can have in-depth knowledge of some aspects of an object, while not know anything about other aspects. This is going to come in extremely handy when more advanced versions of things like Opinions get implemented.
- And once the above technical things are done, it’ll be time to write out manuals, tutorials, record videos, export DLLs for C++ and get other things done for the product launch.
Reading all of this, it may seem like an overly-complex AI system, but in reality, the code is actually pretty simple- and getting it that way is what takes a lot of time. Trying to keep the database calls relatively fast, keep the math light, and balancing that with the need to not make the implementation too specific to a data storage solution or engine makes this much harder than if I was simply implementing a custom feature for a single game.
I didn’t want to talk about everything here, but I touched on a few advanced features that I’m planning and designing, and they bear mentioning in the blog. Advancing the Opinions feature is a big deal (big enough that it may replace TraitModifiers, requires the incomplete information model, and may spur some low-level database structure changes). But what I’ll probably talk about next is how to get your NPC to lie, exaggerate, under-report, and talk in vague relative terms, as we all do. Sounds simple- and it actually is…