2
\$\begingroup\$

I want to use the behavioral AI from a game engine, for character conversation modelling. Most game engines provide very good graphics pipelines, like Unity, but I want to use the AI part, like in "Assassins Creed 2".

It looks like the character is always in a state machine during gameplay, especially when he talks to the other characters and the NPCs. The other characters, like Lucy, do not say the same thing. Instead, they say something which is related to the local goal of the state. Is it all scripted, or is there any AI?

\$\endgroup\$
5
\$\begingroup\$

In my experience, conversations with NPCs in games are always scripted. Natural-language parsing and sentence formation are difficult and mostly unsolved problems at this point, so we fake it.

To the extent that there's anything that could be called "AI" you can do one of two things, both of which still count as scripting in my book:

1) Flags. If the player has taken a certain action in the game, or earlier in the conversation, or whatever, then set a flag on the NPC that makes them treat the player differently. Think of every RPG you've ever seen where the palace guard tells you the princess has been kidnapped, until you bring her back, at which point he says something else.

2) Numeric ranges. The player has one or more numeric attributes. These might be global attributes (Karma in Fallout 3, Light/Dark side points in Knights of the Old Republic, etc.), or specific to that NPC or that NPC's faction (like your friendship/romance levels with other characters in The Sims). If your value is higher or lower than a certain threshold, the NPC treats you differently.

\$\endgroup\$
1
\$\begingroup\$

To my experience some games like RE Outbreak and L4D used a script + variables. Where variables are generated along with the map generator. This usually not part of a game engine, as game differ on the RND generating rules most of the time.

\$\endgroup\$
1
\$\begingroup\$

The Inform community, which probably writes more realistic game conversations than anyone else, has several different tricks and extensions for scripting character conversations. The content of these conversations is generally scripted, but the form is more dynamic, or at least more variable. This is not a traditional area of AI research, although some people like Nick Montfort are breaking new ground in this area.

\$\endgroup\$
0
\$\begingroup\$

To date, the only game I'm aware of that is not scripted (in the way you probably mean it) is Facade (Try it, it's worth the time spent)

But even there, it's scripted to some extend : every time you play, there will be 3 "special points" in the drama, and characters still obey to some "scripted" high-level rules.

\$\endgroup\$
0
\$\begingroup\$

One thing you can do to make conversation more "AI-Like" is to combine your scripts into a greater system. For an individual interaction between characters a script with variables, as described by Ian, is as good a solution as anything involving "real" AI.

But, the way you kick off and transition between these conversations can definitely use "real" AI. For instance, you can model a character's schedule so they go about their lives according to a set of priorities. Then, if an individual character comes into contact with another character, you have a system that evaluates rather they would talk, based on shared history or other factors. This can be as complicated as you would like and there's no need to pre-script the meta-conversations. But, as soon as you drop into an actual conversation you're better off going with something prescripted.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.