Everything is relationships

Posted by Michael on May 31st, 2006, in Development

This follows the individualistic model of describing personality and character growth discussed here. The idea was to lead evolution of a character’s personality by punishing and rewarding it for doing certain things. Whether an action would be rewarded or punished would be switched randomly once in a while, to avoid singlemindedness.

How about actions that involve relationships with other characters? Surely you can’t just randomly switch the approval on or off. Think of a pet dog, for instance: once a character grows fond of it, in reality, there would be no way to undo that!
Relationships should be excluded from this individualistic model all together, really. A relationship should be something that characters develop together.

But couldn’t you consider all interactions, even those with inanimate objects, to be forms of relationships?
Only to some extent because if one of the partners in the relationship is inanimate, it will not be able to perform any actions so the system can ignore it. On the other hand, even though an object is inanimate, the character might still treat it as if it were a character. People are fond of their stuff. If a character liked playing with a ball, it will hang on to the ball more than if the ball was thrown in its face.

You could think of solitary behaviour as expressing a character’s relationship with the world (or at least its current environment).
True. Perhaps the focus should be exclusively on relationships, then. And it is a character’s relationships that grow and not its personality. Starting values for actions would be replaced by neutral values for all things that the character hasn’t met yet.

But characters should not be blank slates like that! It’s not because Little Red Ridinghood has never met the wolf that she wouldn’t be afraid of it when she does!
Right. In fact, most objects would be like that. Only completely alien things would be met neutrally.

It would not be very practical to pre-define initial values of all relationships in the world. It would be an immense task and it would make it difficult to add new things.
We could solve this be defining a fixed number of classes or categories. And then giving an initial relationship value to each class.

This would mean that Little Red Ridinghood’s response to each different Wolf would be the same, even though some might look cute to her and others frightening.
Such important characters should just form a class on their own. And the initial relationship should be defined individually.
At least towards other avatars. Towards a bird in the forest, all wolves can be defined by one class.

But then you need at least two sets of classes.
We do, anyway. In the sense that we have the classes and we have the individuals. Even though a character may start the game with a preconditioned relationship with all animals (=class), when it meets and interacts with a particular animal (=individual), it will develop a unique relationship with this animal. Henceforth, this particular animal will be excluded from the class and treated as an individual.

So every character in the game walks around with an ordered list of values for relationships with individuals first, followed by a list of values for relationships with classes?
Yep.

Personality and growth

Posted by Michael on May 31st, 2006, in Development

A simplified model

Say all autonomous characters have the same list of possible actions to choose from. The likelihood of a particular action being chosen is defined by a value. When petting the cat has a value of 0.8 and climbing the tree has a value of 0.5, then the character will be more likely to pet the cat.
Different personalities can be defined by different values for the actions of each character.

Every time a character performs a certain action, it is rewarded or punished for doing so by respectively adding to or substracting from the value of the action. This way a character can grow and its personality can develop.

Whether a certain action is rewarded or punished is defined by the author. The author could, e.g. define starting values and desired ending values for each action, that way ensuring that the character will develop a certain way.

Objections

The requirement to come up with a value for each action of each character is not a trivial task. Not only could it be a lot of work, it is potentially a very tricky balancing act that would require thorough testing.
On the one hand, perhaps it’s worth the trouble.
On the other, perhaps it is possible to value actions in groups.

The value of an action depends on the situation. Eating a cake on the verge of indigestion is a bad idea and should be punished. But when the character is hungry, it should be rewarded.
Correct. Rules could be added to decide when an action should be punished and when rewarded. But then the authoring workload becomes even larger and the system a lot less simple.

Also, continuously rewarding a character for doing the same thing, will end up having it do the same thing even more. So the system would culminate in a “monoculture”
Perhaps randomness can come to the rescue here. Perhaps it can even replace the rules mentioned above. We could, periodically change the punish or reward response to actions. This may coincide with the attention span idea, mentioned elswehere. That way we would also reduce the workload for the author since desired ending values become irrelevant.

But you’re still stuck with defining the values of the actions to begin with. These are a very powerful way to define personality and cannot be left to chance.
Yes. Maybe the author will have to do a bit of work here.

Etiquette bubbles

Posted by Michael on May 31st, 2006, in Development

This is sort of a stream of consciousness that starts with the problem of animation selection and ends in the invention of instanced etiquette.

The final result of any logic that we are going to build is an animation played by a character. This animation may be modified by a pose (to express tiredness e.g. or personality).

Sometimes animations will be played by two characters synchronously (playing with each other, hugging, etc). This motivates us, combined with a reluctance towards individuality, to think of this animation being chosen by the situation rather than the individual actor.
If individual characters have to perform animations synchronously, they would have to communicate with each other about the choice of animation and when to get started. This is messy.

This means that, at least when the situation consists of more than one actor, one could think of the situation itself as possessing the knowledge about the mood that motivates behaviour, rather than the individual actors. This would mean that each actor agrees on the mood of the situation. This may not be realistic but it might be good enough. Giving the actors the freedom to choose whether or not to do what the situation dictates is messy. Perhaps we can call this “mood of the situation” etiquette.

Now, how does the situation gauge the mood? And do we allow for a measure of randomness?
A lot depends on the characters. On their personality and their state (or mood). But coming to a single conclusion about the mood of a scene, based on these parameters, is boring. This is where randomness can be our friend. So that when a weak girl meets an aggressive monster, the chance exists that she greets him with fond enthusiasm.

These leads us to causality. If the monster responds favourably, then the two characters can become friends. This would drastically reduce the chances of e.g. the girl being eaten.
If the monster responds negatively, the girl doesn’t necessarily have to give up. This depends on the narrative goal of the situation. And how strong it is. If there is a strong “pressure from etiquette” to become friends with the monster, the girl may be motivated to remain nice until the goal of friendship has been reached, or a more prominent goal has surfaced (e.g. survival if the monster becomes menacing).

There may be a problem with thinking of the situation or etiquette being the core of the system in terms of modularity and reusability. Do we need to have multiple instances of etiquette, one for each encounter? Or does a single “master brain” suffice (with the dreaded spectre of the Drama Manager looming on the horizon)?

On the other hand, when we think of real etiquette, it still applies even when a character is alone. And also, and perhaps more importantly, perhaps the etiquette actually only needs to exists where the player’s avatar is -at least for the kind of games that we want to make. We could consider etiquette to be a sort of stretching bubble that includes only the characters in the vicinity of the player’s avatar.

A problem with avatar-centric etiquette is obviously that characters outside of the sphere of influence will behave like animals. 🙂
So how do animals behave? The general answer is “on instinct”. Perhaps instinct is also a form of etiquette. Perhaps instinct could be replaced by etiquette. To prevent them from behaving like animals.
What does this mean?

What if all characters walk around with an etiquette bubble? When they meet each other, one character will be enveloped in the other’s etiquette bubble. Which etiquette bubble wins is randomly decided. If one of the characters is the player, then the player’s bubble always wins. It doesn’t really matter because all etiquette bubbles are the same. The important thing is that two (or more?) characters can share the same bubble.
Instanced etiquette would allow characters to interact with each other without involvement of the player’s avatar. When two characters meet, etiquette controls both of their behaviours.

Or is protocol a better name?

Paradox of the Actor (Denis Diderot)

Posted by Michael on May 26th, 2006, in Books

read in Dutch translation by Gemma Pappot from French original (1773)

Written in the Rococo period, this pamphlet argues that the best actors rely entirely on imitation skills for their performance. If they do not feel a thing themselves, they will be much more capable of moving the audience. This links the act of acting to that of writing or drawing, where observation is one half of the work and reproduction is the other.

It reminded me of our desire to build the Drama Princess system “from the outside” rather than designing the emotion first and then hoping for the proper behaviour to emerge from that.

Diderot’s concept is not very popular amongst actors. And probably never has been. Perhaps this is because they feel that he is giving their tricks away. Or perhaps because they can’t meet his high expectations. Diderot makes it very clear that what he says only applies to the best of actors, the geniuses. For mediocre actors, he admits that it may be better to really feel the emotion when playing it on stage.
Obviously, in the mean time, modern theater has developed quite different goals than imitation or even moving the audience. So perhaps these ideas apply more to movies nowadays than to the stage.

He also makes a big distinction between acting “in the Salon”, amongst friends, for fun, and acting on stage. The latter is never even based on real life, but on a text that was written by somebody else. That way, the actor is even further removed from real life. Standing on the shoulders of the poet, who was standing on those of a person in nature, the actor becomes larger than life.

I don’t know if Diderot was ultimately in favour of a very stylised, symbolic way of acting or if he thought that imitation performed by a genius actor would look naturalistic.

