Humans, the physical entities

Posted By: Lord Alexion

Humans, the physical entities - 03/17/04 01:09

OK, here I am with another issue... remember I finished my last thread in this forum telling I would use the physics engine to handle character movement? well, now that I'm about to to it, I realized I don't quite know how to achieve that kind of effect... so, does anyone out there know any resources, tutorials, or can offer a quick crash course in how to use the physics engine to achieve a natural-looking walking/jumping motion?

thanks in advance ^^
Posted By: fastlane69

Re: Humans, the physical entities - 03/17/04 02:14

Quote:

so, does anyone out there know any resources, tutorials, or can offer a quick crash course in how to use the physics engine to achieve a natural-looking walking/jumping motion?




eeeek...as limited as the current implementations of the 3DGS PE are, I don't know of any such papers that are 3DGS specific.

I use the PE for my characters movement and it's nothing fancier than making sure you have friction set to around 20 (so your entity doesn't shoot out an go unstable) and just apply a force or torque to your entities center.

Add a little walking animation (the PE system is separate from any animation code) and my walking player moves and looks fine.
Posted By: Lord Alexion

Re: Humans, the physical entities - 03/17/04 02:18

Ooo, I see... but, well, forgive my physics ignorance on that remark here, but how should the foce be applied? I mean, is it constant while the char is walking? and what about jumping? and how can I make the char stop moving at a specific position?
Posted By: fastlane69

Re: Humans, the physical entities - 03/17/04 04:07

use phent_addlocalforce with a nullvector as to where to apply the force.

Depending on your friction, your force may not be enough to move you and when you move it may keep you at const. Velocity. With no friction, you would continue to gain velocity as long as you continued appling a force.

To stop, simply increase the Drag dramatically...I've found this to be a good way to stop a physics ent.

Finally, to jump, use the same phent_addforcelocal, but with a vector like (10,0,100), which tells it to apply a force forwards and up, a jump!
Posted By: ventilator

Re: Humans, the physical entities - 03/17/04 04:10

how do you handle stairs? do you use a box or a sphere? ...i haven't tried to use physics for humanoid players yet but i would make the player physics entity float a certain distance above the ground.
Posted By: fastlane69

Re: Humans, the physical entities - 03/17/04 04:34

If registed with the PE, having your entity hover above the ground is very likely to lead to undesired results since you would have to apply a constant upwards force to counter gravity....very unstable.

And if this is a workaround to the stairs, consider that to climb stairs, I would simply disconnect the engine, start my stair climbing animation, and ent_move the player diagonally up the stairs. Once on top, I reconnect the engine and proceed as normal. I can't forsee any circumstance where it would be advantagous to have a PE registered entity float above the ground.
Posted By: ventilator

Re: Humans, the physical entities - 03/17/04 04:45

floating is no problem. you have to set a target height and then apply an upward force which is proportional to the aberration. this way it's stable.
Posted By: Lord Alexion

Re: Humans, the physical entities - 03/17/04 04:48

Well, this can become quite complicated since my entity is a 2D SPRITE... you see, I'm making a visual environment that resembles those console RPGs and some asian PC games where you have a 2D sprite as a character in a 3D world. So, it can be quite difficult to make the character move in a natural way using a physical engine that's designed for polygons... maybe I should resort to ent_move, oh well... it'll be hard to code jumps... ^^o
Posted By: fastlane69

Re: Humans, the physical entities - 03/17/04 05:04

Sort of a self correcting system? I could see how that would be stable, but given the thread, don't know where or why you would want this UNLESS a floating entity is what you wanted (like a hovercar or ghost).

As to Lords position don't give up on the PE just yet. While it may seem overkill on a 2D sprite, it can in fact give the sprite the illusion of being real if the physics are tight. Not knowing the full extent of your application though, I would have to say that it **seems** like overkill, but it may not be!!!
Posted By: Lord Alexion

Re: Humans, the physical entities - 03/17/04 12:15

well, the full extent of my application would be a bit large to explain in here, but the general idea is like this: have you ever seen or played tactical battle RPGs? the best examples of this kind of game are found in old Genesis games like Shining Force and the well-known PSX game Final Fantasy Tactics. My application would be an online version of those games, aimed at making tactical duels over the net, or even team battles, with each player controlling one char.

I'm aiming for a general graphical line that resembles Final Fantasy Tactics, with an isometric view and 2D anime-like chars, with a very "asian console game" feeling. Are you following me so far?
Posted By: fastlane69

Re: Humans, the physical entities - 03/17/04 13:04

I think I do follow you and you really don't need the Physics engine

Posted By: Lord Alexion

Re: Humans, the physical entities - 03/18/04 03:38

Yea... I was able to code a pretty nice character movement function without the physics engine... HOWEVER I'm having som problems with the jumping function... -_-
Posted By: feature_creature

Re: Humans, the physical entities - 03/19/04 10:16

Sounds like a call to arms! Could you be more specific about the jumping problem?
© 2024 lite-C Forums