Monthly Archives: June 2012

Oscillators part 2

Well, I was wrong about my simple harmonic oscillator (SHO). It’s just an oscillator. But why?

A simple harmonic oscillator experiences a restoring force proportional to distance. For instance, a mass hanging on a spring is a simple harmonic oscillator because the force the mass feels is directly proportional to its distance from some resting position. The farther down you pull the mass, the greater the force the spring will apply to the mass. In other words, the harder you yank on a spring, the harder it yanks back. The same isn’t true for the experiment I created. It doesn’t matter how high the cube is from the ground, it feels the same force of gravity. So, it’s an oscillator, just not a SHO.

But a lot of good has come out of this mistake. It actually generated a nice discussion on reddit, in which it seems we figured out that the cube is being damped in a slightly odd way.

Even if the physics in Source don’t perfectly mimic real life, running experiments gives students a chance to apply what they’ve learned to identify discrepancies. Asking, “what’s wrong with this picture?” is just as valid a lab question as any other. Answering it requires a strong working knowledge of actual physics, a good experiment, and thorough data analysis.



Gravity shows up a lot everywhere. We can calculate it using experiments in the game engine, but we run into some difficulties because of friction. And given that we can’t ascertain the effects of friction off-hand in a virtual environment, we have to look into the game engine itself to figure out the strength of gravity.

According to Valve’s wiki, gravity is automatically set to 600 u/s2. Their units, however, are different than the ones I’ve been using. As you may recall from previous videos, I’m calling each wall panel 1 unit. In reality, each wall panel is made of 128×128 game units.

Doing a little bit of conversion, we get

600u / 128u/panel = 4.6875 panels (which easily rounds to 4.7 panels). So, gravity is automatically set to 4.7 panels/s2.

But what’s a panel to us? How does that compare to the real world? Luckily, Valve went ahead and gave us a convenient conversion chart.

According to the chart, 128 units = 2.4 m.

4.7 panels * 2.4 m/panel = 11.25 m.

Inside Portal 2 (and every other game that runs on Source), g = 11.25 m/s2

To put it in more scientific terms gSource = 1.15gEarth

It sounds weird, but it isn’t surprising. Other game engines have similar tricks, such as the Unreal Engine 2004 running time at 110% speed. Maybe it makes games seem more realistic? Not sure, but it’d be a good question for a psychologist.

Timing and Momentum Flings

In one of my lesson plans, I challenge students to build a level in which they have to use perfect timing to catch a cube that’s launched with a momentum fling. The simpler the setup, the better. Here’s an example of such a level.

Of course, the math behind a momentum fling is pretty easy. Making the catch is all about putting the moving platform in the right place at the right time.

I’ll be reusing this level for an upcoming video on the effects of friction in Portal 2.

Games for Change

1st note:

Check it out! Valve talked about me in their Games for Change talk (especially around 6:57, 17:00, 25:30, and 27:40)!

2nd note:

If you found this blog through Games for Change, welcome! It’s good to have you! I’ll hopefully post another video later today that will demonstrate a lesson plan using momentum flings.

Teach with Portals

Valve’s Teach with Portals website is now live! I highly recommend checking out the lesson plan section. If you go there now, you’ll find some physics lesson plans written by yours truly! Check them out and let me know what you think!

%d bloggers like this: