HOME | DD

axcho — Engine Prototype 05

Published: 2009-11-25 01:52:58 +0000 UTC; Views: 15623; Favourites: 48; Downloads: 2279
Redirect to original
Description Engine Prototype 05 - by axcho on November 24, 2009

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! 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.

Dejeweled Development Blog

Physics Prototypes by axcho
Related content
Comments: 36

DREA-MS [2015-09-13 18:04:18 +0000 UTC]

I put on zero gravity then it only moves in place..?

👍: 0 ⏩: 0

StarBlazer2155 [2013-07-04 17:02:37 +0000 UTC]

press random buttons and hes breakdancing!^^ i love thus game!

👍: 0 ⏩: 0

devgem [2010-04-24 18:55:11 +0000 UTC]

rlly cool. give him a small ball and a sowrd. that'd be legend! baseball

👍: 0 ⏩: 0

wonderwhy-ER [2009-11-26 10:51:32 +0000 UTC]

Potentially fun thing.
Hmm it is kind of hard to make produce symmetrical results It seems I can kick hard to the left but not to the right And it seems tapping buttons randomly produces better results then trying to do it intentionally

👍: 0 ⏩: 1

axcho In reply to wonderwhy-ER [2009-11-27 19:30:41 +0000 UTC]

If you're talking about the ragdoll, this may be because of some inaccuracies in the spring lengths. If it is impossible to satisfy a set of constraints, there will be extra forces added inadvertently and the ragdoll will spin more to one side. You can see this more clearly if you turn off gravity and friction, and turn up rigidity all the way. Fortunately, this only happens with bad data - it's not inherent to the simulation.

As for tapping buttons randomly, well, that's what practice is for.

👍: 0 ⏩: 1

wonderwhy-ER In reply to axcho [2009-11-27 22:25:35 +0000 UTC]

I did practice Hmm how about making a kicking bag? You know like one boxers train on Somewhere in center of the screen

👍: 0 ⏩: 1

axcho In reply to wonderwhy-ER [2009-11-28 07:34:56 +0000 UTC]

Ah, good idea. I'll have to try that sometime.

👍: 0 ⏩: 1

wonderwhy-ER In reply to axcho [2009-11-28 09:14:04 +0000 UTC]

Hehe Also if possible add damage texts floating on collisions with it It seems looks of it are not that informative. What I tough was good kick was not pushing ball much but I am not shore I can push it much at all

👍: 0 ⏩: 1

axcho In reply to wonderwhy-ER [2009-11-28 09:28:54 +0000 UTC]

Hmm, yeah I can see that being useful. I'll try it.

👍: 0 ⏩: 1

wonderwhy-ER In reply to axcho [2009-11-28 09:45:40 +0000 UTC]

Ok

👍: 0 ⏩: 0

MichikoTheHedgehog [2009-11-25 08:53:04 +0000 UTC]

Quite interesting when you have control all that way up and bounce turned down and press left to right quickly. Translates to: OMFG THIS IS AWESOME.
Lol this is really cool. Excellent job, but he stays on his side a lot :/

👍: 0 ⏩: 0

imjustellingyou [2009-11-25 05:46:33 +0000 UTC]

i had fun turning off the gravity
poor thing, just wiggling in mid air...

👍: 0 ⏩: 1

axcho In reply to imjustellingyou [2009-11-25 06:25:38 +0000 UTC]

If you listen closely you can hear it crying for help...

👍: 0 ⏩: 1

imjustellingyou In reply to axcho [2009-11-25 15:38:52 +0000 UTC]

lol...

👍: 0 ⏩: 0

puinkey [2009-11-25 04:07:26 +0000 UTC]

he isn't very good at playing dodgeball :'O

👍: 0 ⏩: 1

axcho In reply to puinkey [2009-11-25 04:20:38 +0000 UTC]

Yes. No brains, unfortunately.

👍: 0 ⏩: 1

puinkey In reply to axcho [2009-11-25 10:34:12 +0000 UTC]

set everything to max and drag the ball towards him
Aww , shaking pelvises

👍: 0 ⏩: 0

N3XUZ [2009-11-25 02:04:37 +0000 UTC]

Squee!

Okay, this kicks ass. lololololol

👍: 0 ⏩: 1

N3XUZ In reply to N3XUZ [2009-11-25 02:07:36 +0000 UTC]

Been playing with it the last 5 minutes, mentally going "RAWR! GET BALL MUST ATTACK BALL RAWR! RARARARAWR ATTACK KILL BALL!!!11one!"

