Reflexes

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

I haven’t been able to compile a little demo as I said I would because of all sorts of administration that required my attention. It’s not so easy to find time for working… Anyway, I’m not even sure if I will be posting many demos at all given the ever increasing file size of the project.

What I’m focussing on now -and hopefully for the next few weeks without interruption- is the animation system. There’s no decision making logic in the project at all yet because I want to make sure that the animation system runs perfectly. This should make authoring and bugfixing a lot easier later.

So now I’m creating the systems that come between the decision making process and the actual animation. This includes idle motion logic as well. And I’m trying to implement a few “reflexes”, such as automatically glancing at another actor when he passes by or looking at an object close by. These “reflexes” are independent of the decision making logic. They just happen due to a simple trigger.
The idea is to make the actors seems as believable as possible without any A.I. to speak of.

Memory

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

Is it a problem that our Actors don’t have a memory?
Or do they?
They develop Affection for every Object in the game world through interaction. This means that if they meet an Object again, they “remember” their Affection for this Object and act accordingly.
Is that enough?
What else would they need a memory for?

Do they need to learn?
Only if we want them to appear intelligent.
But intelligence is not required for believability. It’s ok if they seem a bit stupid -I guess. Perhaps it’s even endearing. And it ensures that the player always feels superior. Which is something we may want to exploit: by allowing the player to “take care” of the virtual characters, to protect them and want to help them.

Sufficiently simple?

Posted by Michael on November 18th, 2006, in Development

Is our Decision System simple enough? Or better: is the logic to choose a goal worth the CPU time compared to a purely random choice? Will that logic make a great enough difference?

If I remember correctly, the main reason why purely random decisions are not believable is because they almost always lead to inconsistent behaviour (making all Actors look like lunatics). For interactions between virtual characters this may be acceptible to some extent (because, thanks to the missing information, we may make up for the lack of logic with our imagination), but when the player interacts with a virtual character, inconsistent behaviour would quickly destroy the illusion. Another problem is robotic behaviour: when the choice is purely random, the chance of the Actor repeating himself is great.

In our system, the first problem is solved by Affection: every Actor has a relationship with every Object in the world and that relationship only changes in small increments. All interactions have an Intimacy value that makes recommendations about which Affection level the interaction is appropriate for. The second problem is solved by Interest: the Actor loses Interest in an interaction immediately after having done it. This Interest grows back slowly, allowing the Actor to do a few other things before repeating the same one again.

The question is: is this convoluted? Or does it only sound convoluted because of the heavy words we use? After all, the Affection system is not much more than a way to keep track of the kind of interaction you did with a certain Object last time and to make sure that you do something that is not too different. And “losing Interest” is even more mechanical.

I guess we can easily test this: it’s easy to set up a system that randomly triggers behaviour. Maybe we should include that in our Behaviour System tests. Then we can observe what randomness leads to and be fully aware of the reasons why it’s not good. With that information we can evaluate the theory of our Decision system and ammend it where appropriate.

Behaviour System

Posted by Michael on November 16th, 2006, in Development

Making diagrams is fun!

When a Goal has been selected, the Drama Princess system calls the Behaviour System. This makes the Actor play animations, move through space and trigger events. If the Decision Sytem is the brain, then the Behaviour System is the body.

Both the Decision System and the Behaviour System are called continuously for each Actor.

A Drama Princess Actor is stupid. He doesn’t know any Behaviours. The Behaviours are offered by the Objects in the game world around him in the form of Opportunities. When an Opportunity is selected by the Decision System as the Goal for the Actor, the Behaviour that corresponds to this Opportunity is loaded into memory. Only then does the Actor know what to do. When a new Goal is selected, the previous Behaviour is ended (if it hasn’t already) and it is replaced by the new Behaviour. The Actor doesn’t remember a thing. He remains an empty shell (that doesn’t take up too much RAM ๐Ÿ˜‰ ).

A Behaviour is a little program that tells the Actor which animations to play, where to move to, what sounds to make, what events to trigger, etcetera. In its simplest form, a behaviour is basically a sequence of animations: “go to the table, pick up the cup, drink, put down the cup”. But it could contain more complex elements too: “find the nearest table” or “pick the cup that has water in it”. And also “reduce the amount of liquid in the cup” or even “make Johny look at me while I drink”, i.e. commands that affects other Objects than the Actor.
Every Behaviour also contains logic to end the Behaviour. This includes conditional logic to end the Behaviour at different moments. To end the “Go Sit down” behaviour while the Actor is still walking towards the chair, all that is needed is a “Stop Walking” command. But if the Actor was already seated, a “Get Up” command would be required. The Decision Manager waits for the Behaviour to end before it gives the Actor a new Goal.

