Sunday, November 08, 2009

Magic Systems

One of the reasons I like science fiction better than fantasy is because science fiction obeys its own rules and fantasy doesn't. With that bias in mind, lets talk about magic systems in games.

Most magic systems in games are "prepackaged". You have spells, and they are basically treated the same as guns, grenades, medkits, etc. You have a spell, you point it, you fire it. It's not really very... "magical". It's more... "I-just-bought-a-new-gunical".

Because magic is indistinguishable from guns and medkits, you can treat it in the same way as you would treat guns and medkits. For example, if your game is narrative-heavy, you can simply make anyone not actively an enemy immune to all magic. This is especially obvious in Dragon Age, where you can fill a room with fire but the enemies within won't feel a thing because you haven't talked to them and determined that they are enemies, yet.

Dragon Age doesn't want to have a more complicated or diverse magic system. It doesn't have a simulationist world, why would it have a simulationist magic system?

But for those of us that like some level of immersion, there are three other ways of handling magic.

One is programmatic magic. Programmatic magic is magic which the player builds out of components (such as runes). The upside of programmatic magic is that it's relatively easy to put into your game, so long as all the physical objects and living entities follow the same rules. The downsides are that the clever player will be absurdly overpowered, and that the programming is probably either too simplistic to really get cool magic out of it, or so absurdly complex they might as well be programming the game.

Another is psychic magic. Psychic magic allows the player to direct the spell to do anything within its realm of possibility with great grace. In a tabletop game such as Mage or Nobilis, the player might simply say, "Oh, I summon a soot-covered raven to deliver a message to the high wizard." That's not so easy in a computer game, but you can still get away with allowing the player to direct the spell personally, such as telekinesis spells which allow you to move objects specifically how you like.

The third kind of magic is narrative magic, which basically takes the magic out of the control of the player and makes it... mystical. Semi-predictable. For example, if the player can make wishes of a genie, or summon the spirit of luck, the player might be able to give simple directives, but the effect is controlled by the needs of the story. Since narrative magic doesn't easily fit into a statistical world (even more poorly than psychic magic), it's not very popular. Also, it makes the GM have to do a lot more work, coming up with the exact results of everything.

There's a fourth kind of magic, sort of: passive magic. This is a magic effect that is not controlled by the player to affect the world. An example of passive magic would be an immunity to fire, or the ability to see treasure chests. However, passive magic gets along well with any given other kind of magic, so I won't treat it separately right now.

While narrative magic is the least popular at the moment, I can see it gaining some popularity as we create algorithms for making it work. Plus, it's really the best alternative to psychic magic in a world where the player has to interface using a mouse and keyboard instead of his brain.

As an example, I'll pop back to Star Wars. Play any Star Wars game, and your Jedi is encouraged to buy guns and medkits magic spells. Even though it makes no sense for the setting. Instead, the game would be much better served by a combination of psychic magic and narrative magic.

Now, I'm obviously glossing over some tiny, insignificant little details like how to implement narrative magic. I'll post on that matter soonish, but I'd love to hear your opinions.

Friday, November 06, 2009

Dragon Age Animation

I've done the snarky bit, let's talk a bit more about what went right with Dragon Age.

One of the things I really liked about Dragon Age was the body language. They almost completely avoided the Oblivion dead-man's-stare, especially during cutscenes. This was done partly with generic body language, but also partly with camera tricks. Most people overlook that even if NPCs have realistic body language, if your screen is constantly focused on their face, then the PC has unrealistic body language. Like your avatar is staring with an Oblivion dead-man's-stare.

However, you can't make the camera swing around. That would be very disorienting. Dragon Age instead uses a variety of cuts to give you a more movie-like feel, which I think was a good idea. The two methods combined - camera tricks and body language - combine to make the characters feel a lot more realistic and immersive than previous games, graphically speaking.

There is still a lot of room for improvement, and I think we can expect to see improvement in the next generation of triple-A titles.

One spot that stuck out egregiously was the head turn animation. Probably the most common social animation aside from "generic hand waves 1 and 2", it was the worst animation in the entire game. It revolves the head like it's on a platter, with a constant speed and a sharp-edge start and stop. You can hear the greasy robot blood in the character's veins.

I presume that this animation is the way it is because the "rotate head" function takes an arbitrary angle to rotate to. The engine then either performs a simple rotation or, more likely given the way these engines tend to work, animates a fragment of a larger, linear head rotation animation.

This is a shortcut they should not have taken. The only time an actor rotates their head like this in a movie is when they want to be clear that the character is unnatural and insane. So, no, not a good choice for a major animation nested into every character.

While the engine may have technical limitations that prevent it from running on-the-fly or layered animations, it is still possible to create a selection of rotation animations and either place the targets in the spots where the animations make sense, or slightly rotate the body beneath the head to make it all line up nicely.

Head animations were a big opportunity to distinguish the personalities of the various characters. A normal person, when they turn their head, ducks their chin a bit and blinks. And definitely doesn't have a flat speed with a sharp start and stop. But you can throw in variations to distinguish both characters and moods.

