2009/11/24

Engine Prototype 05


This is my fifth prototype of the Dejeweled physics engine. The engine now supports collisions between circles and capsules. This version is simple, with an inefficient method of finding colliding pairs. And objects can pass through each other if they are traveling too fast. But that will all change soon.

This ragdoll is just like the one from Engine Prototype 01, but with a ball to play with. Objects can actually collide now! :D Nifty, eh?

Click the window to start. Then use the arrow keys to move the stick figure around. You can also click and drag the mouse to move the ball, too.

left - rotate left
right - rotate right
up - raise arms
down - spread legs

For slow motion, hold down the space bar. Click the meters to adjust the physics settings.

Let me know if you find anything interesting. ;)

2009/11/20

Engine Screen 05

Finally, some real progress! :)

I've started adding collision detection to the engine. Collision detection is harder than I expected, but not too hard.

So far I've implemented simple circle collisions and capsule collisions, which you can see in the screen shot above. But there's still a long way to go. I still have to take into account the effect of friction and restitution forces. I also have to make sure objects don't pass through each other when they are going really fast, which is probably the biggest problem at this point.

And then of course there's the issue of efficiency. Right now the engine is using a simple brute-force approach to find colliding objects, but that's going to be really slow with a hundred objects on the screen at once. I'm planning on using the Sweep and Prune algorithm to speed that up.

I'll post the next prototype soon. It's already fun to play with. :)

2009/09/24

Engine Prototype 04


This is my fourth prototype of the Dejeweled physics engine. The engine still supports rod, pin, and door constraints, both rigid and springy, but this prototype only makes use of rods and pins.

But there's a lot that you can do with rods and pins. This is an experiment for an interface, to create interesting structures with the mouse. The final game might not use the same interface, but it will probably be similar.

Click the window to start. Then click and drag the mouse to draw and move objects. You can create rods, pin rods to the background, move them, connect them, and delete them.

click and drag - create rod
click on a rod - create pin
drag rod or pin - move rod or pin
drag off screen - delete rod or pin
drag rod onto rod - connect two rods

To pause the simulation, hold down the space bar. Click the meters to adjust the physics settings. The "speed" setting will let you manually adjust the amount of slow motion.

Let me know if you find anything interesting. ;)

2009/09/23

Engine Screen 04

Last time I said you could expect an update every week. I may have to revise that. Maybe not every week. But often enough. :)

I've been working on the next engine prototype, and there's a lot of new stuff along with it. The physics code hasn't changed, but the interface is entirely different.

Instead of a ragdoll to move around, you get to draw lines with the mouse, and move them around and connect them together. What I'm working on now is the ability to pin them to the background so you can make more interesting structures.

Check back soon for the finished prototype!

2009/09/03

Engine Prototype 03


This is my third prototype of the Dejeweled physics engine. Now the engine supports rod, pin, and door constraints, in two flavors: rigid and springy. And believe me, those springy door constraints weren't easy to make. :p

This ragdoll is just like the one from Engine Prototype 02, with a staff instead of a sword. The new door constraints let the ragdoll hold the staff at a certain angle, instead of just spinning freely.

Click the window to start. Then use the arrow keys to move the stick figure around.

left - rotate left
right - rotate right
up - raise arms
down - spread legs

For slow motion, hold down the space bar. Click the meters to adjust the physics settings.

Let me know if you find anything interesting. ;)

Engine Screen 03

I've had to put this project on hold for a while, but now I'm back. I'm going indie, and Dejeweled is the big, ambitious project I'm working up to. You can expect to see a new update every week or so.

I've been working on door constraints - angular constraints based on a dot product instead of an angle. The ragdoll has a staff. And a door constraint is what's keeping it from spinning around in the ragdoll's hands. It works pretty well.

But what I really want is to make the staff rotate in a sort of bouncy, springy way. And I've been having a lot of trouble getting that to happen. It just spazzes out no matter what I try, which means that my math is wrong. This vector calculus has been kicking me in the head, repeatedly, for several hours straight.

But I'll figure it out. And I'll release the next engine prototype with an excellently springy and responsive staff. And of course, this will all happen by tomorrow. I hope. :)

2009/06/23

Engine Prototype 02


This is my second prototype of the Dejeweled physics engine. Now the engine supports both rod constraints and pin constraints, in two flavors: rigid and springy.

This ragdoll is just like the one from Engine Prototype 01, except now it has a sword! With pin constraints, the ragdoll can grab any point along the weapon, not just the ends. This opens up a lot of possibilities, as you'll see in the next few prototypes.

Click the window to start. Then use the arrow keys to move the stick figure around.

left - rotate left
right - rotate right
up - raise arms
down - spread legs

For slow motion, hold down the space bar. Click the meters to adjust the physics settings.

Let me know if you find anything interesting. ;)