## True Bullets?

Posted in: Velocity Raptor | May 7, 2012 | 2 Comments

Thanks to the fine folks over at the xkcd fora, I’m happy to annouce I was wrong about the bullets in Velocity Raptor. I’m even happier to announce that the ‘measured’ bullets have been fixed.

They had been drawn in a way that slanted the bullets away from their true path. Given the argument outlined in April 30th’s post, I thought this was fine. I thought, in fact, it was a demonstration of the Thomas Rotation.

But it turns out this just wasn’t the case. The error in my thought process was that I had LEFT OUT the Thomas Rotation. Two boosts added together can make a boost + rotation. I thought the rotation sprang from my code naturally. But it didn’t. I needed to add that rotation in by hand.

Look how much happier Velocity Raptor is!

So thanks to everyone who brought it to my attention. The ‘measured’ bullets are now fixed in the game. Go enjoy the (now slightly-less) trippy world of Special Relativity.

*-Andy*

## What’s up with the bullets?

Posted in: Velocity Raptor | April 30, 2012 | No Comments

That is undoubtedly the most common question about Velocity Raptor. As it turns out, I was wrong. Read the above post for more info…

~~ That is undoubtedly the most common question about Velocity Raptor. And, admittedly, it is counterintuitive. Extremely so. Even and especially for people with a relativity course under their belts. (When I was making the game, it took me a lot of double-checking to feel comfortable with it.) But… we have to listen to the math. We can’t do relativity by intuition alone.~~

~~I mention this explanation in the Relativity 101 page, but I think these pictures, and elaboration, could help make the situation clearer.~~

~~To understand the behavior of the bullets, we just need one starting point: Length Contraction. If a train is speeding past, a stationary observer would measure it to be shorter than the same train when stationary. And the length contracts in the direction of the motion (the train seems shorter from engine to caboose, not from top to bottom). Not a hard pill to swallow.~~

~~As a concrete example about the motion of bullets in the game, we turn to Level 7. Our intrepid hero (Velocity Raptor) finds herself in a room with a cannon. The cannon is firing bullets horizontally across the screen, whereupon they hit a target. VR also decides to run up (vertically upwards on the screen). So we have three frames of reference.~~

~~That of the Raptor~~~~That of the Room, gun, and target~~~~That of the bullets~~

~~ We’ll want to make sure to treat them each independently. For the purposes of this game, we are witnessing the world through the raptor’s frame of reference. So we need to figure out how (a) the room, and (b) the bullets will contract. Let’s start with the room.~~

~~Since the raptor is running upwards, to her the room seems to be going down. The direction of relative motion is vertical, so the Length Contraction happens vertically as well. The result is the room seems squished from top-to-bottom. Not a big surprise there.~~

~~In the exact same way, we can figure out how the bullets will behave. This time, there are two velocities to take into account. The raptor is running up, and the bullets are flying to the right. So in the view of the raptor, the bullets have a velocity that is down-and-to-the-right. Note that we are being extremely qualitative. Velocity addition in SR is more nuanced than in the standard Newtonian world, but all we care about is that the bullets seem (to the raptor) to be going down and to the right. For ease of our picture, imagine that we’ve chosen the velocities such that the final summed velocity points from one corner of the dotted-line-rectangle to the other.~~

~~Then we squish the bullets’ frame along its direction of motion. So in our example, we squish from one corner to the other. (That dotted rectangle around the bullets just helps us keep track of how the frame contracts. You can even pretend it is real, if you’d like… its addition doesn’t affect the results, just makes the picture clearer.)~~

~~Again, just a simple Length Contraction. Nothing special. So why did I pretend this was strange?~~

~~Ah yes, the final step. Let’s put all the pieces together. The raptor, room, and bullets of course exist together.~~

~~And there you have our result. The room is squished in one direction, the bullets in another, and thus the bullets are no longer sitting on a horizontal path across the screen. The cannon (where we know the bullets are starting) and the target (where we know the bullets are ending) lie along a perfectly horizontal line. But the bullets do not. They are sitting on a path aimed up and to the right. At an angle. So you won’t always find the bullets (seemingly) directly between the cannon and the target. In fact, depending on where the raptor stands, she may even see the bullets as emerging at a point distinct from the cannon… and disappearing at a point distinct from the target.~~

~~But remember, we didn’t do anything special. No magic, no tricks. Just boring old Length Contraction.~~

