Boing!

Publication date: 3 February 2013
Originally published 2012 in Atomic: Maximum Power Computing
Last modified 04-Feb-2013.

 

Around the tenth time something like this happens in a 3D game...

...you might find yourself wondering why it happens.

By "this", I only partly mean this specific situation of backing into a swing-set in Grand Theft Auto IV and then flying the friendly skies, or being smashed down into the ground by a Skyrim giant and then...

...entering low Nirn orbit. (Sound effects not entirely original.)

I mean the general case, in which an object in a 3D game suddenly shoots off at outrageous speed. Bethesda games are particularly prone to this, but they're far from the only games in which opening a door can result in a chair or dinner plate spanging off the wall at Mach 4.

Stuff like this even happens in some non-game physics simulations. It always looks ridiculous, but the alternative can look even more ridiculous.

Few games, you see, have what can fairly be called a realistic physics model. Simulating true Newtonian physics that takes into account the characteristics of many objects simultaneously can use an awful lot of processor time, even if you aren't bouncing any objects off each other. So game physics is simplified, first by not making most things subject to physics at all...

Missed it by _that_ much.

...which is why stuff like this can happen. When someone sits on a chair in a 3D game, they're meant to just rendezvous with the furniture and execute their sitting animation; if they miss the target grossly or...

Skyrim wench almost sitting down

...subtly, the game does not yet have a way of rectifying, or even detecting, the problem.

When objects actually are acted on by the physics engine, it's normal to economise by, for instance, ignoring the concept of elasticity, and making objects indestructible, whether they're a sapphire or a sweetroll.

This leaves object-overlap as the only way the game has to handle things bouncing off other things.

