Change is on the horizon

November 13th, 2013 § 0 comments

I mentioned in my previous post that I was struggling to think of how to make a game about chaining explosions fun, when all the player really does is just click and watch things play out. There’s not enough… interaction. Well, I decided to add a ball that the player can knock around! (I sorta stole this idea from a friend, but whatever, that’s fine, right?) The ball itself doesn’t really serve a purpose, yet. I’m either going to allow the ball to trigger explosions on its own, or I’m going to add some sort of Goal for the ball to reach, or both. I’m also considering turning the game into a Rube-Goldberg Machine solver, like The Incredible Machine (one of my favorite classic PC game series!), only with a focus on explosions.

At any rate, on first attempt, the ball seemed to feel pretty good. I think I’m onto something there. But! – and it’s a pretty big “but” – the ball tunnels right through any walls I set up, once it reaches a high enough velocity. This is a common problem in physics programming when using discrete collision detection. That is, physics advances at a fixed time step, and at each step, we check if any given object is colliding with another object. If the object is moving fast enough and/or the fixed time step is too far apart, an object A could potentially cross from one side of an object B to the other side, without ever actually colliding. I was aware of this going in.

So, I grabbed the handy-dandy drop-down menu in Unity’s Rigidbody component editor and selected continuous collision detection! Except… the problem persists. Continuous collision detection works a bit differently than discrete, in that it determines the collisions before actually moving the objects by using the known position/velocity/etc. of said objects and calculating the first point of contact. Basically, anyway. So, it should work, but doesn’t. Unity (or, I guess, PhysX) also has a continuous dynamic option, which is supposed to work even better, though I’m not as informed on the Why. Except… the problem persists. So, I’m a bit distraught. In a game featuring explosions, I sort of need fast moving objects.

In other news, Unity 4.3 is out! So I’m taking a break from trying to fix the physics, and am instead focusing on updating the project to use the new native 2D stuff. Hopefully Box2D’s continuous collision detection works better than PhysX’s. I guess we’ll see, huh?

(If it’s not obvious, there’s no new version to try out today. I’m hoping to fully integrate the new native 2D stuff tomorrow!)

Tagged ,

Leave a Reply

Your email address will not be published. Required fields are marked *

What's this?

You are currently reading Change is on the horizon at Twigbits.

meta