~~We have, in fact, rediscovered a known fact with our pictures. Two Lorentz boosts in non-parallel directions (aka combining the raptor’s motion and the bullets’ motion) together make not just another Lorentz boost, but also a rotation. Hence why the bullets don’t just seem squished, but also rotated.~~

~~Counterintuitive? Sure! But what good result in physics isn’t?~~

~~*Did you find a mistake in the steps? I’d love to hear about it. After all, in science, we must always reserve the right to be wrong ðŸ˜‰~~

Post a Comment

## The Electric Field Mystery, part 1

Posted in: Electric Shocktopus, Lesson Time! | August 11, 2015 | No Comments

**T**he forums were quiet.

*…too quiet.*

**I**n this neck of the woods, Andy knew that meant trouble was brewing.Â It was then thatÂ A Random Player walked into the room with a problem.Â And that problem’s name was Shocktopus.

.Â Â Â Â **So I heard you made a game about electric fields**.

.Â Â Â Â **That’s right**, Andy said, looking up from the line of impeccably tilted test tubes that covered his desk.

.Â Â Â Â **And I heard the game is scientifically accurate**.

.Â Â Â Â **Well, aside from the questionable marine biÂ Â ology, I sure aim for it to be**, Andy said cautiously, memories of Velocity Raptor’s bullet-conundrum swirling like a mist in the back of his head.

.Â Â Â Â **Then how do you explain *this*?** Random said, throwing a picture down on the desk:

**A**ndy had seen volcanoes before… and they never looked like this.Â There was nothing on the top of the screen, but there was an electric field emanating from it.

**T**hat was five nights ago, and Andy had been hitting the pavement ever since.Â Looking for clues in a town full of shadows.Â Where did he go wrong? Was this a bug?Â Or worse: not a bug?Â Either way, he knew that an understanding wouldn’t come easy.Â Where did all this trouble begin?Â Oh yes, with the Relaxation Method, which, as it turned out, was anything but.

**The Case of the Relaxation Method**

**B**ack when he first started out as a gumshoe – programing the first prototypes of The Electric Shocktopus, the world was a simple place.Â Electric fields were easy to come by, so long as you knew how solve a simple equation.Â And with a computer at his fingertips, solving equations was one thing Andy could do.Â Find all the electric charges in a level, find where the Shocktopus is, and you’ve found yourself the force.Â Perfect forces.Â Perfectly easy.

**B**ut, like all things in life, it was simple precisely up until the point when it was not.

**A**nd that point was when Andy took on the case of a grounded Conductor (who, incidentally, had been sent to the sleeper car without his supper).Â As Andy pieced together the puzzle, he realized that you couldn’t just add conductors into The Electric Shocktopus.Â There’s no simple rule for figuring out the forces, then.Â No easy equation to solve.Â For the fields affect the charges in the conductor, just as the charges in the conductor affect the fields.Â You may as well try to track down a criminal who knows you’re on his tail.Â Each move you make changes which way he’s running.

**B**ut, just like with that criminal.Â There was a solution.Â You just needed boundaries.Â Walls, gates… or in this case, an electrified fence would do the trick.

**I**f you’ve got a conductor all around the outside of your level, you’ve got a way to hunt down the electric field.Â It’s called the Relaxation Method.Â And just like playing a game of cat-and-mouse, it involves a lot of guessing.Â But with each guess, you get closer to the criminal.Â Or closer to the final, true electric field.

**T**here’s only one problem.Â By putting a ring of conductors up, you’ve changed things.

**S**o, how can you put up a ring of conductors around the level, while at the same time not having them affect the level?Â In all his years watching crooks melt into the shadows, Andy knew that everything leaves a trace.Â Footprints. Cigarette ash. Or warped electric fields.

**B**ut there had to be a way.Â And Andy had to find it.

*To be continued…*

## To Another Dimension!

Posted in: Gravity Simulator, Lesson Time! | May 21, 2014 | No Comments

One of the new visitors to the forums brought up a neat topic the other day: Dimensions. Namely, what would gravity look like, if instead of 3 spatial dimensions, we had 2? Or 4? Whoa.

I’ve talked about something similar before with the Electric Shocktopus, but this topic warrants **more**.Â And it needs some swanky gifs from the new Gravity Simulator.

**3D**

Let’s start off simple.Â The world we live in, for all practical purposes, is in three spatial dimensions.Â You can go up-down, left-right, or forward-backward.Â And in this world, Newton’s Law of Universal Gravitation tells us that two objects with mass will attract each other, according to:

