The centerpiece of Project Wild One’s design is the handmade engine driving how its NPCs think and act. The word AI is thrown around a lot these days for a certain style of automated processing, but this is not “Machine Learning”. This is a system I’ve coded from the ground up to try and simulate how a creature could interpret its surroundings, learn from them, and act on its thoughts, based primarily on two major components: Interps and Theories. This page may be out of date at times as development continues– as of writing, I’m just releasing the first version of this new system, but hopefully it can give you some insight into what’s going on under the hood!
What is the Interp-Theory Mind?
The basic idea is that each NPC collects its own information and develops its own ideas about everything happening. The raw information is stored in variables I call Interps, which report it for processing in variables called Theories. Those Theories hold just about everything the NPC believes to be true about itself and others. Theories feed into other Theories to develop more complex ideas, eventually driving its decisions about how to act.
What is an Interp?
Whenever something happens that an NPC is aware of, it generates a Memory, which tracks how confident the NPC is that this thing happened and generates many different Interps for what information it could interpret from the event. Interps can represent many aspects of how information is interpreted, including having multiple possible explanations for a single action. If you attack an NPC, it might generate Interps for you wanting it to die, you trying to signal it your displeasure for various reasons, or you just being a violent asshole. These Interps are judged to be more or less likely to be correct based on how you act before and after the attack– your later behavior will make it re-weigh those Interps to detect patterns in your behavior over time.
They do this by reading from related Theories, which they in turn feed into. This can cause situations where the NPC can realize, for example, that you didn’t seduce it ten minutes ago because you have any special affection for it, because now it sees you seducing someone else and you are in fact just really horny for anyone you meet.
What is a Theory?
Every NPC starts off with certain loose assumptions about itself and how it fits into the world, and every time it meets another character, it makes several loose assumptions about them as well. It knows that it knows almost nothing about them. All the Interps it generates feed into these ideas of what it, the world, and all the other creatures in it are like. These ideas are called Theories, and they can do some pretty complex things.
Every Theory tracks how much information it’s been fed to know how confident the NPC should be about that idea, and it has separate tracking both for how true something is and how confident it is about that in the long term and in the short term: when you attack an NPC, its Theory about you just being overly violent will react differently if it knows nothing about you, if you’ve been violent in the past, or if you’ve never been violent in all your time together before this– with separate consideration for you being violent just recently or long ago. This will help it figure out which Interp to give the most weight, to more accurately understand what’s happening right now the more it “knows” about you.
Tracking long-term vs. short-term also allows Theories to recognize situations like, for example, if you’ve had a lot of sex with an NPC but now are trying to stop. It knows that in the long term, you like having sex with it, but the more you work to stop things the more it understands that right now isn’t a good time, or perhaps that you’re satisfied. But if most of the time sex comes up you’re only trying to pull away or avoid it, over time it will grow more confident that you just never want to have sex, which in turn it can develop Theories about– perhaps you dislike certain kinds of sex, or aren’t attracted to this NPC, or just don’t like sex in general.
Theories can, in turn, feed information into other Theories that interpret many different aspects to develop more complex ideas. The idea of whether an NPC would enjoy having sex with you a certain way has to be informed by what it knows about you being violent or dangerous, how good a lover you are, how interested you might be in having sex with it, and how much it enjoys having sex using its particular anatomy in question and yours. As all these other Theories fluctuate, the summarizing Theory does as well, but it also has its own expectations that build up over time– if it constantly feels like having sex a certain way with you would be great, that builds up a certain inertia to feel that way even if some information feeding into it changes. This helps the NPC build more complex habits and expectations.
Also, Theories can generate a little information on their own over time. If you’re having sex with an NPC but it’s not particularly stimulating, its opinion of sex with you will gradually go down over time, as will sex using that anatomy. Or, if you’ve been especially pleasant to have sex with in the past, an NPC will gradually develop a “craving” for more sex with you as time passes, making it all the more eager the next time you meet.
What Else?
This system also generates Interps for a few more indirect but important pieces of information. When an NPC flirts with you, it builds up its Theory that you might be having sex with it soon. If you don’t respond to its flirting, this generates a mild Interp that you’re not that interested in having sex with it. In this way, an NPC can gradually learn from what you don’t do as well as what you do. Most actions in the game have some value for how much they may be implicitly in favor or contradictory to the “context” of the moment, so if you’re mid-coitus with an NPC but only paying attention to another NPC, the first will start to feel like you’re not really interested in the sex you’re having with it.
So What?
A lot of the systems I describe here might sound a little like “well yeah, that’s how I’d expect someone to feel or think, isn’t that obvious?” and that… is pretty much exactly what I’m going for. The previous AI system, and probably most AI systems out there, wouldn’t bother with even a quarter of the things this system can handle. Having NPCs that work off limited information rather than seeing everything the system sees, making guesses as to the meaning of every action of both PCs and NPCs, without any single defining goal to focus everything on like “win a fight” or “have an orgasm,” is, near as I can tell, almost unheard of. These NPCs are not trying to “win.” They are wandering in the wild, trying to feel good and avoid feeling bad in whatever encounters they have, and they have many different needs and desires. I’m still developing this system, but it is something I haven’t seen anywhere else that I think could provide a richer, more meaningful experience than we’ve come to expect from games.
It is my hope that this system will, in time, be robust enough to create dynamic sexual situations that respond to how you play without being too rigid or the NPC seeming too “stupid” to enjoy. I hope that I can make it flexible enough that it might easily adapt to many different situations, be it playing with different game options and fetishes or even different “styles” of game, set in different situations or worlds. I don’t plan to ever make it smart enough to actually communicate using language or the like, but I hope to enable it to be very easy to expand with new input, new internal priorities, and new actions it can take so that it can be adapted to whatever changes or additions I make to the game with minimal extra work. Keeping the AI able to work with changes has been one of the big things holding me back from the start.
What Next?
As of this writing, the system is only able to build basic Interps and Theories, and it plugs the info from those Theories into the old, existing AI system. This lets it make better decisions than it used to, but it’s still very limited. The complete version of the Interp-Theory Mind should delve much deeper into what a mind should be capable of.
I want the Mind to have a series of internal senses of “satisfaction” it is chasing after: along with keeping the NPC fed and rested, it wants to feel satisfied sexually and socially; it wants to feel like it is in control of its life and is not too weak or powerless; it wants to feel like it is making a difference, like it “does the right thing” when it really matters; it wants to feel safe, stimulated, and loved. If it is having trouble satisfying one of these things, it will start to fixate on it and do whatever it can to get satisfaction– but if it is unsatisfied for too long, it may develop a complex and instead overcompensate through satisfying other needs to a greater level. If you can provide something it needs, it may grow very attached to you. But if you offer something it already has in plenty, it may be uninterested in you.
I want the Mind to be able to make plans– to recognize that to satisfy its needs, it needs a certain situation to come to pass, and that making that happen may take several steps. I want it to be able to recognize many possible paths to satisfaction and estimate that certain actions make many of those paths more likely to open up. I want it to assess what has and hasn’t worked in the past, favor proven plans, and develop new plans based on what has produced desirable results.
And I want the Mind to be subject to its emotions! It won’t make all its decisions based purely on logic, but on how it’s feeling, which is driven by its disposition in the long term, its mood in the medium term, and its emotions in the short term. It won’t always do what’s actually in its best interest, but what “feels right” to it at that moment.
Finally, I want the Mind to differ substantially from one NPC to the next based on their unique traits. Different personalities will interpret the same situation different ways, process it different ways, and make decisions different ways. Some get bored easily, some are desperate for social interaction, some are always grouchy, and some are cold and calculating. This isn’t a set of simple presets– this should be a series of different factors that all add together to make different effective personalities. Every NPC should have a “past” that shapes how they see the world, along with certain genetic predispositions that they might follow or defy.
I cannot claim that I will make all of this a reality– I’ve already had to change a lot of my ideas and plans for the Mind just building the first major part of it. In some cases I found a better solution, and in some cases it became clear certain ideas just wouldn’t work, or would be far too resource-heavy. I want this system to go the distance, so it can’t be so heavy it takes up all the computing power on the device you’re playing on. I know I’ll have to make compromises for a lot of reasons, but this is the direction I want to go in. I want to see how much of this I can build. I think this system is already something exceptional, something to be proud of, but now that the foundation is in place, I want to make so much more out of it.