Step through the physics world | LD72 no.25

Posted by (twitter: @haxpor)
December 16th, 2012 8:08 am

So quite some time before the information you’re reading get posted on this site, my blog :_)

The following is the updates

-> I got a name for 3-leg-Alien that we will be controlling it in the game. The name is Trideroche. To be honest, while I were searching for information over the Internet, I found something about vocabulary namely “Tribe – De – RoChe”, not sure whether it’s French or not, can’t remember the meaning neither. Anyway that the cool name.

-> Made physics world works! Fine-tune and finally managed to implement the initial walking feature, the core one, successfully.

The concept is that it has 3 legs. You will control it individually in the way that maintains the stability of the character itself. If you step up wrongly, you may result in explosion or get hurt in some ways.

Apparently the current state is not totally what I want it to be just yet. The pain problem relates to the initial design which is “3-leg”, yes, … literally. I don’t want to change it to other things else as that is the pretty first and solid design and I would love to stick to it. What’s wrong is when you create such a character in the world of physics, you need to make it be able to maintain its own stability at the first go you put it into the game.

image
Design and stuff

Usually, most of the time you will pop the physics object by click anywhere in the screen and it will be born there, thus falls down to the ground according to normal gravity. Whenever it touches the land, there you will see a problem. In my case, a character cannot stand on its own at the first go. Due to 3 thin legs, and at this time I have not much time to figure out which solution or primitive shape or constraint to form such a spider-like object at the end. Chipmunk is new to me.

image
It cannot stand on its own. This is the very first implementation according to my design.

It may be because the upper part of the character is visually heavier than the bottom, that’s just a guess to make it looks like in front of the screen although mass can be set. Please note that what you see in the image, it has no 3 legs yet just 2. But that’s enough for me to rethink for better solution.

Thus I re-implement the forming of character code, what I got is below.

image
Re-implement it to another design.

That’s better but it needs to be better and walkable.

So I reduced the radius of the head and decreased its mass, also shorten the body part, and put another leg with also feet. 

image
With reasonable touching area of three feet, the character has more chance to stand ground!

Anyway that’s not the optimal solution. After I poped it into the game and fell to the ground it has more chance to stand up on its own. Besides that, its clumsy structure causes it to fall down and its head knock with the ground most of the time. Ha ha, that’s funny, but it needs to be better.

My initial solution at this stage is to periodically apply y-axis velocity to its head to pull it up. But I need to call it 2 times per second (according to your set up, but it needs less frequently than frame rate, of course) to maintain its stability and realistic.

image
Much better!

In addition, I managed to remove out the big feet and make it looks like it has just that long legs. I still need the foot but just reduce its width to 1 to hide it completely. Other things still work properly.

I captured some movement of Trideroche below.

or directly at http://www.youtube.com/watch?v=_Rq427T2f9A.

I’m back to code now, I have another day and 10 hours left to finish this for the jam event of Ludum dare#25.

[I originally posted this on http://haxpor.org/post/38064023763/step-through-the-physics-world-ld72-no-25]

Tags: , ,


Leave a Reply

You must be logged in to post a comment.

[cache: storing page]