Shop Mobile More Submit  Join Login
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! :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. ;)

Dejeweled Development Blog

Physics Prototypes by axcho
Add a Comment:
 
:iconstarblazer2155:
StarBlazer2155 Featured By Owner Jul 4, 2013  Hobbyist Digital Artist
press random buttons and hes breakdancing!^^ i love thus game!
Reply
:icondevgem:
devgem Featured By Owner Apr 24, 2010
rlly cool. give him a small ball and a sowrd. that'd be legend! baseball
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Nov 26, 2009
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 :)
Reply
:iconaxcho:
axcho Featured By Owner Nov 27, 2009
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. ;)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Nov 27, 2009
I did practice :) Hmm how about making a kicking bag? You know like one boxers train on :) Somewhere in center of the screen :)
Reply
:iconaxcho:
axcho Featured By Owner Nov 27, 2009
Ah, good idea. I'll have to try that sometime. :)
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Nov 28, 2009
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 :)
Reply
:iconaxcho:
axcho Featured By Owner Nov 28, 2009
Hmm, yeah I can see that being useful. I'll try it.
Reply
:iconwonderwhy-er:
wonderwhy-ER Featured By Owner Nov 28, 2009
Ok :)
Reply
:iconmichikothehedgehog:
MichikoTheHedgehog Featured By Owner Nov 25, 2009
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 :/
Reply
:iconimjustellingyou:
imjustellingyou Featured By Owner Nov 24, 2009  Student General Artist
i had fun turning off the gravity
poor thing, just wiggling in mid air...:D
Reply
:iconaxcho:
axcho Featured By Owner Nov 24, 2009
If you listen closely you can hear it crying for help... :(
Reply
:iconimjustellingyou:
imjustellingyou Featured By Owner Nov 25, 2009  Student General Artist
lol...:(
Reply
:iconpuinkey:
puinkey Featured By Owner Nov 24, 2009  Student Digital Artist
he isn't very good at playing dodgeball :'O
Reply
:iconaxcho:
axcho Featured By Owner Nov 24, 2009
Yes. No brains, unfortunately. :o
Reply
:iconpuinkey:
puinkey Featured By Owner Nov 25, 2009  Student Digital Artist
set everything to max and drag the ball towards him
Aww , shaking pelvises :meow:
Reply
:iconn3xuz:
N3XUZ Featured By Owner Nov 24, 2009
Squee!

Okay, this kicks ass. lololololol
Reply
:iconn3xuz:
N3XUZ Featured By Owner Nov 24, 2009
Been playing with it the last 5 minutes, mentally going "RAWR! GET BALL MUST ATTACK BALL RAWR! RARARARAWR ATTACK KILL BALL!!!11one!"

:3
Reply
:iconaxcho:
axcho Featured By Owner Nov 24, 2009
:D

...and it's great exercise if you do it in real life, too. Just don't hurt yourself. ;)
Reply
:iconn3xuz:
N3XUZ Featured By Owner Nov 24, 2009
Too late. *broken spleen*
Reply
:iconaxcho:
axcho Featured By Owner Nov 24, 2009
:ohnoes:
Reply
:iconn3xuz:
N3XUZ Featured By Owner Nov 24, 2009
:iconsadnod:
Reply
:iconniallmeister:
Niallmeister Featured By Owner Nov 24, 2009
Ah, nice (:

Pretty unstable I can see but you're getting some nice progress, good luck!
Reply
:iconaxcho:
axcho Featured By Owner Nov 24, 2009
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. :p
Reply
:iconniallmeister:
Niallmeister Featured By Owner Nov 24, 2009
When you implement some more softbody stuff it'll get real fun (:
Reply
:iconaxcho:
axcho Featured By Owner Nov 25, 2009
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? :p

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

Let me know if you notice any difference. :)
Reply
:iconniallmeister:
Niallmeister Featured By Owner Nov 25, 2009
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
Reply
:iconaxcho:
axcho Featured By Owner Nov 25, 2009
Oh good. :p

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. ;)
Reply
:iconniallmeister:
Niallmeister Featured By Owner Nov 26, 2009
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..
Reply
:iconaxcho:
axcho Featured By Owner Nov 27, 2009
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. :D

I think that should be the last update on this prototype... :)
Reply
(1 Reply)
:iconaxcho:
axcho Featured By Owner Nov 27, 2009
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. :)
Reply
Add a Comment:
 
×
Download SWF download, 17.3 KB




Details

Submitted on
November 24, 2009
Image Size
17.3 KB
Resolution
480×360
Link
Thumb
Embed

Stats

Views
10,409 (2 today)
Favourites
44 (who?)
Comments
35
Downloads
2,255
×