So rather than making general structures in which to fit each behaviour, every Behaviour is a little unit on its own. This allows for infinite flexibility (we hope).

A behaviour can end when it is done, after which the Actor goes back to his Idle state. Or a behaviour can continue infinitely, until some external event forces it to end.

So far, there is one general system: the Look At system. It continuously plays, disregarding whether the Actor is doing a Behaviour or not. It makes the Actor look at certain positions in space. This is expressed as motion of the head. Different systems can tell the Look At system what the target of the Actor’s gaze should be: Shock events, for instance, or Behaviours themselves, or just a random function, to keep the gaze of the Actor moving around.

The movement of the Actor through space (position and rotation) is also defined in the Behaviour. It generally depends on the animation frame or time.

Behaviours can also call each other. The “Go Sit down” behaviour, for instance, starts with calling the “Go To Target” behaviour to move the Actor to the correct position.

The “Idle” behaviour is called when an Actor doesn’t have a Goal. Currently “Idle” consists of a few standing poses, some upper body activities (like scratching or yawning), looking around and some facial animations (blinking and smiling). All of these triggered randomly. I have noticed that there is a lot that you can do with this simple idle behaviour to make the Actor seem more believable. So it’s important to author and fine-tune this idle behaviour as well.

Decision System (version 3)

Posted by Michael on November 15th, 2006, in Development

This is a summary of everything that was discussed previously, plus some improvements.
Some terms have changed: Relationships are expressed as Affection, while Intimacy is only used as a property of Opportunities anymore. The Filter of Comfort has been renamed Filter of Initimacy. And the Filter of Fondness is now called Filter of Affection. Fascination is now called Interest and Attention Span is now simply Attention.

Oh no, it's a diagram

The Drama Princess system chooses a Goal from a list of Opportunities compiled for each Actor. The choice is made by filtering this list with different parameters until a single goal remains.

The list of Opportunities consists mostly of Opportunities offered by Objects in the game world. Objects include the environment, inanimate items and other actors. Opportunities offer behaviours that allow for interaction with an Object. Next to the Opportunities offered by Objects, the Actor himself can add Opportunities to the list in the form of Tasks. These are behaviours that we want the Actor to perform, disregarding the availability of Objects. And lastly, a Shock can add Opportunities to the list. A Shock is usually caused by an unexpected event in the game world. Opportunities added by a Shock are accompanied by an Urgency value.
Every Opportunity has an Initimacy value. This expresses the level of Affection between Actor and Object that is suitable for performing the behaviour. A high Intimacy value of an Opportunity requires a lot of Affection between the Actor and the Object that offers the Opportunity. And vice versa: a stone would offer a “Throw me” Opportunity with very low Intimacy value, e.g. (unless it is a masochist stone ๐Ÿ˜‰ ). As a result an Actor would only throw that stone if he didn’t feel much Affection for it.

These Opportunities are then filtered down to a single one: the Goal. This filtering happens in a precise order, partially for reasons of performance (reduce the size of the list most early). At every level, a degree of randomness is injected to allow for surprise.

Continue…

Better Game Characters by Design (Katherine Isbister)

Posted by Michael on November 14th, 2006, in Books

I have just started reading this book.
I’m a bit annoyed by the school book tone of it. Not just because that way everything gets said twice. But also because it all comes out sounding like fixed rules and facts while a lot that is being said is highly disputable given the young age of the medium. The generalizing observations of the differences between cultures -which is where I’m at now- are on the edge of my ethical tolerance, but perhaps this is a good way to talk about them in the context of game design. After all, I’m all for using clichรƒฦ’ร‚ยฉs. They help communication.

Note from 20 November 2006
I’m stuck on a 30 (sic!) page interview with two Japanese business men discussing the finer details of the thickness of the eyebrows of Ratchet as it pertains to the appeal of the character to the Japanese market, after having disqualified any of their own arguments with the example of a colleague predicting the failure of Pokรƒฦ’ร‚ยฉmon in the US, illustrating the open-mindedness of Japanese kids to any type of character design and a fascination with how conservatism grows with age in humans. But I won’t be victimized by the writer’s My-First-Foreign-Culture (though-not-too-foreign-since-Japan-was-colonized-after-World-War-II-by-my-own-culture-just-like-Iraq-who-will-soon-be-our-friends-too) experience no longer and I’ll skip over this part. That’ll teach them. ๐Ÿ˜ˆ

