Posted by Michael on March 2nd, 2007, in Development
Patrick Dugan will talk a little bit about Drama Princess in his poster session entitled “Comparing First-Generation Drama Engines” on March 8 at the Game Developers Conference in San Francisco. I’m quite curious… 🙂
We will be there as well, presenting the first game to include Drama Princess technology, now called The Path (formerly 144) in the booth of the Benelux Game Initiative (5310 NH).
Posted by Michael on January 19th, 2007, in Development
When humans like each other, they imitate each other unconsciously. When they are walking, they synchronize steps and when they’re standing or sitting, they imitate each other’s pose.
We already have an “auto-inserted” behaviour for actors who like each other: Hang Out. Perhaps Do Like Me should be another that does not need to be explicitly offered by any object but inserted for all actors with whom the object has a good relationship.
Posted by Michael on January 18th, 2007, in Development
Well sort of… 😉
There’s still several systems missing and nothing has been fine-tuned, but the bulk of the design is there. I’m now going to implement Drama Princess in 144 and continue to work on it within that context. It’ll be nice to work with real content instead of all this hypothetical stuff.
It’s a working version of the current system, including a configuration editor and the option to control any of the characters as an avatar. It requires Windows and DirectX 9.0c to run.
Posted by Michael on January 10th, 2007, in Development
When all the decisions are being made about what to do, the Drama Princess actors currently quickly run out of inspiration. The problem is that they can end up in a position where nothing interests them anymore and they cannot get out of it because their filters are very strict about what they like to do and with whom. And since they’re not doing anything, their feelings about the objects don’t change (appart from the very slow decline due to absense).
So I’ll have to lower their standards a bit to get them out of this deadlock.
Previously actors would get bored when they kept interacting with the same object. But now we’ll have to make them get bored with doing nothing as well. The more bored they get, the more tolerant they will be and in the end they will be forced to interact with somebody they don’t like or do something unappealing. Which will hopefully change their parameters a bit, so they don’t get stuck so easily.
Posted by Michael on January 8th, 2007, in Development
At its heart, Drama Princess is an animation selection system. It tells an actor which action to perform from a limited number of actions.
So we start with a whole bunch of actions. The easy way to give an actor autonomy is to continuously pick any of those actions randomly. This leads to behaviour that is only suitable for lunatics.
The behaviour of non-lunatics is not random most of the time. It evolves gradually. To simulate this gradual evolution, we have first put the actions in groups per object. This allows an actor to concentrate on interacting with a particular object, rather than jumping from the flower to the car to the dog.
Next, we have arranged each such group in order of how much you need to like the object to perform the interaction (or how much the object would like that you do a certain thing with it).
By allowing the actor only to do something which is close to the thing he did before, we ensure that the actor doesn’t first kiss the dog and then kicks it with no apparent reason (lunatic behaviour).
At any given moment, the actor will prefer to do things with the same object as before and he will only do something of a similar nature.
If there is no change at all, however, the actor will seem to be obsessive, always doing the same kind of thing with the same object. So we make the actor get bored after a while, which forces him to choose another object to interact with. And to make sure that he doesn’t keep doing the same kind of thing whenever he picks a certain object, we make his feelings for that object change. Since actions are arranged in order of feelings, the range of actions that is available changes when the feelings change.
We cannot randomly change his feelings, however, for that would make him look like a lunatic again.
We can also not change his feelings only based on the action he did before because this leads to jitter, which is virtually the same as no change at all.
These feelings need to shift gradually.
To achieve this we randomly define a target for the actor’s feelings to aspire to. But only once in a while. Whenever the actor interacts with the object, his feeling will change a notch towards the target. As his feelings change, the range of actions changes as well. And since the actions match the feelings, the actor appears to evolve towards liking the object less or more.
Posted by Michael on January 5th, 2007, in Development
This post should probably have been split into several different ones. It deals with problems that showed up after a first implementation of the Emotion Impact system. It may also explain a few basic concepts. And it ends with figuring out how to add lag to the system. But overall it’s one of those streams of consciousness that I don’t expect anyone to actually read. 😉
Posted by Michael on January 5th, 2007, in Development
It’s easy enough for an Avatar to express how he feels about an Actor through actions that the player chooses. But how do we find out how the actor feels about us? Is the actor allowed to engage in interactions with our avatar (as if it were autonomous)?
I guess so. It makes sense. This means that our avatar is broadcasting opportunities just like anybody else. And if we just stand there doing nothing, an actor is bound to come up to us and do something with us.
If, however, this something requires a response, this response would be presented to the player as an opportunity. We can use the Shock mechanic to allow Actors to request a response. Like they already do on each other.
At least if the response is optional. If the actor pushes you hard, e.g., then the avatar has to fall. There’s no choice involved. So there needs to be a system that “orders” your avatar to do things that you didn’t tell it to do. This is no different from how autonomous actors need to respond.
Shock gives Opportunities an Urgency value between 0 and 1. We could say that Opportunities with an Urgency of 1 are automatically chosen, without going through the selection process.
Posted by Michael on January 5th, 2007, in Development
The core of Drama Princess is the combination of
the choice of interactions, based on afffection, and
the effect of these interactions on that affection.
Drama Princess will choose the interaction that best matches the desire of the actor. This desire is a combination of the current affection for the object and the enthusiasm of the actor. When the interaction is done, Drama Princess changes the affection of the actor for the object by comparing the intimacy of the interaction with the affection for the object (with regards to the enthusiasm of the object, if the object is another actor).
If you say these things, it all sounds very plausible. But a first (undoubtedly bug-infested) implementation shows that the translation into mathematical formulas isn’t as “gentle” as the text version of the algorithm. This problem is much bigger and general than anything I can solve on my own (to allow computers to be more vague, less strict) but I do have to work around it. Currently this is done by adding some randomness to the mix. But random is just random. It’s equally strict as a formula, only unpredictable. So the whole thing jitters instead. Which is hardly a solution.
Another way to work around this is lag. Applying a change with lag means that you apply a combination of the previous change and the current change instead of only the current change. This allows for smoother transitions. Perhaps I should use more lag in Drama Princess. But it may not be sufficient.
Ultimately we want the affections of our actors to grow and shrink gently. Extreme changes in affections should be rare and will be interpreted as meaningful by the viewer (they would be the result of a shock, for instance). This is the main reason why Drama Princess is designed the way it is. But at first sight, we’re not getting the desired result. Perhaps, rather than tweaking our robots so they behave more like we expected, we should first take a good look at what we’re doing and what we want.
We want smooth emotional transitions. Perhaps the system we have designed (in particular the affection changing routine) is too strict and factual. Rather than trying to do things like
if the Object is an Actor
-if the difference between Intimacy and Affection is larger than (a fraction of) the Enthusiasm of the Object
--reverse desired effect:
---if Attitude is positive, Affection decreases
---else, Affection increases
-else
--confirm desired effect:
---if Attitude is positive, Affection increases
---else, Affection decreases
else
-if Object is inanimate (i.e. does not have Enthusiasm), Affection will get better if you do something nice, and vice versa)
--if Intimacy is greater than Affection
---Affection increases
--else
---Affection decreases
(literal quote from the Drama Princess development wiki)
perhaps we should find a way to say something like
increase the affection slightly if you did something sort of nice and decrease it slightly if you did something that was really bad.
So don’t compare things too much. Just take them for what they are.
Unless you really dislike the object. Then you should say the opposite
decrease the affection slightly if you did something sort of bad and increase it slightly if you did something that was really good.
But only if you really really dislike the object.
The problem with math -unless you use something insanely complex like fuzzy logic (that I just can’t wrap my brain around)- is that there always needs to be a break off point: e.g.
affection below -0.5 is considered dislike.
So -0.4 is still ok and -0.6 is really bad. This destroys the smoothness of our transitions.
Up until now, I have tried to use gliding scales to solve this. Something like
the closer to the break off point, the less likely a severe impact will be
or something. But this doesn’t seem satisfactory anymore. It’s just too mathematical. Too precise. Not gentle enough. Smoothness seems to be an exception with such an algorithm while jitter is the rule. The opposite of what we want.
One of the problems is that Attitude (= whether or not the actor wants to improve the relationship) is too strict. Currently Attitude is generated on the fly based on Affection. It is more likely to be positive if the affection is positive and more likely to be negative if the affection is negative. And when the affection is neither here nor there, Attitude becomes more random. The “more likely” part is expressed by comparing a random number with a fixed number and this doesn’t seem like a good idea anymore.
Attitude should be more consistent.
It needs to be expressed as either positive or negative because this allows for choices regarding an intention to improve a relationship or not. Which is important for consistency. But a switch between positive or negative shouldn’t be made lightly. Perhaps Attitude can be stored internally as a range. Like a health bar in a video game: you’re still alive as long as your health is not completely down, and every hit only decreases it a bit. As long as you “have health”, your Attitude is positive. But the attitude bar, unlike the health bar, should continue in the negative as well.
Anyway, this is only one part of the problem.
The real question is
Should we throw out some of emotion metaphor and replace it by more formal, abstract systems that simply garantee smoothness?
The emotion and relationship metaphor may be confusing things. After all, our goal is not to build a simulator (of emotions in the actor) but rather a generator (of emotions in the viewer)!
Posted by Michael on January 4th, 2007, in Development
Drama Princess chooses a goal out of all the opportunities in the game world by filtering the list of opportunities through various parameters. One of the more important filters is to choose the opportunities that are most compatible with the relationship that the actor has with the object that offers the opportunity (“Filter of Intimacy”). This way, the actor doesn’t start kissing a character that they kicked previously (or at least it’s very unlikely ;)).
All opportunities have an Intimacy level that expresses which type of relationship is required to choose this opportunity as a goal. This way, they get arranged in order: from interactions suitable for enemies all the way up to interactions suitable for lovers. When dealing with the extreme emotions, it’s fairly easy to say what relationship the interaction suits (as in the kicking or kissing example above). But when the interactions are somewhat neutral, it’s hard to match them up. Does sitting on a bench require a better relationship with it than lying on it? Or sitting on a chair? Intimacy values for neutral interactions are more or less arbitrary and shouldn’t be taken as seriously by the Filter of Intimacy as the interactions that do explicitly require love or hate.
When the Intimacy value of opportunities is extreme, the Filter of Intimacy will require a better match with the affection that the actor feels for the object. The closer the Intimacy gets to neutral, the more loose the match is allowed to be.
Posted by Michael on December 20th, 2006, in Development
I was working on the Decision System and implemented The Endless Forest‘s Action Strip to show pictures for representing the Opportunities in the list that was filtered by the Filter of Distance. Then I made the pictures clickable so the player could choose a Goal for the Actor. It’s surprising to experience how much fun just telling a character where to go is. And to sit there and wonder what it will “think” of to do next. Avatars izz teh cool! 8) Autonomous characters are overrated. 😉