If you only care about the distance, the force goes as 1/R^2, which is why we call this an inverse-squared law.Â Double the distance between the earth and the sun, and gravity will pull them together with 1/4 the strength.Â Inverse square laws are beautiful, because they lead to cool things like closed and stable orbits.

All GREAT things for life!

Unfortunately, Newton’s Law of Gravity can’t help us when we’re in a world with a different number of dimensions.Â The law only works in 3D.

**Gauss’s Law**

Instead, our starting point instead is Gauss’s Law.Â Take a point mass, make an imaginary spherical surface around it.Â Imagine that instead of gravity, the point mass is just shooting out 100 bullets in random directions.

How many bullets pass through the sphere around the point mass?Â No matter how big or small you make your sphere, the answer will always be 100.Â That’s the core of Gauss’s Law.Â The number of bullets passing through a sphere doesn’t depend on its radius.Â When we’re talking about gravity, the bullets represent the Flux, which is simply the strength of gravity times the area of your sphere.

So then:

If the total flux is always the same, that means the Force of Gravity is proportional to 1/(Total Area of a Sphere).Â In 3D, a sphere has a surface area of 4PI*R^2.Â So the Force goes as the inverse of that, or 1/R^2.

**2D**

Suppose we were like the Flatlanders, and lived on a 2D plane.Â We could move forward-backward and left-right, but not up-down.Â How would that change gravity?

Well, Gauss’s Law still holds.Â But this time our ‘sphere’ that we draw around the point mass is actually just a circle.Â (Remember, we can’t leave our 2D surface!)Â The ‘surface area’ of the circle is just its circumference: 2PI*R.Â Which means that the Force of Gravity goes as 1/R.Â And we get orbits that look like this:

**4D**

What if there were an extra dimension?Â Suppose we lived in a world where we could move up-down, left-right, forward-backward, and… and… uh… 4Up-4Down.Â We don’t have a word for those last two of course, since we never move through a fourth spatial dimension.Â But nonetheless, we are armed with all the information we need to figure out how gravity would look.

This time the ‘sphere’ we make around a point charge is in 4D, which is hard to draw, but we can figure out what it must be like with a simple pattern.Â In 2D, the ‘surface’ of a sphere is a line.Â In 3D, the ‘surface’ of a sphere is an area.Â So in 4D the ‘surface’ of a sphere should be a volume.Â Its units should be length cubed.Â No surprise, then, that the surface ‘area’ of the 4D sphere is 2*PI^2*R^3.Â Which means that the Force of Gravity must go as 1/R^3.Â So we get orbits like this:

**Beyond**

You’ve now got everything you need to ponder the force of gravity in any number of dimensions.Â And with the Gravity Simulator, you can check out what any of these worlds might look like.Â Try to make a 5D solar system, I challenge you!

This was just a quick introduction to some interesting topics — so if you wanna know more, there are plenty of resources out there you can use.

*-Andy*

## TestTube Lesson: ‘Seen’ Distances

Posted in: Physics Lessons, Velocity Raptor | May 19, 2013 | 2 Comments

I just got a great question about Special Relativity. (And I imagine this might kick off a series, so do ask any physics questions prompted by the games/point out cool physics you come across)

**The Problem**

A player (‘BARP’) commented on a previous post, wondering:

“In the seen view of VR, the room shrinks/gets closer behind the raptor. But light should take longer to reach the raptor from behind him, so the view behind the raptor should be stretched out.”

So what’s up?Â A great question, and since it cuts to the core of the ‘Seen’ view (and requires some images) I thought I’d answer it in post form.Â If you haven’t played Velocity Raptor yet, do that first.Â This post will make a lot more sense once you reach level 25.

The basis for the ‘Seen’ view is that when you see something, the light from it didn’t reach your eyes instantly.Â Light travels fast, sure, but it takes time to reach you.Â So when you look at a star that’s many light-years away, you’re seeing it as it was many years ago.Â In Velocity Raptor, with slower light, you notice this even with nearby objects.

The commenter makes a perfectly intuitive point.Â If the light from an object takes longer to reach you, it would make sense that the object appears further away.Â The light from the moon takes longer to reach you than the light from your computer monitor, and it certainly appears further away.Â When you (as Velocity Raptor) are running away from, say, the left hand wall, there’s some extra lag for the light to reach you (check out Level 26, and keep the Doppler shift firmly in mind).Â So shouldn’t the wall appear further away?Â And yet on the screen, it appears much closer to you.

**Why that doesn’t happen**

It turns out that how far away an object appears to be doesn’t depend at all on how long the photons have been traveling towards you.Â Truly, your eyes can’t detect the ‘age’ of a photon.Â All your eyes detect are things like the color, and the angle the light is coming from.Â It’s that second one that tells our brain how big an object appears…

**What’s really going on**

You can think of your eye like a pinhole camera.Â Light rays from an object come in and get projected on the back wall (aka your retina).Â The closer — or bigger — an object is, the bigger the image on your retina.

When the raptor is running away from the wall, the eyeball is now moving *away* from the incoming light.Â That means the light that enters the eye has to travel further before it reaches the retina.

In the bottom image, the dotted-line box shows where the camera **was **when the light passed through the pinhole.Â The solid box shows where the camera **is** when the light finally hits the retina.Â It keeps the same angle of attack the whole time, but has longer to spread out, and makes a bigger image on the retina.Â Thus, the wall appears bigger.Â (Keep in mind that we *should* take length contraction into account… but that ends up being a second order issue.Â The effect I’ve described exists with or without length contraction.)Â This explanation, by the way, relies heavily on the great site spacetimetravel.org, which you should definitely check out if you want to learn more.

**Now in 3D!**

The question remains… does that mean the wall is closer, or does it mean the wall is bigger?Â If Velocity Raptor were from a first-person perspective (like A Slower Speed of Light), it wouldn’t make a big difference.Â In such a game you don’t see the distance of objects.Â An object could be small, or it could be far away.Â But with the bird’s-eye-perspective in Velocity Raptor, the distance needs to be drawn right on the screen.

It turns out the wall appears closer, instead of bigger.Â You can think about the true path of an object… if it is traveling in a straight line, you should always see it at some point along that path.Â Imagine standing on train tracks and watching the train race away from you.Â Should it appear bigger (wider and taller) than it is, or closer than it is?Â If it appeared wider, then the train would no longer seem to fit on the tracks.Â The wheels would be spaced to far apart.Â But the contact point of the wheel and the newly-run-over track must appear to be at the same place.Â The photons, after all, are emerging from the same location.Â Thus, the train cannot seem wider, and must seem closer.

So, excellent question, BARP, I hope this helps explain the ‘Seen’ view just a bit.Â Lingering questions/qualms with this explanation?Â Ask away in the comments below.

*-Andy*

## Wednesday Update #2

Posted in: Wednesday Update | December 5, 2012 | 2 Comments

Another full week!

I had a very pleasant surprise this past weekend when I discovered a new review of Agent Higgs.Â You can read it here.Â The final verdict: “Buy it.”Â Heck yeah!

As for my upcoming games, I mentioned last week that I’m putting the quantum game on hold.Â So this week I focused mainly on two other games/simulations.

**EMag:**

First up, the electromagnetism game.Â And there all that quantum work came in quite handy.Â In fact, I was able to transform what existed of the quantum game (a standard 2D platformer) pretty quickly to prototype some levels.Â The basic idea is that your character (and his/her bullets) are electrically charged.Â Of course, this means they attract and repel to certain objects.Â But they are also affected by magnetic fields.Â And it isn’t at all like the basic notion of magnets that gets used all the time in games (yes, magnets can attract and repel, we get it).Â Instead, a moving charge will curve in the field.

I’m looking forward to making some fun levels that make good use of those curving paths.Â As I mentioned, right now it is a 2D platformer… but I’m bouncing some other ideas around.Â Heck, imagine the strange complexities these extra forces would introduce into a game like Cut the Rope.Â Or even your run-of-the-mill space shooter!Â Or EVEN — ah, sorry.Â I get carried away sometimes.

**Evolution:**

Mostly, though, I was working on the evolution simulator.Â How does it simulate evolution, you ask?Â Mutation and Selection.Â You start with a very basic creature (imagine sticks attached to each other with motors).Â It can move, but not well.Â Then it has 6 offspring.Â They are similar to the parent, but have very slight mutations in their bodies and behaviors.Â The siblings compete in a high-stakes footrace.Â The losers are all… sent to a farm somewhere.Â The winner, though, makes 6 new offspring.Â Mutation and Selection.

It is shaping up nicely.Â Just today I was working on the graphics.

Aside from the simulation side of it, I’ve been thinking of ways to make it a bit more of a game.Â So I’m adding in an extra competitive mode. After all, you tenderly create these creatures over hundreds of generations.Â They need to make it out into the real world and interact with one another!Â Â In this extra mode, you can challenge your friends, pitting your creatures against one another in an American-Gladiator style showdown.Â Who can evolve the better beast?Â Well, in a few weeks, you’ll be able to find out!

*-Andy*