Faithfulness and quarreling

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

There’s two things that our Drama Princess actors can’t do yet. They can’t be faithfull to a single person and they can’t quarrel for a moment and make up.

They are programmed to love (or hate) everyone with equal passion and loving one person very much wouldn’t stop them from loving another very much. Perhaps it should. This only really applies to romantic relationships that imply monogamy in most narratives. Other types of love don’t necessarily require faithfullness. At least not for the sake of believabilty. Seeing someone betray their best friend can be interesting to witness. But betraying your romantic interest is not something that should be done lightly. Unless the actor is just that kind of person.
So the highest level of intimacy of a relationship should be treated with care. It would make sense if it wouldn’t be easy for actors to achieve such a relationship with each other. So the chance of doing such interactions should be smaller than doing the others. And when you have reached that point with one character, it should become even harder to reach it with another.
For characters with extreme faithfulness, reaching the highest intimacy with one character, may imply a reduction of that intimacy with another, should it exist. Also, if one actor catches another in the act of betrayal, their relationship should drop instantly if it was very high (this would cause a “Shock”).

Another thing that is problematic is quarreling. Drama Princess actors can like or dislike each other. And they can build up relationships of both love and hate. But they can’t temporarily have a falling out and then get back together. When they start arguing, their relationship is shot and they can only get it back slowly and with luck.
Quarelling is a very interesting interaction, though. It’s kind of like rolling the dice on a relationship. If characters start quarreling, the outcome can be one of two things: either they make up and their relationship becomes a lot stronger. Or they don’t and their relationship becomes a lot weaker.
So perhaps “quarrel with me” should be an opportunity offered by a character with a reasonably high level of intimacy. And rather than simply improving the relationship if the Attitude was positive, the system would randomly decide whether the relationship improves or worsens. After which, the characters should express the result by hugging or showing anger.

Attitude is not attention span!

Posted by Michael on July 30th, 2006, in Development

I made a mistake. Attitude is the way an Actor feels about a Relationship: does he want to improve it or worsen it, positive or negative. There’s an Attitude value for each relationship in the game. Attention Span is a property of an Actor. It declines as an actor continues to interact with the same object, reflecting the Actor’s boredom. There’s only one Attention Span for each Actor.

While Attention Span and Attitude work together to modify Fondness when making decisions about choosing an Opportunity, they cannot be folded into one variable because there’s only one Attention Span for each Actor and many Attitudes (one for each relationship).

Oops. 😳

Romanticism vs comfort and the joy of hanging out

Posted by Michael on July 30th, 2006, in Development

This is another stream of consciousness, an account of a thought process that actually arrives at a solution. I’m just using this blog to think “out loud”. As you can tell, it really helps.

Yes, yes, I was young in the 80s... I love it when a plan comes together.

In the first model of Drama Princess, Consumerism, our actors are very selfish. They choose to do the things that give them the most pleasure. In the second model, Romanticism, they prefer to do things with objects that they like and they would choose to do things with these objects that feel comfortable (i.e. that match the relationship that they have with them the best).

The inevitability of having a relatively small set of animations leads to a problem with this, however. When an actor meets a character that he really likes, he will choose to perform the interaction offered by this character that matches their relationship best. The number of interactions offered by this actor will be limited (by the number of animations that we have made and behaviours that we have programmed).

Suppose the character only offers three interactions:

  1. one for when you hate him,
  2. one for when you’re indifferent, and
  3. one for when you like him.

If you like the character, you will choose the third opportunity. But after you’re done, your Fascination with this opportunity will drop to prevent you from repeating yourself. If forced to do another interaction, the next best match would be the opportunity that matches a neutral relationship. And in a third step, you would end up doing the thing that is appropriate when you hate the character. Even though you like him!

This problem can be solved by allowing the characters to do nothing if there is no opportunity that sufficiently matches their relationship.

But what if there is a second object nearby? Say another character that you are fairly indifferent towards. This character also offers three similar opportunities. So you first choose the interaction with the character that you like that feels comfortable. When this opportunity disappears, due to a temporary decline in Fascination, the best match in the area would become the indifferent interaction with the other character. Ergo: rather than hanging around with a character that you like and doing nothing in particular, you would walk over to a character that you don’t care about, to do something with him that is neither here nor there!
If you’re a child you might get away with that kind of behaviour. But for an adult it would look odd.

