   Baby's first steps climbing the stairs
  Hi,How to climb a stair? My game character has as much problems with climbing as my 1 year old daughter. What I'm trying now is to push an elipsoid shape (the physical body for my character in Newton) with force. It can slide up the steps, but if the steps are relative high it gets darn difficult. It feels like rolling this beauty up on a hill.http://www.freewebs.com/aizuk/fat-woman.jpgAlso climbing down is difficult. The player does not take gentle steps but just falls. I'm trying to improve by sensing vertical polygons and then lifting the player up with the inverse of the gravity. I can get up now, but very choppy. Later on I also have to animate the players. How to make the animation synchronized with such unpredictable movement?I don't know how modern (FPS) games handle character movement. Do they use physics at all, or just fixed movement "on rails"? Or maybe invisible slope polygons on the stairs to make true physical movement with force easier? Or maybe they actually follow their feet with IK? I have no clue... that's why I ask :)Greetings,Rick   
  I prefer ramp type stairs myself, unless it's just one step up/down. Real stairs are too bumpy. But yeah, you could collide to a ramp but IK to real stairs.What I do for climbing stairs and bumps is do a trace forward, then add a stair height constant to the Y position (not all stairs have to be this height, it's just the highest you can climb up) and trace again, and use whichever made it farther. For climbing down, after you move, then if you were on the ground to begin with, do a downward trace by the stair constant, and if you hit the ground, go to it, otherwise just stay in the air.   ;  IIRC the havok solution is to have a dampened constraint between the character collision object and the output position, at least in the vertical direction. So his vertical hip input is dampened. They then use IK to place the feet on the ground.Alternatively you could use a ramp collision primitive and actual stairs for the graphics. One step further would be to use a ramp for the collision, and stairs for the graphics and IK.The dampened solution is sounding pretty good at this point.Also to determine what step is too large for you to ascend, they use a dot product limit. Doting the normal of the contact with the step with the character up axis (aligned with world up) must be greater than some threshold or the collision normal is reoriented perpindicular to the up axis.But other than that, it's just one bumpy ride as you can see, just gotta smooth it out.   ;  Thank you both for the feedback!Using slope primitives doesn't sound that bad come to think of it, but the character needs to be aware it is a stair... I think Newton allows to add a tag to the polygons so I can use that to define the underground. Not only handy for stairs, also for helping the animations on other surfaces (difficult walking in the mud, wall climb for spiderman, etc.). Yet I'm wondering if this is (still) used. when taking stairs in, let's say Halflife, I think you actually feel your player being lifted up at the next stairstep, but I might be wrong. I could also smooth the stairs by rotating the vertical polygons a little bit.First I'll try improving the physical approach. I wonder what would the proper way to do that dampening in Newton. Now I just lift the player up with an upwards force. That works only a little bit, because in the meanwhile the contact could get lost and thus the player falls down again. Maybe I should hold that force for some longer time. But maybe in combination with somewhat sloped stairsteps it could work.@DekuTreeIn the Deku Tree castle Link only had to deal with ramps instead of real stairs, right? Funny that your nickname remembers me of those good old times :)   ;  To implement the dampening you need two simultaneous representations of the character.There is the physics one, which is going to be bumping all over the place skipping up and down the stairs.The second one is the graphics one. Every frame you migrate the position of the physical representation to the graphical one by some dampening formula. You could just average the position over the last few frames for a very rough start. You could use a spring and dampener, or you could use a PID.You'll want to implement this dampening down in the physics object though. That way if someone sets the position of the character physics it also sets the position of the dampened output.Then just rigidly connect your graphics to this dampened physical output.In the havok demo they allow you to render both the reprsentations. So you see the one bouncing around while the dampened output is smoothly moving up and down the stairs.   ;  Never thought about that. I just copy the physics matrix to the graphical object. But with an average/PID it allows to use more force to get that damn ball on the stairs, without letting the player feel he gets launched in the air. Thanks for that usefull tip! Downloading the Havok SDK demo right now.Rick   