Growing Pains (Part 2 of N), and a screen shot

Just a quick technical update. I am this close to getting near-perfect growing physics. Over the weekend, I finished prototyping yet another approach, and this one is fairly complex although much more principled. I bypass the physics engine’s contact solver almost completely by doing my own collision solving using linear programming. Everything that grows in the game is an axis-aligned 2D square, and everything it may collide with is made of planes (possibly non-axis-aligned). This can be formulated as a linear program to maximize the size of the square, where the variables are simply the square’s radius and center, and each potentially contacting plane contributes constraints to keep the square on one of its sides. There are tons of further details, but that’s the basic idea.

Implementing a Simplex solver in JavaScript was no trivial matter, and there may still be a few bugs in there causing some instability (even with double precision). Performance is a concern, and I’ll need to make some serious optimizations to maintain a decent framerate (there are plenty of opportunities for it though).

I gotta say, I’m getting a little burnt out on perfecting the growth physics, so I think after a day or two more of this I’ll switch gears to another part of the game. Such as, working on the graphics! The talented artist I’m working with sent over some early, non-final work, but I like how it looks in the game already:

That is one determined box guy, ain’t it? Determined to solve some Monday to Friday puzzles. We want to keep the art in vector/polygon form so it’ll scale well, so I need to go directly from SVG to 3D without any rasterizing in between.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s