[box2d]How do you handle slopes and angled platforms?

It’s funny, I’ve been trying to make a ninja gaiden style game, when it comes to the issue of whether to constrain design to square platforms, that almost seems a waste of box2d capabilities, so, I figure let’s see what we can do.

First, was the issue of sliding down the platforms, which was fairly simple to handle. Could play around with friction, damping, and counter forces to keep stable, and the player stops on hills as needed.

The next one has my mind boggled, though I’ve tried a number of prospects… First, I put rays down to detect the angle of the terrain and put movement forces in the same angle, somehow that wasn’t compensating enough, and the player has too much speed and gets airtime at any peaks, then, they also have too much speed and get airtime on downward slopes. I feel that the Rays as sensors is the right thought, but I’m apparently not handling the cases the right way for what I’m looking for yet.

I’ve tried playing round with the numbers, mass, gravity, friction, and a few other tricks, and no matter what I do, the player either goes up the hill too slow, or has too much momentum at the peaks.

Some thoughts I’ve had were to check in the end contact, and if the player leaves the ground to reset the speed to the desired direction, that might lead to some jittery movement when I figure out how to code it proper.

I’ve thought of making the player a kinematic body so that it would be more directly under control, that might give better controls on the long term, not sure of the challenges as far as that goes.

It seems that forces aren’t really the way to go, but, I’ve read warnings about breaking the physics, so I’m somewhat hesitant there…

What are some methods you’ve used to ensure that your player doesn’t unexpectedly get airborn?

Thanks for any advice here…