p e r s o n a l |
Our first non-physical system
(07 Dec 2010 at 23:05) |
During some spare time this fall I've been porting the physics library Box2D to Standard ML so that I can use it in my quixotic hobby of making video games (in Standard ML, with overly complex technology). I have some debugging now to do, and like with sound software the bugs in physics code are sometimes just really fun or interesting or hilarious. This was pretty much the first behavior that could remotely be described as physical from the porting effort, and to me it is a gem:
What's happening here is the polygon is falling to hit a solid object below it. When it strikes, a force is applied which obviously should make it go tumbling off to the left. I think (I haven't actually tracked down this bug yet, because as soon as I saw this I decided to make something to save animated gifs of bugs because I knew I'd be seeing more and want to save some) that what's happening is some simple sign or winding-order error that causes the angular force to be the opposite of what it should be. So instead of falling over, objects like this one experience the opposite force, which makes them wobble to stand up on their tippy toes, Chumbawumba style. It's remarkably stable. I'm kinda interested now in making some video games where the physics are nearly realistic, except for some fundamental error like this. I think it could be pretty fun to figure out how to move in such worlds with unintuitive but consistent behavior. |
|
|
Sweet. Just in time for another broken-physics Ludum Dare. |
I GET KNOCKED DOWN! |
Game idea: AntiJenga - a game where you struggle to topple a tower of little chunks.
Oh wait, that already exists and is called Angry Birds. |
I think I have tracked your bug down. You forgot the minus sign. |
Nels, did you see the alt-text on the image? |
Chrome is not so good with Alt tags on gifs. I guess? Anyway, I looked at the source and saw it. Niceness! |
I was wondering if you were saying that because of the alt text or if you just independently had the same idea, because the latter would confirm my suspicion that we have similar senses of humor |
Except now I realized that I actually said "Chumbawumba style" in the post, making it not very coincidental. |
|
|