Thursday, October 18, 2012

Gravity and Portals

As you might be able to guess, I've been playing quite a bit of Portal 2 recently.

If you haven't played it, it's a physics-puzzle-based game where you have the ability to create portals on certain surfaces.

These portals act quite a bit like the ones I mentioned in my earlier post, where you could "fold" the two-dimensional world.
But the problem with the portals in the game is that they break the Laws of Thermodynamics. These are a set of rules about how energy works, which can be reduced to this:
  1. You can't get out more than you put in--there's no way to create or destroy energy.
  2. You can't even get back just what you put in--a little bit spreads out into the universe. More subtly, some things are irreversible. If a perpetual motion machine fails because friction keeps turning some energy into heat, you can't put it in a box and extract that heat again in a useful way.
  3. You can't break either of the first two rules. Ever. Under any circumstances. The only way you could do it would be to lower a perfect crystal to absolute zero, and this law says that's impossible*.
*Technically it's possible, but it requires that you do something an infinite number of times, which is rather difficult.

So what happens if you have portals to work with?

You can create energy by teleporting up to a ledge, which gives you more gravitational potential energy. Normally you would have to convert kinetic (motion) energy in order to get up there, which makes up for it. But if you can teleport, then that restriction is gone!

And you can also destroy energy, which should also be impossible. Say you step on a Faith Plate, a catapult-like thing that launches you upwards. The catapult converts potential energy from its battery or power source into kinetic energy, which it then imparts on you. That all works. Let's say you land on a ledge at the top. When you hit the ledge, your energy is transferred to it. Still following the laws.

But what if you place a portal underneath you at the top? Now you're at the bottom again...but where did all the potential energy go? It's just gone!

[Images Pending, Sorry]

But wait a minute.

The third law says that there's no way to break either of the first two. Did we just get around that? Is our test subject freezing to death in a room colder than outer space?

It makes more sense if you look at a two-dimensional Flatlander doing the same thing. Let's turn Flatland on its edge, so that we can see the effects of gravity.

Now, when we make our first portal up to the ledge, what happens?

There's our answer! We didn't actually gain potential energy at all--because when the portal is open, the two places are at exactly the same height!

When we created the portal, we actually lifted up the lower part of the universe, and that's where the energy came from.

And, if our Flatlander jumps off the ledge to use some of that energy, then gravity starts acting strangely...when they're in the "folded" part, there seems to be no gravity at all. That's not what we see in Portal 2, although it might be interesting if we did.

Now, when we close the portal, we open out the universe again, and everything goes back to normal.

So what about the second example? Can we still destroy energy?

As it turns out, no. Let's say we open the portal when our little test subject is at the peak of their trajectory, about to land.

[Images Pending, Sorry]

Since we lifted up half of their world, they didn't lose any energy. Hitting the ground below was the same as if they hadn't used a portal at all.

But when we CLOSE the portal, and set everything back to normal, then there's a release of energy. And since we set down a little bit more than we lifted up (since the Flatlander wasn't in the area we folded the first time), that's where the extra energy goes.

So that makes sense now, although gravity still behaves strangely around portals.

If the test subject jumps off a high platform, hopefully above something soft, then what happens when we open a portal?

Left: what we 3-dimensional beings can see. Right: What it looks like to a test subject.


To us it looks like they fall straight down, but to them gravity has suddenly broken. I've used a bit of hacking to show what it would look like in the video game itself. (This also shows the examples I was talking about.)


Strange, no? I can see why Valve didn't build their game this way. Maybe that portal gun contains a nuclear battery or some other small power source, which can not only provide enough power to fold the universe but which can change the effects of gravity (look at the effect when you hold a cube).

4 comments:

  1. Sorry about the images, guys. Photoshop siddenly decided not to co-operate, but I'll get them up as soon as possible.

    ReplyDelete
  2. Interesting dissection of Valve's game world! I'd like to hear your thoughts on other physics-bending game phenomena, such as Gordon Freeman's gravity gun. The infinite respawning in Team Fortress 2 certainly goes beyond explanation. Don't get me started on the impossibly slow-moving hand grenades in Half-Life (the original).

    Physical oddities in games and fiction in general tend to bug me. It is quite frustrating because all flashy or "cool" depictions of a hero wielding considerably more power than the average human, either via weapon/tool or supernatural ability, violate the second law of thermodynamics. I guess fictional spectacle requires fictional physics.

    ReplyDelete
  3. The Gravity Gun is now on my list of potential topics, right after proving that dragons exist. :)

    ReplyDelete
  4. Interesting post. I never thought of Portal, one of my favorite games, like this. You did a good job of explaining both the game and the physics of it. I am looking forward to more posts.

    ReplyDelete