So it seems like one of Auriea’s and my private one-liners, “It’s not about comfort, baby”, may apply to Drama Princess! 😯

When you like somebody, you want to be around them. Even when there’s nothing in particular that you want to do with them. Just “hanging out” is quite sufficient. Only after some amount of time, you would be inclined to move away to interact with an object that you like a lot less. After which you would return. The latter would already happen in Drama Princess, thanks to Fascination. The only thing we need to add is a way to lock an actor to an object even when they are not interacting with each other.

We already have a value for Attitude. Attitude declines as boredom sets in: each time you interact with the same object, attitude decreases. This allows you to switch to another object when you get bored. Currently, Attitude is maximized, each time you start interacting with a new object. And the inclination to switch to another object -which is what we’re trying to prevent here- increases as you continue to interact with the same object.

Note that as per a later post, the term "attitude" should be replaced by "attention span".

Making the size and speed of the decline of Attitude relative to how good the relationship is, would allow us to differentiate between objects that you like and objects that you don’t: the more you like an object, the longer it would take to get bored with it. Now we need to add a way to actively prevent the actor from switching objects, based on the size of the Attitude, perhaps.

This reminds me of the Urgency attributed to Opportunities offered by objects that are very closeby. If an object is closeby, the urgency of its Opportunities forces them to appear in the final selection of appropriate Opportunities, even if they don’t seem very comfortable. We could expand the Urgency attribute to also take the level of relationship into account, next to distance. And in a similar way: only very close relationships will cause Urgency.

Interesting to see how closeness is used by the same function in both literal and figurative sense. 🙂

This relies on the existence of opportunities. And the limitation in the number of opportunities is exactly what caused our problem. This limitation is caused by the limited amount of animations and behaviours. But if we create opportunities that do not rely on additional animations or behaviours, then the problem is solved!! 😀

So, rather than offering three Opportunities to choose from based on which one matches your relationship best,

  1. one of those Opportunities would only be chosen if they match your relationship well enough
  2. a fourth Opportunity “hang out with me” would be added. “Hang out with me” feels comfortable for all relationships that are sort of good. So even if “kiss me” is a bit too much for your relationship, or if “kiss me” has been done already and you’ve lost your Fascination with it, you would still be able to choose “hang out with me” rather than be forced by the system to go and interact with another object.

And hanging out is nothing more than actors acting out their idle behaviours in each other’s vicinity. Life is good.
Since they are still interacting with each other, the actors’ Attitude will decline. Ultimately boredom will drive them away from each other.

Number of animations versus style

Posted by Michael on July 30th, 2006, in Development

Now that we’re making the animations for our Drama Princess (with the aid of the very talented Laura Smith), I’m starting to worry more about the amount of animations that is required to make a characters seem believable. We have already concluded previously that that amount is relative to the amount of realism in the appearance of the characters. In a more abstracted style, you can get away with less variation in animation and still retain believability. It’s as if everything becomes symbolic and the viewer translates things to reality in his or her imagination.

But for the games that Tale of Tales wants to make and the stories we want to tell, an extremely cartoony style (as in Animal Crossing) is not suitable. Nevertheless due the limitations of technology, budget and time, we will end up with a relatively small set of animations. According to the logic above, this would require us to stylize the look of our characters somehow. Perhaps we can find a way to do this that is compatible with storytelling aspirations…

I’m thinking of film noir and underacting, where the actors are being “cool” and flegmatic for reasons of style. The actors look realistic, but they behave in a stylized way. This particular form of stylization is based on reductionism and minimalism. And not on the exaggeration and caricature that are common in games (and animated films). I’m not sure, however, whether Humphrey Bogart really has a small set of animations or a very large set of very subtle ones.

Come to think of it, to some extent the appearance of the actors in those old Hollywood movies, is in fact not as realistic as one might assume since they are clearly real humans. The abstraction happens on the level of their clothing. As was the fashion of that day, the clothing that people wore was very formal, very stylized. They tend to wear simple suits and modest dresses. They walk with a straight back and their polite behaviour supports the abstraction of their formal appearance. In fact, a lot of the romantic tension comes from the conflict between this controlled comportment and the passions that we know rage inside of them.

