Tuesday, 17 July 2007

Control Switching


This idea of winning and losing control is beginning to fascinate me.
Anne Mini (Author Author) recently blogged of the enormous amounts of inexperienced authors whose protagonists are thrown helplessly from one situation to the next, at the whim of fate or other, never making decisions for themselves. Ricardo made a similar observation about his protags. And we hear McKee's voice: Character is revealed through choices made under pressure.

My son and I watched Raiders of the Lost Ark at the weekend. I had never noticed before how this control shifting dominates the movie. Indy is in control and then he loses control, and this switching flows relentlessly from the start of the movie to the end. And at the heart of these switches, we can see that choices are being made, almost always under the pressure of conflict and high stakes.

As I suggested recently, switching a single peril creates an irony. In this way, something frightening or hazardous might be imbued with humour (which adds dynamic emotional colour). Indy has a few big spiders on his back; his accomplice has dozens of big spiders on his back. Nazi throws Indy through truck window and attempts to crush him against jeep; Indy survives, returns, and throws Nazi through window and Nazi is run over. Bad guy poisons Indy's dates; bad guy's monkey eats dates and dies.

Here are just a few other control switching examples from memory (which should demonstrate the prevalence of this technique):

Indy explores with guides (Indy in control) -> guides betray him (Indy loses control). (Possibly the pinnacle of this occurs when Indy is on the wrong side of the bottomless pit with the golden idol, and his accomplice is on the right side of the pit with the whip.)
Indy bests traps -> boulder rolls after him.
Indy recovers gold idol -> Indy loses gold idol to Belloq.
Indy controls his class -> girl with 'I love you' on eyelids causes him to stutter and lose his flow.
Marion seems to have lost the drinking competition -> Marion recovers.
Marion's competitor appears to have won the drinking contest -> He collapses.
Indy controlled Marion (she was in love with him and he left her) -> Marion controls Indy (she has headpiece and decides to accompany him).
Marion is about to be tortured by Nazi -> Indy saves her.
Indy is pinned to bar with fire approaching his head -> Indy smashes bottle over enemy's head.
Indy is about to be shot -> Marion shoots enemy.
Nazi reaches out and recovers headpiece -> headpiece burns Nazi's hand and Nazi loses headpiece.

This continues right through to the conclusion:
Indy recovers and returns the ark -> Beaurocrats take the ark away to a safe place.
Furthermore, we could even consider Marion's offer of a drink to Indy as a final twist of control.

In this way, we can see a dynamic stream of conflicts snaking through the story with the balance for control ceaselessly shifting (change), which has the effect of keeping the viewer on tenterhooks.
(Btw, as soon as I typed that, I just had to look up the origins of tenterhooks :o)

Note how body language plays a large part in informing the viewer/reader of where the control lies!

Saturday, 14 July 2007

Friday, 13 July 2007

Beneath the Surface

It's E3 week which means that game devs get to release a few more scraps in order to appease fans and keep their games in the public consciousness. (Anticipation no less!)
Here's the first look at my single-player level and I'd be glad to share a few insider tidbits that I'm sure won't compromise my NDA :o)
We build the environments using polygons - meshes that are broken down into triangles.
These polygons are pretty dull, so we assign shaders to them. Shaders are like buckets of pictures and effects. The planks on the bridge, for example, comprise of a colour map (texture maps are projected or 'mapped' onto polygons) and a specular map (shininess) and a normal map which gives a faked 3D effect, lighting pixels such that they appear raised or indented according, in part, to the angle at which they're being viewed. Also in the shader, we assign material properties. In this way, the engine will respond with the correct effect when the polygons are shot at (so that wood chips fly off when wood is shot, and little clouds of dust puff up when dirt is shot at). Also, this property is used to discern the appropriate sound effects: so, for example, a player walking on a metal gangway will hear metallic footsteps.
The environment itself is static. However, we add props, and many of these are destructible and/or movable. Having built the bridge into the background, I then removed the railings into a discrete file. In addition to the undamaged railings, I broke up the geometry and created a replica of the railings from broken lengths of wood. When the railings are hit, the whole version is instantly replaced by the broken version, and pieces of wood explode apart. Each broken piece of wood is surrounded by an invisible physics object which is a cheap way of detecting collison, and from which the physics properties are determined: in this instance, I set the physics bodies to 'wood' so that the engine knows how these pieces should behave. Props are lit dynamically (so that the light behaves appropriately and the shadows move as they move), whereas the background has baked on light and shadows (called a lightmap).
You can see the hotel lobby in the background. I had to build this three times. These three instances are of different polygon counts and texture sizes and are called LODS (level of detail). In this way, when the player is a long way from the lobby, they will see just a handful of polygons on the horizon. In the pic above, the mid LOD is being drawn. LODS are triggered on and off as the player moves around the map, passing through invisible trigger boxes. As the player moves past the tiki bar, the lobby will be obscured from view; at that moment, they will trigger the change to the highest level of detail mesh so that, when they emerge at the top of the steps, the most detailed lobby is in place, ready for exploration.
All this is necessary in order to keep the visible poly counts below budget and keep the game running at a consistent 30 fps (min).
To this end, we also stream portions of the level in and out as the player moves around the map. Behind the lobby is a hotel courtyard and this is constructed from lots of hotel rooms. Whilst the player is in the pool area above, the courtyard has not been streamed in. However, I created 'dogleg' passageways between the lobby and the courtyard in which the lobby is dumped and the courtyard loaded in. These passageways obsure the view, and create points of no return so that everything behind can safely be discarded. Streaming in this way allows us to move away from loading times! (But it does create a lot of extra work for us artists. Boo.)
Hey, there's loads more in there, but much of it is utterly invisible to the player and only the effects are visible: collison walls create invisible boundaries; HDR settings create dynamic light-dark ranges that are location dependent; nav meshes and movement and defensive tokens are placed to aid the AI and make the NPCs (Non-Player Character) behave in an artificially intelligent and believable manner; portals and occluders control the visibility of various portions of the map; lightblockers hide seams and node naming conventions assign shattering glass properties ...
I guess, just like novels and icebergs, what we perceive is reliant on so much that we don't.

Tuesday, 10 July 2007

A Spider Observation

Ever wondered how a spider spins a web?
Well, I was watching one the other day. I'm reasonably sure it was a garden spider.

1) It began with a Y shape.
2) Then it scampered from the centre of the web to the outside, and then back again.
3) Each time it returned to the centre, it added a section of spiral.
4) After some five minutes, it had all the spokes in place and a central spiral.
5) It then made a very neat spiral from the centre to the outside.
6) Finally, it worked back-and-forth, clockwise then anti-clockwise, filling in little portions of the web.
And the finished thing, created in 15-20 minutes, looked like this:

It reminded me of the golden ratio.