For example, the grumpy witch might not "come out of" the duck-turn, leaving her chin down, glowering askance at you. The insane zealot girl might lead with the top of her head, giving her more of a cuckoolander feel instead of a robotic, "I keeel you in you sleeeep" feel.

Add in some more general head posture animations, and you can give the characters a lot of personality without needing to fully mocap and tweak every scene. In the game as it stands, the difference between mocapped and generic scenes is both striking and distracting.

Now, the head turn isn't the only thing that could use added juice. Right now the body language is still very restricted and limited, with the body itself standing rigidly. Presumably this is to keep the number of required animations down: if everyone can use the same twenty animations, you don't need to make twenty animations for each character. In order to keep them generic, you have to keep the body language from being too communicative.

It's obvious that what we'll need for the next generation of body language is an engine that can synthesize animations on the fly, augmenting the "gross" animations with layered and amped sub-animations to give them more personality.

This would also be useful in fixing of the worst animation remaining: the walk animation.

The walk animation is so bad it is the sole reason I have to play in first person mode. This isn't really a rant against Dragon Age: everyone's walk animations are hideously bad.

First, they're not even vaguely unique. Usually there's only three: woman, man, and big huge dude. Second, they're animated without taking anything else into account.

Sure, it would be nice to have walk animations where the characters actually looked at things, actually stomped when they're angry, actually turn to the person they're talking to. But easier than that, please put in a turning animation.

When I turn left, my walk animation doesn't change even slightly: I revolve seamlessly. When the rest of your game is super-realistic, does that make sense?

I've said it before, and I'll say it again: I would prefer to lose half the graphical quality to double the way it's integrated into the game world. When one aspect of your assets so far outstrips the others, maybe you should stop spending on the excellent asset and shore up the crappy ones.

Unfortunately, to really do it right, we need to have a next-generation engine that allows for arbitrary, layered, on-the-fly animations.

What do you think?

Thursday, November 05, 2009

Dragon Age Early Review

So, I'm playing Dragon Age. It's obviously a very polished game, and I'm enjoying it to some extent, but it really does exemplify all the things I hate about modern RPGs.

The checklist leveling is bad enough, but the developers have the gall to put in quests that require premium content. Put the hooks right in the game. "I need help!" "Oh, I'd love to help you, except I can't. Because I'm not willing to spend extra real-world cash to do something in-game, you assholes. So, yes, I'm a hero, but I can't help you. OH WELL."

No, that doesn't break immersion! NOT AT ALL!

I don't mind you selling additional packs or whatever. But the moment you make them intrude on my experience, you have ripped the guts out of your game and turned it into a pathetic shadow. You have made it impossible for my character to act in character. All while shouting "BEND OVER!" You might as well put a rapping spiky blue hedgehog in the game to shout coca-cola slogans at me. "I'm the real thing, baby! I'm not distracting you, am I?"

It's bad enough that it's basically an MMORPG. That's such a terrible terrible idea right there. Why would you mimic something that's specifically been crippled and neutered when you don't have to? It's such a bad design decision!

The fact that it's as good as it is is a sign of truly stellar assets teams and a solid writing team. Now all they need is some game designers.

I also like the fact that it will cover your characters in blood and you'll do truly gory finishing moves, but they still use "safety underwear". It's like the design team's whole thing was "let's make a game that takes absolutely no risks."

And they did.

Monday, November 02, 2009

Wealth in Massive Games (gedankenexperiment)

There has been a storm of concerned armchair economics gurus that has come out of the woodwork over the past few months. I've become steadily more angry at seeing people trot out tired old theories that show a deep misunderstanding of even the most basic facts about money and wealth.

You can learn more about economics by playing Alpha Centauri than by reading Marx.

But almost all games suffer from an oversimplified economic rule set. This is to avoid getting in the way of whatever the "real" gameplay is. I would like to turn that on its head and theorize a game about economics.

Here are the restrictions:

1) The theoretical game must be massively multiplayer (or massively singleplayer, a'la Spore).

2) It must contain interesting non-economic gameplay (typically, various kinds of killing).

3) The economic rules must emerge from simple fundamentals rather than by complex fiat (IE, no arbitrary money sinks, no specific "B happens if you raise taxes").

4) The game must contain zones, modes, or other variations that change the fundamental rules somewhat to highlight the different economic results that occur when rules change.

5) It must highlight the difference between MONEY and WEALTH.

All the examples I can think of are constructive, rather than the "static state" worlds of WoW or WoW, WoW, or maybe WoW. For example, my first instinct is a space empire game like Masters of Orion, but with far less focus on war and far more focus on the amount of time it takes to travel through space. By having specific resources obtained only from specific star systems, you would be able to stress the costs of shipping this product (or derivatives) all around the empire.

The game would require somewhat arbitrary use of fundamental materials to build products. For example, building an acropolis might require explicitly listed goods in addition to research, time, and labor. These are somewhat arbitrary sinks, but at least they make sense.

The game would also highlight the difference between a new economy and a mature economy as you expand and build up your planets. You could also have "low-traction" zones where travel happens faster, or low-fuel zones where you're forced to stick to light speed in order to make it economically viable...

You have any ideas?

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?