Friday, October 23, 2009

Moulin Rogue

I thought I was done with Batman, but last night I had a big dream where Moulin Rouge was completely redone with Batman's "Rogue's Gallery". Here's a sampling, the Roxanne melody, redone by various villains. Wheeee!

Crane:
[Treatment]
Will drive you
MAAAAAAAD!

Two-face:
BATMAN!
Maybe I'll rob two banks tonight!
I don't rob them for money,
The coin says if its wrong or if it is right.

BAAAATMAN! Maybe I'll rob two banks tonight!
BATMAN! You'll have to wear your cape throughout the night!

Joker:
My eyes upon your corpse
My hands upon your neck
My lips stretched in a grin
It's more than I can stand! (vicious giggling)

Joker & Two-face:
BAAAAATMAN!

Freeze:
Why did my wiiiiife die?
Frozen eyes caaaan't cry!
Rest, take it easy,
I'll save you as "Freezy",
And please believe me when I say
I love you!

(Psychiatric talk bridge and scattered repeating)

Wednesday, October 14, 2009

The Stuff Simple Games are Made Of

Me Via Twitter: I've been studying relativity! I'd forgotten that it's quite mad. Quantum physics is only a bit more mad. All tutorials skip the hard stuff.

On GChat:
John: What possible use could you have for relativity?

me: I thought maybe the time dilation effects could be an interesting mechanic.
Imagine a chess match where the various parts of the board have different internal clocks.

John: OK, I can see that.
I remember modeling games with non-zero communication propagation times, but never tried tracking local age of units.

me: Well, think about it: the faster you go (the more you advance), the fewer turns you get to take.
It's a built-in negative feedback loop. Choosing the best point will always be a tradeoff.

John: Interesting.
I guess I'm having a hard time imagining the metaphor for a game in which it was so important that you do something on a ship (or conveyance of your choosing) that the tradeoff would become relevant.

me: Yeah, I'm having a bit of a time with that, too.
I'm thinking of throwing in the mass distortion effect, and having some kind of cosmic gravity-ball.
Relativistic pong, maybe.

John: Hmm.
Does relativity guarantee that inertial mass is alway equal to gravitational mass after distortion?

me: I was thinking of ignoring reality just a little.

John: That was actually a legitimate question, not a narrow insinuation, but I will take your answer as I choose.

me: :)

John: I suppose anything with RKV's might benefit from being able to calculate their physical properties.

me: Only to some extent. After about 0.7c, there's not much point. Everything is dead.
Nonviolent relativistic games are all I can come up with.

John: Perhaps interstellar wine shipping?

me: Radioactive material shipping...
Same idea.

John: You need the wine to age a certain number of years before it comes to market, but you want it to be sold as soon as possible?

me: "It was a very good year. Before their sun exploded."

John: Actually, never mind. The math works out that you would always age it locally and then send it as fast as you could.

me: Ah-ah, you're assuming relativistic travel has no effect on the wine.

John: Its true!

me: Winefolk will certainly be able to taste that "space aged" flavor.
Or think they can, at any rate.
"My, did you fly this through a nebula? Excellent nose on it..."

John: Why do I get the impression you'd have a lot more fun writing the NPC's for that game than the game itself?

me: I'm gonna do it.
I'm gonna build a relavitistic wine-merchant game.
And I'm gonna post this conversation to my blog, 'cause I'm a nerd.

John: hehe
Go for it.

Thursday, October 08, 2009

Thinking without language

I have a lot of interest in making adaptive, interesting NPCs. In most cases, this involves making NPCs that are "smart" - that can react to what the user does, what the situation is, no matter how exotic it becomes.

It turns out making NPCs more intelligent isn't actually what we want: we simply want them to seem more intelligent. If they actually are more intelligent, they'll act erratically (from our perspective) and will frequently derail the pacing and plot. This is in addition to making the world more chaotic simply because they take actions without the player's awareness.

So we can either take pains to make intelligent NPCs and then cripple them so they don't get too uppity about it... or we can focus on making them seem more intelligent as they go about their not-so-uppity lives. We want them to have some level of independence, but just enough to adapt to the player, not enough to derail the game.

As it turns out, that level of independence really isn't hard. You can program an NPC with a "tactical" understanding of the game world that the player navigates. Then the NPC can simply "play" this game using the same heuristics we would use to make him play any other tactical game. It doesn't even have to be a very high-level play, since they'll be playing tangentially to the player instead of competitively.

An example of this would be the ever-popular "love triangle" in an RPG. If you have two prospective love interests, it is possible for them to understand the basics of time and interest allocation such that they can figure out who is ahead, who is behind, and how to try to score more interest from the player. They can even work together behind the scenes (not in character) to insure that whoever is behind advances as quickly as possible and whoever is ahead slows down, so there's always tension. This is opposed to how it would normally go, where the player would simply pick the one he (or she) fancies and stick with them until the end of the game.

"Moves" on this playing field could consist of a variety of techniques, from the petty (showing up every time the pair gets some time alone) to the clever (figuring out what styles the player seems to like and dressing in them) to the meta (getting the opportunity to pull the player's ass out of the fire in a combat). The idea is to be somewhat subtle: a small push from the one behind combined with a bit of a snub from the one in front can do wonders, even if those pushes and snubs are not in any kind of romantic way.

This brings me to my second point: language.

Language isn't important. In fact, language is a pain in the ass. The only time you should be concerning yourself with language is when you have NPCs that actually have to communicate concepts. For NPCs that simply have to communicate emotion, language is like using a hammer on a screw. It looks like it should work, but it just isn't the right tool.

Instead, what we want is the subtler patterns of body language and situational language, enhanced by clever use of the camera.

Body language isn't something that can be canned. As most modern engines do not support live animations, this is a technically difficult situation despite the rather small and straightforward nature of the animations. There's no need for inverse kinematics or physics, just a little bit of layered subanimations to adjust the features, the way the head moves, the cant of the shoulders and the curve of the spine. It does have to interact with the world a bit - for example, staring aimlessly off into space only makes sense if there's space in that direction to stare aimlessly off into. Those are minor factors, and aren't exactly going to strain your engine.

The subtleties of animating body language would probably be well worth it, but there are twin dangers here. Scylla is the uncanny valley: an NPC that moves "almost" right will probably be extremely unnerving. It's probably best to exaggerate and overanimate. Charybdis is the emotional levels this requires. Body language may add too much emotion into your NPCs, making your players uncomfortable. Driving the player away because the scene makes him uncomfortable is exactly the opposite of what you want!

Body language is also not the only language you need: you'll also need situational language. Unlike real life, in a game world you can simply create situations at demand. These situations can be crafted to create the kind of emotional situation you want to create, regardless of the body language of the NPCs. For example, if the heuristic decides that the strong, tough-guy character needs to be brought down a peg to be liked by the player, the heuristic can simply make the next encounter a surprise encounter where tough-guy gets the worst of it (and, of course, reacts in-character: this assumes your characters are always reacting, unlike most RPG battles where the characters simply step forward, take their action, and step back).

Situational language is our "crutch": because simple body language can't communicate concepts very well, we can use situations to gently say things that fall outside the limits of body language (such as "she's willing to sacrifice honor for fairness" or "he's willing to kill to protect you" or whatever). These are the concepts we would really like to convey through our adaptive NPCs, the concepts that make the NPCs really come alive in more than just a moment-to-moment way. And it's actually stronger to communicate them through a custom situation than through any conversation... so don't bother with language!

What do you think?