Thursday, June 12, 2014

Using non-linear drag forces

I wanted to create a big ivy which could balance itself smoothly when the little girl was passing trough it. The best way, I think, for doing that was to create several segments of ivy. Each segment has a rigid body and a collision box associated to it, in order to deal with collisions with the little girl, and walls.



However, just by doing that the ivy behavior was shaky, even by trying to adjust the weights of each ivy segment to gain some inertial effects that could potentially solve the problem. It didn't help, so I decided to customize the dynamic integration system for the ivy, adding some friction to stabilize the system as mother Nature always does !

So I have just re-implemented the integrate function of each segment of the ivy, sharing the following gd script

You may realize that I didn't used linear drag forces, but non-linear, ie proportional to the norm of the velocity vector. This allows to stop fast motions faster than slow motions. You could even think of adjusting the friction parameter according to the velocity magnitude (for instance piecewise constant), but it's too many non-linearities for me today.

And here is the result...




Sunday, June 1, 2014

being a platformer

Some late Sunday night update ! I have finished the first tileset, and I have been able to construct a complete platform level.

Many details improved (altough the little girl motion and physics is still a bit messy...): platform design with leaves, moving platforms, lightings, interactions with stone walls, blue star badges, running hound... I think the global look is starting to be okay, and I will now start to add new effects to the little girl (magic spells), add sounds to make it more realistic and few animatimated ennemies or characters in the background.