So maybe the solution for the animation problem in Drama Princess is to make our actors very polite. 🙂
( They’re starting to sound like children that we need to educate 😉 )

Looking

Posted by Michael on July 27th, 2006, in Development

Having actors look at things in their environment, greatly improves believability. Perhaps a system to do this could be as simple as to trigger a “look at object” action every time an object enters a given radius around the actor (or semi-circle in front of the actor). This would happen both when objects approach the actor as when the actor moves through the environment.

If this starts looking too nervous, or if there are too many objects, perhaps the actor can choose to look at objects that he likes only. Or at objects that he encounters for the very first time (curiousity). And he should probably differentiate between inanimate items and other characters. Objects that approach him will probably also provoke more response than object he approaches (startled).

Shock and suggest with urgency

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

I had made a quick test behaviour of one actor walking up to another actor and forcing the other actor the face him. The latter was done by plainly choosing a behaviour for this other actor. This type of logic may be useful for objects (to force a rock to fall on the floor, e.g.) but an actor should have more control over its own behaviour.

A better way to achieve this would be for the initiating actor to broadcast a “If I’m close to you, face me” opportunity. Then the other actor can decide whether or not he wants to do this.

However, in this case (walking up to an actor), the request to “face me” is quite urgent. Perhaps instead of telling the other actor what to do, a “shock” should be sent to him, forcing him to stop his current behaviour and pick a new one.
In the current design, the other actor would only choose to face you, if he was very fond of you or if facing you is something that feels comfortable. The risk that the other actor chooses another behaviour, with you or with another object, is too big.

To solve this, a Shock should not only startle the actors and force them to change their behaviour randomly. A Shock should be accompanied by a suggestion (in the form of a behaviour ID), accompanied by a gliding urgency value between appropriate and imperative.

Girls and boys

Posted by Michael on July 24th, 2006, in Development

There’s an interesting difference in the general social behaviour of men and women. Women tend to pay more attention to each other and try to achieve some sort of consensus about everything. Men tend to be more confrontational and they leave each other alone more. A woman will look at another woman tying her shoelaces, a man will look away, leaving the other to his or her own business. This is probably why women have received the reputation of babbling all the time. They seem more social in their behaviour. While for men it’s a matter of respect for the other, to not seek so much contact. Women look at each other, men look in the same direction.

To translate this to Drama Princess, opportunities would need to be marked as more feminine or more masculine (or perhaps more or less social and contact-seeking) and the actor would need to know whether it is male or female, so that they can tend to choose things that fit their gender better. Also, more “decorative” actions could be added: female characters can look at other characters more quickly, male characters could try and create a bigger distance from other characters.

When the actor gets very close…

Posted by Michael on July 24th, 2006, in Development

The avatar of the player is also driven by Drama Princess. As such, the actor will also go through the selection process filters to find the most interesting opportunities to do. But rather than making the computer pick one of those, we offer the player an interface to perform this task. In theory this could lead to situations where the player wants his or her avatar to interact with a character that is standing right in front of it, but the opportunities to do this don’t show up because other objects in the environment seem more interesting.

For this reason, the distance factor should weigh heavier on the selection process if the distance is extremely small. This probably applies to both autonomous actors as player-controlled actors. It’s a good idea to remove obects that are too far away early in the selection process. But we should add conditions that make sure that objects that are very close by get VIP treatment.
When doing the distance check, we could flag objects that are very close to ensure that at least one opportunity offered by this object makes it to the final list. Except when this objects offers no suitable opportunities. Or in Drama Princess speak, the Filter of Condition should not care about this VIP treatment. The Filter of Intimacy should pick the opportunities from this object that match the relationship best. And the Filter of Fondness could be skipped for the VIP object.

Main components

Posted by Michael on July 22nd, 2006, in Development

Drama Princess needs to be a reusable system and a system that can be instanced so that multiple characters in a game can use it without having to make multiple copies of the system. For these reasons, amongst others, the system will consist of components that are used by each actor.