:3

👍: 0 ⏩: 1

axcho In reply to N3XUZ [2009-11-25 04:20:09 +0000 UTC]



...and it's great exercise if you do it in real life, too. Just don't hurt yourself.

👍: 0 ⏩: 1

N3XUZ In reply to axcho [2009-11-25 04:39:37 +0000 UTC]

Too late. *broken spleen*

👍: 0 ⏩: 1

axcho In reply to N3XUZ [2009-11-25 06:19:14 +0000 UTC]

👍: 0 ⏩: 1

N3XUZ In reply to axcho [2009-11-25 06:24:29 +0000 UTC]

👍: 0 ⏩: 0

Niallmeister [2009-11-25 01:56:33 +0000 UTC]

Ah, nice (:

Pretty unstable I can see but you're getting some nice progress, good luck!

👍: 0 ⏩: 1

axcho In reply to Niallmeister [2009-11-25 04:17:55 +0000 UTC]

Thanks. Yeah, the instability is due to the added friction and restitution forces, as well as the discrete sampled collision detection. Once I get continuous raycasted collisions working, I imagine the stability problems should resolve themselves...

Physics engines don't always care too much about imagination, of course, but I'm hopeful.

👍: 0 ⏩: 1

Niallmeister In reply to axcho [2009-11-25 04:21:11 +0000 UTC]

When you implement some more softbody stuff it'll get real fun (:

👍: 0 ⏩: 1

axcho In reply to Niallmeister [2009-11-25 23:40:19 +0000 UTC]

Do you mean "fun" as in fun to play, or "fun" as in me smashing my head against a wall of physics formulas for several hours straight?

I just made a quick fix that should improve the stability of the collision response somewhat...

Let me know if you notice any difference.

👍: 0 ⏩: 1

Niallmeister In reply to axcho [2009-11-25 23:45:23 +0000 UTC]

Fun to play, hehe

Just noticed if you drop the ball on the little guy's head it sort of slides down like it's in butter : P

👍: 0 ⏩: 1

axcho In reply to Niallmeister [2009-11-26 07:29:28 +0000 UTC]

Oh good.

I just made another update, by the way - with new, more realistic friction! Now there's kinetic friction based on normal force, and static friction too, so if you balance the ball on the ragdoll it will stay there for a while before sliding down...

Try it and see. It has a nicer feel, though it takes two extra square root functions per collision (slow). Hopefully it's worth it.

👍: 0 ⏩: 1

Niallmeister In reply to axcho [2009-11-26 19:10:26 +0000 UTC]

Already looking way better, you're doing some fine work here axcho : P

What's your basic method for finding the collision? Is it just a plain line + the ball with an amplified invisible radius? Or am I just making no sense, hm..

👍: 0 ⏩: 2

axcho In reply to Niallmeister [2009-11-28 07:57:27 +0000 UTC]

By the way, I just made another update, fixing some issues with the static friction and getting rid of the two square roots with an improved kinetic friction algorithm.

I think that should be the last update on this prototype...

👍: 0 ⏩: 1

Niallmeister In reply to axcho [2009-11-28 08:04:21 +0000 UTC]

You're very skilled at applying fast updates, it takes me a long time to fix a lot of the problems I run into

Just noticed the ball seems very willing to balance on the edge of a limb, without sliding off. Not sure if that's intentional but it looks kinda weird : P

👍: 0 ⏩: 1

axcho In reply to Niallmeister [2009-11-28 08:09:54 +0000 UTC]

Ha, thanks.

The balancing is intentional. I set the static friction coefficient (stickiness) pretty high for this prototype, just so I could test that behavior.

👍: 0 ⏩: 1

Niallmeister In reply to axcho [2009-11-28 08:15:38 +0000 UTC]

Ah, I see! In that case, well done haha.


Do you by any chance have some sort of IM info - MSN, Skype etc. I could add you on? I feel like I've asked you this before, worth a shot though

👍: 0 ⏩: 1

axcho In reply to Niallmeister [2009-11-28 08:42:17 +0000 UTC]

Noted.

👍: 0 ⏩: 0

axcho In reply to Niallmeister [2009-11-27 19:34:25 +0000 UTC]

Thanks. Yeah, that's the basic method pretty much, based on [link]

But the next phase is to implement continuous collision detection. I know how to do that with two circles [link] but I'm not sure how to do that when a line is involved...

I think I'll look up how to detect the closest point between two line segments.

👍: 0 ⏩: 0