The most obvious symptom of game-physics shortcuts is interpenetrating objects. Whether slight (big shoulder plates on dude's armour clip through his breastplate when he moves his arms...) or...

Boone penetrates a table

Dead guy in Human Revolution penetrates a desk

 

...blatant (dude standing in the middle of a desk with just his torso sticking out, looking like John Malkovich in the 2005 Hitchhiker's Guide movie), it's a clear and shameless violation of the basic physical concept of impenetrability.

Some objects are meant to penetrate other objects, like the arrows to the head that so famously can only mildly bother Skyrim NPCs. But NPCs themselves are not meant to penetrate floors or doors, carrots are not meant to penetrate cooking pots, and...

Car stuck in ground in Saints Row 3

...cars are not meant to penetrate roads.

Yet they sometimes do.

A simple way for this to happen is if an object is moving fast enough that in only one physics-engine clock-tick it goes from being in empty air to being halfway through a wall.

Now the physics engine has a problem. Should the object stay there stuck in the wall? Should it sort of slowly ooze out of the wall, one way or another? (Pick the wrong direction, and a car stuck in the ground will slowly sink out of sight.) Should it just be silently moved back to the last location it had that wasn't halfway through a wall? Or should the problem be left to the tender ministrations of the standard collision code?

That last option is what's responsible for the Skyrim Giant-Assisted Space Program.

Basic 3D-engine collision code uses simple vector arithmetic to determine what objects do when they hit each other. The location of the object is defined by some point within it, and its shape is a simplified invisible geometric region which with any luck roughly corresponds to the apparent shape of the object. After any clock-tick in which two or more objects end up with their invisible shapes overlapping, the location and magnitude of the overlap and the location-points within the objects are used to create new movement vectors for the objects, bouncing them apart. The further objects overlap, the faster they are assumed to have been going when they collided, and the faster they bounce off.

This works well enough until two objects overlap by a lot for some reason other than that one or both of them just hit the other at great speed. There are a variety of other possible reasons for big overlaps in 3D-game environments.

Perhaps a pile of objects is collapsing, and limits on the amount of movement calculation that can be done mean some objects are neglected for a tick or three, just passing through other objects, until the engine notices them again. Perhaps the player just reached into their preposterously huge inventory bag and dropped a rocket-launcher or greatsword or something - which, in engine terms, means that object just spawned from nowhere - into a space too small to hold it. Or perhaps a garage door is closing on a car, and there's no way to make the door stop moving, so the car has to end up overlapping the door, or the ground, or both.

If resolution of this sort of problem is left to collision code, one or more objects are about to blast off like a watermelon seed squeezed between the fingertips of Jehovah.

When a Skyrim giant shoots you into the sky with a killing blow, it's because your dead body was smashed down below ground level. Ancient 3D-game tradition states that what happens then is that you fall into an infinite single-coloured void below the universe...

Falling through the universe in Saints Row 3
(it looks as if I'm not going to be calming that tiger this time...)

...but if the collision code does its thing, quite the opposite happens. Your body gets a massive bounce velocity, straight up.

I don't think this phenomenon was actually something Bethesda meant to happen, but like blinding NPCs by putting a basket on their head, it's so funny that they left it in.

When objects try to de-interpenetrate but fail - because they don't move far enough to avoid bouncing "back" again next clock tick, or just because some other object blocks them - they may make the standard noise they would make when bouncing around the environment, only repeatedly and rapidly. This creates a sort of flapping sound, as if a panicked bird is stuck in a drawer somewhere. This happens fairly often in Oblivion-engine games when a door sweeps open and traps some hapless object between it and a wall.

There are plenty of other games with interpenetrating object problems, including outrageous flight velocities and flappity noises. Quite a few feature in this compilation of Skate 3... occurrences:

And there's a bit of flappity-jiggle in the middle of these Red Orchestra 2 excerpts:

And here, in the same game, is a corpse disentangling itself from the floor in a sub-optimal way, and someone who achieved a Skyrim-like altitude in death:

I think Skyrim tries to fix some of these problems in a sneaky way, by making certain interpenetrating objects pop apart only when the player isn't looking at them. In more than one game, though, I've had objects next to the central fire in every single tavern in Skyrim interpenetrate the second I walk in there, and attempt, but fail, to de-penetrate when I'm looking at the tavern-keeper.

So it's [clank clank clank clank] behind me as I try to talk to the innkeeper, and I turn away from the sales counter to see what the deal is - silence. I turn back... [clank clank clank clank] again. I once had a house with that same poltergeist problem, and it wasn't even the one you'd expect. (I bet other games have the same problem, but are able to detect flapping and, if not stop it, at least mute it.)

Perhaps one day physics engines will simulate everything from elasticity to relativity, and randomly shooting into the air will be about as common a problem as finding new cactus thorns for your phonograph.

In the meantime, at least you can know why putting too many cheese wheels in that basket caused one of them to break the sound barrier.

Other columns

Learning to love depreciation

Overclockers: Get in early!

Stuff I Hate

Why Macs annoy me

USB: It's worth what you pay

"Great product! Doesn't work!"

The virus I want to see

Lies, damned lies and marketing

Unconventional wisdom

How not to e-mail me

Dan's Quick Guide to Memory Effect, You Idiots

Your computer is not alive

What's the point of robot pets?

Learning from spam

Why it doesn't matter whether censorware works

The price of power

The CPU Cooler Snap Judgement Guide

Avoiding electrocution

Video memory mysteries

New ways to be wrong

Clearing the VR hurdles

Not So Super

Do you have a license for that Athlon?

Cool bananas

Getting rid of the disks

LCDs, CRTs, and geese

Filling up the laptop

IMAX computing

Digital couch potatoes, arise!

Invisible miracles

Those darn wires

Wossit cost, then?

PFC decoded

Cheap high-res TV: Forget it.

V-Pr0n

Dan Squints At The Future, Again

The programmable matter revolution

Sounding better

Reality Plus™!

I want my Tidy-Bot!

Less go, more show

In search of stupidity

It's SnitchCam time!

Power struggle

Speakers versus headphones

Getting paid to play

Hurdles on the upgrade path

Hatin' on lithium ion

Wanted: Cheap giant bit barrel

The screen you'll be using tomorrow

Cool gadget. Ten bucks.

Open Sesame!

Absolutely accurate predictions

The truth about everything

Burr walnut computing

Nothing new behind the lens

Do it yourself. Almost.

The quest for physicality

Tool time

Pretty PCs - the quest continues

The USB drive time bomb

Closer to quietness

Stuff You Should Want

The modular car

Dumb smart houses

Enough already with the megapixels

Inching toward the NAS of our dreams

Older than dirt

The Synthetics are coming

Pr0nBack!

Game Over is nigh

The Embarrassingly Easy Case Mod

Dumb then, smart now

Fuel cells - are we there yet?

A PC full of magnets

Knowledge is weakness

One Laptop Per Me

The Land of Wind, Ghosts and Minimised Windows

Things that change, things that don't

Water power

Great interface disasters

Doughnut-shaped universes

Grease and hard drive change

Save me!

Impossible antenna, only $50!

I'm ready for my upgrade

The Great Apathetic Revolution

Protect the Wi-Fi wilderness!

Wi-Fi pirate radio

The benign botnet

Meet the new DRM, same as the old DRM

Your laptop is lying to you

Welcome to super-surveillance

Lemon-fresh power supplies

A>B>C>A!

Internet washing machines, and magic rip-off boxes

GPGPU and the Law of New Features

Are you going to believe me, or your lying eyes?

We're all prisoners of game theory

I think I'm turning cyborg-ese, I really think so

Half an ounce of electrons

Next stop, clay tablets

A bold new computer metaphor

Won't someone PLEASE think of the hard drives?!

Alternate history

From aerial torpedoes to RoboCars

How fast is a hard drive? How long is a piece of string?

"In tonight's episode of Fallout 4..."

How hot is too hot?

Nerd Skill Number One

What'll be free next?

Out: Hot rods. In: Robots.

500 gig per second, if we don't get a flat

No spaceship? No sale.

The shifting goalposts of AI

Steal This Education

Next stop: Hardware piracy

A hundred years of EULAs

The triumph of niceness

The daily grind

Speed kings

Alt-tCRASH

Game crazy

Five trillion bits flying in loose formation

Cannibalise the corpses!

One-note NPCs

Big Brother is watching you play

Have you wasted enough time today?

The newt hits! You die...

Stuck in the foothills

A modest censorship proposal

In Praise of the Fisheye

Filenames.WTF

The death of the manual

Of magic lanterns, and MMORPGs

When you have eliminated the impossible...

Welcome to dream-land

Welcome to my museum

Stomp, don't sprint!

Grinding myself down

Pathfinding to everywhere

A deadly mouse trap

If it looks random, it probably isn't

Identical voices and phantom swords

Boing!

Socialised entertainment

Warfare. Aliens. Car crashes. ENTERTAINMENT!

On the h4xx0ring of p4sswordZ

Seeing past the normal

Science versus SoftRAM

Righteous bits

Random... ish... numbers

I get letters

Money for nothing

Of course you'd download a car. Or a gun!

A comforting lie



Give Dan some money!
(and no-one gets hurt)