For reasons of performance, actors will not call all of their components every frame. But for reasons of simplicity, in what follows we will assume that they do. The order in which the components are called can be important because one component may require information from another. Components will never request information directly from other components but rather read the information from a common location that all components write to. This location is a table with rows for each actor and columns for each parameter.

Broadcast system
Called by each object (including actors) to add all the opportunities for interactions that are available with this object to the global list of opportunities that actors can consult. When objects are busy, they will not call this component, thus preventing actors from trying to interact with them when they cannot be interacted with.
Since the opportunities are behaviours, each of which will be stored in a seperate file (only to be loaded in memory when required by an actor), the list of opportunities could consist of a list of file names (or numerical IDs that represent them -for faster data transfer) accompanied by the originating object’s ID and the opportunity’s intimacy value (can be different for same behaviour with different objects).
Since an object’s list of opportunities never changes, a lot of performance optimisation can be done by reducing the requirement to actively broadcast all the opportunities to the global list of opportunities (and replacing it perhaps by an “include” flag).

Decision system
Each actor will read the global list of opportunities and apply a number of filters to it that gradually reduce the number of opportunities down to one. Each of these filters could be a component on its own.

Behaviour system
When an actor has chosen an opportunity as a goal, it calls the behaviour related to this goal. Each behaviour consists of a sequence of actions. The system evaluates the conditions for each of these actions from top to bottom (the final action of the sequence being at the top) and will execute the first one that evaluates as true.
Behaviours are independent little components that can be shared by multiple objects.
Common behaviours (like “walk to target”) can be reused by other behaviours.

Motion system
Plays skeletal animations of an actor with the aid of an animation blending system that allows for playing multiple animations simultaneously with different priorities and different subsets of bones. The animation blending system of each actor uses animations both form a standard set that comes with the actor and from a special set offered by the behaviour.
A sub-component will take care of facial expressions through morphing. Actors that are far away from the camera do not need to call this component (you wouldn’t see their expressions anyway). The blending of the morph targets will be defined by the behaviour.

Movement system
Changes the position and rotation of the actor according to parameters set by the behaviour and environmental conditions such as collisions and gravity, each of which will be components on their own.
The avatar of the player will also call an “user input” component that will influence movement.

Emotion system
Keeps track of an actor’s relationship and attitude towards an object, and of the fascination with opportunities.
Relationships improve or worsen after interactions and they worsen with seperation. Attitude becomes weaker when interacting with the same object and is reset when a new object is chosen. Attitude can become positive or negative when the relationship is neutral. Fascination drops after an interaction and then slowly increases again.
Relationship, attitude and fascination are key elements in the decision-making process.
(the fact that relationship and attitude direction are shared by both members of the relationship, may complicate matters a bit)

Test 1: Action system

Posted by Michael on July 14th, 2006, in Development

Drama Princess Action System test 1
Drama Princess Action System test 1: press a key to move the pink cone to another spot: the black actor will walk towards the cone, stop when he arrives and start displaying idle behaviour.

This may look like a simplistic test but it is structured to accomodate for the whole Drama Princess system. This structure consists of two main parts: data and engine.

The data part contains the mesh and texture of the actor, animations and Behaviours described as conditional lists of actions. These Behaviours are mini-applications that can contain any form of logic. They communicate with the engine through Interface systems.

The engine part is more elaborate. It consists of a logic system and a draw system.

The Logic System consists of four Manager systems that are applied to each actor in a loop.

  • The Decision Manager will contain the decision making logic and starts new Behaviours.
  • The Behaviour Manager calls the currently active Behaviour.
  • The Motion Manager prepares the animation system for the next frame.
  • And the Movement Manager calculates the position and rotation of the actor based on animation speed and target location.

Interface systems provide for the communication between Managers and Behaviours and each other.

  • The Behaviour Interface takes care of loading Behaviours.
  • The Motion Interface adds and removes animations and contains “shortcut” logic for starting and stopping the walking of an actor.
  • The Actor Interface contains routines for storing Actors’ parameters.

The Draw System consists of the Appearance Manager which draws the actor in 3D space at the correct position with the correct animation.

Download the test executable (3 MB, requires Windows and DirectX 9.0c).