Here’s a quote that sounds oddly similar to things said previously in this journal:

So what defines true talent? Knowing very well the external symptoms of the soul that one borrows, directing oneself to the sentiment of our audience and deceiving them by mimicking these symptoms in an imitation that makes everything look bigger in their imagination and that shapes their judgement permanently; because another way to judge what happens inside ourselves does not exist. And what does it matter whether they do or do not play from their emotions, if we don’t notice?

(from page 99 translated from Dutch by me)

Why not random?

Posted by Michael on May 25th, 2006, in Development

The basic problem of autonomous behaviour in Drama Princess is that of action selection. The most simple solution is randomness. And we know from experience that randomness is also very believable, more so, often, than much more complex systems.

For reasons that are mostly related to narrative, total randomness is not desirable.
These reasons include the desire for

  • Consistent behaviour
    It’s easy to make an insane or hysteric character. Pure randomness will get you very close to this. But we do not want to limit our narrative potential. Sane characters display a certain consistency in their behaviour.
    We have already suggested a simple solution for consistency.
  • Diverse personalities
    Both the story and the player’s empathy improve as the characters display a recognisable personality. To express this personality, a character’s selection logic would need to prefer certain actions over others. To define this personality, the author would need to be able to define this preference. On the other hand giving each character a different set of actions would also immediately give them a different personality. And the outer appearance of a character (model, textures, animations) goes a long way as well in this area.
    The re-usability requirement of Drama Princess, however, would benefit from characters that share action sets and assets.
  • Character growth
    Also important for both story and empathy is the perception of growth or evolution in a character. Especially if this growth happens as a result of interaction with the player.
    To implement growth as a constraint on randomness, the selection preferences mentioned above would need to be dynamic. Not randomly dynamic but according to a gradual shift. Perhaps one could think of morphing as a metaphor: you could morph one set of actions or preferences gradually into another. In the case of preferences, this could be as simple as increasing or decreasing a bunch of numbers, each of which defines the probability that an action will be selected.
Randomizing constraints?

Posted by Michael on May 25th, 2006, in Development

Randomness is an easy solution for the problem of action selection in an autonomous character. For reasons that I will get into in a later post, complete randomness is not desirable. In order to create believable characters, one needs to develop constraints on this randomness.

But what if we turn the logic around?
At the other side of the spectrum, we find totally scripted behaviour. Would it be possible to inject randomness into scripted behaviour in such a way that the character seems autonomous?

We would first need to define scripting. Obviously if all behaviour of the character is scripted, then randomness cannot not have any deep effects. Unless the intervention of randomness applies to the very linearity of the script. In a branched structure, randomness could be applied every time a new branch needs to be chosen. Or the script could be cut up into sequences that each have a limited amount of sequences that can follow it. Randomness could be applied to the selection. The smaller these sequences are, the more varied the behaviour will be.

It seems that by randomizing the constraints or constraining the randomness, one simply gets closer to the other as we improve the quality. So the ideal system lies somewhere in the middle. Randomizing the constraints might be a more convenient way to author the system because it deals with desired behaviour as its material.

Drama Princess Workshop & Symposium

Posted by Michael on May 25th, 2006, in Development

On 22 and 23 May 2006, we have organised a small workshop and symposium in the Foam Lab in Brussels.

A summary of the symposium’s conclusions can be found here.

On the first day, guests were invited to play certain commercial videogames. Those games were Ico, Black & White, The Sims 2 and Animal Crossing. Facade, Catz and Soul Calibur II were available as well.
And on the second day we discussed the autonomous characters in these games in a round-table format that was open to the public. Present on that day were Maja Kuzmanovic & Nik Gaffney (who had played Ico during the workshop), Judith Dormans & Daan Pasmans (Animal Crossing), Marek Bronstring (Black & White), Maaike Lauwaert & Martijn Hendricks (The Sims 2), Lina Kusaite, Cocky Eek, Theun Karelse, Elke Van Campenhout, Nina Czegledy and of course we, Auriea Harvey & Michaël Samyn.

The conclusions that our guests came to about the autonomous characters in these games, were largely the same as the ones that we have expressed on these pages before. With the exceptions, to some extent, of Maaike Lauwaert who went as far as calling The Sims 2 an amoral game and Maja Kuzmanovic expressing doubts about the sympathy one feels as a player for Yorda. It must be noted that Maaike had been doing a case study on The Sims for another project and that Maja had not ever played a Playstation game before in her life.