Note from 11 December 2006
I just learned everything about girls in the chapter on gender! ๐Ÿ™‚ Apparently, when it comes to games, there is only one gender. It’s called female. I had hoped to learn about differences between genders in terms of character design but instead this chapter was a plea to design more games for girls.
I’m getting a bit tired of this constant nagging of female writers about games. It’s very simple to provide for games that appeal to women: make them! Games should be made by women -at least partially. Not just on a design level but also deep in the icky guts of the machine: we need female programmers, female animators, female modellers, etc. Get to work, girls!

Stylised characters

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

I have started a thread on our Game Design Forum about stylised game characters. The current experiments that I’m doing for Drama Princess use fairly realistic models. But I’m jaleous of what games like Animal Crossing can get away with in terms of animation and behaviour.

As we have established before, consistency is of utmost importance for believability: a realistic looking characater that bounces around like a rubber ball is not believable (Prince of Persia), realistic animatitions that get repeated over and over again by many different characters neither (The Sims). So I think that if I reduce the realism of the characters a notch or two, the demands on the Drama Princess engine in terms of believability may be a bit lighter.

Realistic characters in Drama Princess experiment

I’m not interested in going all the way down to cartoon level, however. So the thread mentioned above, is about trying to find examples of stylised character designs that would be suitable for use with a serious topic. If you have any tips or know of any games with stylised characters, please post (either here or in the forum).

A Theory of Fun for Game Design (Raph Koster)

Posted by Michael on November 14th, 2006, in Books

This is a very fun book ๐Ÿ˜€ with alternating text and illustration pages, both executed in a witty entertaining style. Probably quite on purpose given the title of the book.

Raph Koster is a game designer (he worked on Ultima Online and other MMOs). So he knows what he’s talking about. The premise of the whole book is an attempt to convince his grandfather that being a game designer is a worthy profession.

The book makes two important statements, in my opinion. First that fun is all about learning. And second that for games to become a mature and respected medium, they need to produce art.

Mr. Koster speaks of learning is pattern recognition: we enjoy finding patterns in the things that we perceive. When we have discovered the pattern, we get bored and desire new challenges. A game that can offer a continuous stream of such challenges, is fun. It is fun because it teaches us things. As a (in my opinion profound) side note, he suggest a definition of beauty as something that is just a little bit off of being completely recognizable. I do think, however, that he underestimates the severity of an aesthetic experience, defining it as something fleeting, something we always ultimately get bored with.

But while he defines the core of games as being their structure of rules and challenges, he does realize that this core alone is not sufficient for an entertaining experience. This is where he sees the role of narrative, comparing games to dance where the choreography is nothing without dancers and a stage, or music that requires musicians who interpret and play the piece.

When it comes to art and expressiveness, he doesn’t really see a problem with the fact that most games are only about violence, claiming that most art, at its core, is about violence and sex. So all games need to do to become art, is to be a bit more subtle about these topics. He does seem to believe that this subtlety can be achieved by creating smart game structures, in other words by manipulating what he sees as the core of games. He makes an interesting comparison between art and a trellis with plants: humans and their experience are the plants that grow on the trellis, while the trellis itself is the artwork.

No need to say that I don’t agree with this. First of all, I don’t like reducing everything to its base components. Sure, all art is about sex and violence. As much is life is about cells and electricity. But at that level, nothing is meaningful! Depth of experience situates itself in much higher regions. I believe that the core of just about everything is nothing. What matters, what truly matters, is the layer around that core, the skin. This is where meaning happens, where humans can become more than organic machines. Truth is completely irrelevant.

And, as you may know, I have my doubts about the potential of game structures as well. I would love to see these expressive games. But if in the thousands of years that games have existed, no one has succeeded in producing a single art piece, why would they suddenly be able to do so now? There is definitely artistic potential in the the new digital technologies but I believe that we need to create much wider and diverse interactive experiences to get there, and drop the requirement of a game structure.

We’re back!

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

You thought this would become one of the many abandoned AI sites, didn’t you? ๐Ÿ˜‰

Nono. We’re back. We’re done with all the silliness in our lives and can get back to the serious task of building Drama Princesses.

Expect a few posts soon. And some demo software by the end of the month.