Complex control concept...

'allo, I’m trying to develop a complex system for controlling a character, which will incorporate several different gameplay styles into one. Needless to say, it’s kinda tough.

Basically, imagine a Sonic the Hedgehog sort of game; a camera that can rotate around the character, and controls that allow the character to run along walls and ceilings. Because the character can rotate so much, the camera will rotate to follow the character’s orientation.

This is based on three main stats; MaxSpeed, acceleration, and traction. MaxSpeed determines the fastest running speed he can reach on his own acceleration power. Acceleration is, of course, the rate of acceleration (different for each character).

Traction is a force that holds a character to the ground based on his current running speed. Traction also reduces the effect of gravity on the character and “rights” the character to the surface he’s running on.
A traction of 0 will mean that the character cannot adapt to the ground he’s running on, and can’t defy gravity at any speed.
A traction of 100 will let the character freely stand on any surface he’s on, even if he’s completely still. (though if he jumps into the air, he’ll fall like normal)

My basic idea is this. Feel free to ignore this if you already have an idea:

-If the player is grounded,
-Get joystick input.
-Translate the joystick’s input to the direction the camera is facing. (X=camera’s x, Y=camera’s z).
(Basically, Y is “forward”, based on the direction the camera is facing, and X is “sideways”.)

-Translate the input based on the character’s orientation. (X first, then Z, so the rotation stays relative to the camera). (So the character will naturally move across the surface based on the shape of the surface he’s on.)

-Apply force to the character based on how much he’s accelerated. Apply force in character’s “down” direction based on said speed and “traction” stat.

At this point though, my lack of neurotransmitters is getting to me, and I haven’t the slightest idea how to go on.

Might anybody have any suggestions on how to account for resistance against running speed? For instance, if the character runs into a wall, his running speed might drop to 0, but the surface he’s running on might affect any reference to his absolute speed.

Or any suggestions for anything else, in case you think I’ve completely screwed up with this.

Thanks.

Thanks for the info!

This will definitely help me whenever I want to play online games with high-class transvestites.

I was trying a very similar prototype, for a game idea I had a few years ago, with a cockroach that could run on any orientation surface.
I tried it in Unity and it works, but I can’t work out how to position the camera.

http://steamrolled-media.net46.net/unity/tilted/Tilted000.html

The only known Vector is Up/Down which is the normal of the mesh its in contact with.

I’d be interested in any ideas for a follow camera :slight_smile:

The camera should be easy enough. All it would have to do is rotate on its Z axis so that the camera’s “up” matches the player’s “up”. But that is a bit tricky, considering that the player isn’t completely level compared to the camera…