During the discussion we came to a perhaps odd consensus that sophistication of “AI” seems to be reversely related to the believability of the characters. The primitive Animal Crossing creatures were far easier to accept than the complex Sims. Some people even had trouble calling The Sims autonomous because they do not seem to try to accomplish their goals but needed the player’s help with that. Also, their personalities were not considered very diverse as they all responded in the same way to the same stimuli.

Here’s a summarized transcript of the videorecording of the symposium.

Oz Project

Posted by Michael on May 25th, 2006, in Projects

http://www.cs.cmu.edu/afs/cs.cmu.edu/project/oz/web/papers.html

These are my remarks on An Oz-Centric Review of Interactive Drama and Believable Agents by Michael Mateas which offers an overview of the project’s goals (1997).

Oz is a reserach project into believable agents and interactive drama. Like Drama Princess, the Oz project focuses on drama much more than scientific AI. Unlike our work at Tale of Tales, the Oz project values plot and story arc greatly. This leads them to build a piece of software called drama manager, which we consider to be a deus ex machina for plot-fetishists.
We believe that the plot belongs to lineair formats. Non-linear formats should not be structured along plot arcs. This is no different now, with interactive media, as it has been in the past, when architecture, sculpture and painting were also completely plotless narrative formats.

Interestingly, they also mention the problem that I refered to earlier as the Seduction of Realism: When attempting to marry a technical field like Computer Science with a cultural activity such as story telling, it is extremely easy to become sidetracked from the artistic goals and to begin pursuing purely technical research. (Michael Mateas)

From the same text, we learn about the “requirements for believability” in characters:

  • Personality – Rich personality should infuse everything that a character does, from the way they talk and move to the way they think. What makes characters interesting are their unique ways doing things. Personality is about the unique and specific, not the general.
  • Emotion – Characters exhibit their own emotions and respond to the emotions of others in personality-specific ways.
  • Self-motivation – Characters don’t just react to the activity of others. They have their own internal drives and desires which they pursue whether or not others are interacting with them.
  • Change – Characters grow and change with time, in a manner consistent with their personality.
  • Social relationships – Characters engage in detailed interactions with others in a manner consistent with their relationship. In turn, these relationships change as a result of the interaction.
  • Illusion of life – This is a collection of requirements such as: pursuing multiple, simultaneous goals and actions, having broad capabilities (e.g. movement, perception, memory, language), and reacting quickly to stimuli in the environment. Traditional character artists do not mention these requirement explicitly, because they often get them for free (from a human actor, or as a deep assumption in animation). But builders of interactive characters must concern themselves explicitly with building agent architectures that support these requirements.

While this list is very useful, it bothers me that it is still written from the assumption that the actor performing the character actually feels the emotions, drives and desires. While it would be more correct, in my opinion, to claim that the character only needs to show symptoms that can be read as if it would posses these traits.

About the difference between realism and believability:

When watching a play or film, viewers know that the characters are not “real” but that does not detract from being engaged by the character.

Oz’s Drama Manager serves the purpose of creating plot in an interactive story. To be able to do this, the Drama Manager needs certain rules, an “evaluation function”. To author this system, Michael Mateas suggests the following steps:

1. write some linear (non-interactive) story as a sequence of “important moments”
2. reverse-engineer your own thinking to figure out why you think that particular sequence is a “good” story
3. capture this aesthetic as a set of features (over sequences) in an evaluation function
4. make sure that you have (approximately) captured your aesthetic by comparing the output of the evaluation function with your own evaluation of a set of sequences (of course include the original story – the one your “really” want to tell)

I find this highly problematic. First I don’t like the typical scientific way of taking a whole, breaking it apart and then trying to put it back together. I believe that you lose the essence of the whole when you work like that. Second, not unrelated, never, in these steps, is the user mentioned. It’s all about the author and what she wants and never about what you want the user to experience, let alone how.

He then continues to describe how this Drama Manager would, at each plot point, evaluate all possible future interactions to then choose one that is rated high by the evaluation function and push the story in that direction. Not only does this strike me as a million times more difficult than creating a believable agent, I also have serious doubts about the desirability of such a system. Ultimately the best you could achieve is a formulaic story. Because you literally apply a formula to a narrative. And formulaic stories happen to be the worst that film and literature have to offer.
Does this mean that it is impossible to make narrative art with interactive media? No. It just means that interactive media are not suitable for writing novels or creating movies, much like novels and movies are not suitable for painting pictures or carving marble.

