Devblog part #1 – Player movement and controls

The first thing I decided to attack on my new project is probably the most important thing in a good platform game, controlling your character.
The control scheme I choose for my project is pretty basic but still needs to be very tight, so lets break it down,

#1 Walking

I used 4 parameters to define walking; speed, acceleration, deceleration and fraction.

Speed is the maximum speed the character can reach while walking.
Acceleration is the time it takes to reach from speed 0 into walking speed, this gives the character a more real response as he gains momentum while walking.
Deceleration is the time it takes the character to stop walk, this usually should be much faster than acceleration, to give the player a more precise control on where the characters lands when walking/running/jumping through a level.
The last one is friction, this is an extra value I can apply to platforms to make to character react differently, for example walking on a sand or mud surface I will decrease the character’s acceleration and speed and on a wet or icy surface I will increase the speed and deceleration to make it slippery.

#2 Running

Running is basically like walking with higher/lower values, you want higher acceleration and speed and a slightly lower deceleration.
Besides the basic running functions I used the running button to enhance certain aspects of other mechanics, for example when you’re wall climbing, you can jump/climb higher by holding down the run button, you can also use it to give a little extra boost to your jumps or enhance other game mechanics you got implemented.

#3 Jumping and falling

This time I used 5 parameters; strength, acceleration, sustain, gravity and maximum falling speed, lets break this down.
Jumping strength is the maximum value the character can jump to, this is important for you level design, knowing your character’s limit and working with a grid will make it easier for you to place your platforms in the right place without needing to test it all the time.
Sustain is the amount of time the player can hold down the jump button to reach an higher jumping level.
Acceleration is the time it takes the character to reach a full jump, tweak this parameter to achieve different reaction from the jump button, you want the player to be able to reach the top jump value pretty fast but still you want another 2-3 steps in between for variant jump heights.
gravity is just gravity :), it’s the force that pulls you down, this can be low for low gravity levels or negative if you want to push the player up instead of down.
Maximum falling speed, once your reached the maximum jump strength or you have released the jump button the character starts falling, this parameter controls how fast you’ll fall, the difference between this and gravity is that this is used only when the player is falling while gravity pushes the player even when he stands still on a platform, you can use different combination of this, for example, you can start the level with a positive gravity value and a negative falling value, so the character will start on the bottom floor, but when he jumps he will be pushed up and stick to the ceiling.

#4 Wall climbing

The mechanics I used for wall climbing are different from the normal jump mechanics, I don’t use acceleration or sustain, I have 2 pre setted jumping heights, small jump for default and high jump for when holding down the run button, the gravity and fall speed are still affecting the character.
In addition when the player jumps on a wall I push him a little back on the X axis, depending on the direction he is climbing, I also decrease the falling speed when he is close to the wall so he’ll slide down and not fall and last thing is when you press the other direction of the climbing (left/right) I gradually push you out and not in the walking/running speed, so when you jump from wall to wall you won’t lose grip in the process.

Next devlog will be about Interaction with the scene – Platforms, stay tuned.

Leave a Reply