AI and Character
I’m starting to set up some of the basic AI programming in Mouthwash, my work-in-progress conversation system. (Some background here.) I wasn’t planning to get to that stuff so soon, but it became apparent pretty quickly that a lot of other stuff depends on the speakers having “goals.” So I’m having to deal with planning and state spaces and figuring out just what I mean by goals anyway.
This has me thinking about how you can express character through AI in games. I’ve also been playing Persona 3 lately, which is a squad-based Japanese RPG where all your party members are AI-controlled. I’ve seen some fans theorize that the personalities of the different fighters are expressed through their default AI. They all seem to behave the same way to me, so I’m not sure I buy this. But I think it’s an interesting idea.
I found myself doing some of this with the tactics system in Dragon Age: Origins. Morrigan is selfish, so I would push any tactics that healed or buffed other party members to the bottom of her queue; conversely, I made Wynne help others before she helped herself. When characters fell in love with me, I’d make them defend me more. Zev would do this intelligently, by helping to disable or distract my opponent from a distance, while Alistair would just rush headlong to my side, because he’s an idiot. Things like that.
What I was trying to do, basically, was to get the characters to behave in battle in a way that reflected the personality I saw when I talked to them. In a Mouthwash game, you wouldn’t have this distinction: conversation is the battle. So it’s necessary to build these kind of personality-based tactics right into the foundation of the game. Otherwise, it’d be hard to express personality at all. Unlike other games, I won’t have the leisure of telling you about a character through a tightly controlled dialogue scene. You have to figure out who they are by playing with them.
This means I have to think about the AI of these conversational agents a bit differently. Any intelligent computer agent needs some way of measuring how “happy” it is at a given moment, and what actions it can do to get happier. In combat, these measures are pretty easy to figure out: enemies’ health goes down, that’s good. Allies’ health goes down, that’s bad. You decide what to do based on moving those numbers in a positive directions.
In a conversation, on the other hand, people can have lots of different goals, some of which might conflict with each other. They can also have different ways of deciding how to get to those goals. Defining a character’s goals will tell you something about that character’s story arc. Defining their tactics will tell you who they are. Most of this I plan to simplify using character classes, but there’s a lot of room to build personality into AI style in more subtle ways. Do you take a brute-force approach to problems? How many steps ahead do you look? Are you willing to backtrack if things aren’t working? These are all questions an AI programmer might deal with that also sound like questions about a person’s character.