How low should the author go?

Posted by Michael on May 23rd, 2006, in Development

Developing a system for interactive drama requires finding the optimal point on the scale between the extreme high level of an animation movie, where everything is predefined, and the extreme low level of a hypothetical ideal AI or A-Life system that only authors the smallest atoms of behaviour and where all results are emergent.

In a realistic present-day situation, building autonomy into your characters boils down to designing a system that allows these characters to choose from a list of pre-defined actions. One side of this problem is the selection mechanism, the other side of this problem is the definition of the actions.

The actions can be be defined on a low level (walk, breathe, wave, pick up) or on a high level (walk to the wall and pick up the key and wave when you’re done). The lower the definition, the more emergent the behaviour is. The higher, the more the behaviour will make sense. The selection system will need to be designed to deal with either one.

Actions defined on a higher level are actually sequences of actions defined on a lower level. So strictly speaking, we could have two selection systems: one to select from a lower level and one from a higher level. These systems could work together or alternately. The latter requires yet another selection system that decides when to apply the lower level, more emergent, behaviour and when the higher level, more defined, behaviour.

Thinking of somebody else

Posted by Michael on May 19th, 2006, in Development

When designing a system for autonomous characters, one is very quick to think about the problem in terms of “How or when or why would I do this or that?” The solution for this problem is then to design a system that can reason along the lines of “When I feel like this, I will do that.” Such a reasoning system can be extremely complex and (perhaps because of that) still lead to rigid, unrealistic behaviour when applied to Non Playing Characters (NPCs).

But the NPC, per definition, does not represent you, the player. The NPC is always somebody else, the other. Therefore, a more appropriate way to think about the problem of representing autonomous characters is in terms of “What is she doing and does that make sense?” The natural empathy that we feel makes us immediately project the behaviour that we are observing onto ourselves and translate what we see to “If I were to do that, would it make sense?”. And to answer this question, we would attach some meaning to what is being done. This whole process of empathy does not need to be programmed! The player will do this automatically. All we need to program is the behaviour of the other person (not ourselves). We do not need to program the reasoning. As long as the behaviour is such that the player can attach some meaning to it. This doesn’t mean that the NPC needs to know this meaning. It only means that the NPC cannot behave in absurd ways. So we just need to design a few rules to avoid completely absurd behaviour. And not a synthetical mind.

Another aspect of thinking of the NPC as another person and not yourself is that we only need to program systems for things that can be perceived by the player. If our output (graphics, animations, sounds) can only express sleeping or fighting, i.e. if our output is boolean, there is no need for a complex system that can reason about the decision to either sleep or fight (such as “if I’m a bit tired but I’m close to an enemy, I will fight anyway unless I’m very lazy or I’m sick” etc). All the player will see is the NPC either sleeping or fighting. Why the NPC starts fighting is something that can be left entirely up to the spectator.
For the system, randomness is sufficient. Something like “If I’m close to an enemy, and random number A equals x, then I’ll fight”. We could refine the system a bit by increasing the probability as the NPC gets closer to the enemy, or by taking any other external context into account (context, in other words, that can be preceived by the player) like aggressive behaviour of the enemy or terrain conditions. But the decision itself will always be random because the reasoning of the NPC can not be expressed anyway.

We do have to add some rules to avoid absurdity. For instance, if our NPC is very tired when he starts to fight, we don’t want him to fall asleep during the battle. So we simply make a rule that the NPC cannot go to his sleeping state when he is in his fighting state. The player, who might be aware of the NPC’s tiredness, would attach meaning to it by thinking of adrenaline rushes, etc. But we do not need to program adrenaline.
We can reduce the build workload and increase the flexibility of these rules by generalising them. E.g. by grouping behaviours according to compatibility, something we have to do anyway to ensure consistent behaviour.

I admit that this is a very unintuitive way of thinking about NPCs. So strong is our inclination to empathize. But we have to force ourselves to think of the other as somebody else. Because we only need to program his or her external behaviour. And we can make up much simpler rules to govern that behaviour than if we needed to program our own (including all the reasoning). As a bonus, we allow the spectator more freedom of interpretation and the game more possibilities of unexpected things happening.