logo

Feature Design Example – Jump Mechanic

Preamble

I think it is very important as a designer to understanding the mechanisms behind the features you implement in a game, in this example we will cover a jump mechanic. In some studios, this work will be done by the engineer, who often makes a number of important design decisions during implementations. Or alternatively, if you are working in a game engine that handles most of the math for you, it is easy to gloss over the functionality of the mechanics you implement. This knowledge is meant to help you better understand how and where to tweak and tune your mechanics. It also gives you perspective on how you might design the system as a whole, how will you make this satisfying and fun for players. For example, how will your physics interrelate in a 2D side-scroller platformer. i.e. will there be other physic based actors that will influence your game character?

Overview

A major goal in our initial prototyping will be to nail down our jumping mechanic. This section is dedicated to exploring the design decisions situated around our jumping mechanic and what levers we will likely use to tune said mechanic.

If the goal of the game is to complete a stage as fast as possible, then jumping needs to contain mechanisms that allow the user to optimize their completion time. The three means of achieving this functionality will be explained below.

maxresdefault

  • Levels will be manually created by the designers.
  • A design objective is to create multiple paths within each level, but maintain the path locations in close proximately to one another so players can track one another’s movement.
  • Characters never die, they are only slowed down by the terrain should they hit an obstacle. The goal is to encourage counterplay between players through their abilities.
  • The game will feature a rubber banding mechanic to keep players in arms reach of one another. A focus of the game is to get players interacting with one another, whether it be as a team or in a free-for-all match setting.
  • Each character comes with one unique ability that they can use by swiping on the screen. An example ability might be a grappling hook; swipe in the direct you wish to launch the hook, jump to accept position, swipe to release your character. (Physics based movement)

Jump Functionality

  • Jump direction is based on the angle of the ground you are standing on. The jump force will be applied to the halfway point between the y-axis and the x-axis. The y-axis is a constant value, the x-axis varies based on the terrain’s slope.
  • Therefore, a character on flat terrain would have their jump velocity applied at a 45 degree angle. This provides them with the optimal angle for distance at the cost of velocity. See below for more details.

Angle of Jump

  • Since the direction of the force applied to the character when they jump is dependent on the slope of their terrain, jumping off of a sloped terrain will apply a greater jump velocity then jumping off of a flat surface. (see fig. A/B)
  • This creates instances where an optimal jump location exists within a given level. Jumping on downwards slopes is more optimal than jumping on flat surfaces or uphill surfaces.

Tap Duration

  • The player taps the screen to activate their jump. A quick tap and release results in a short jump, a tap held for a short duration results in a long jump.
  • Therefore, if the player taps and holds for 0.2 seconds they jump a total distance of 20m. Similarly, if they hold their tap for 0.5s their character will jump a total distance of 30m.

References and Design Notes

Trajectory of a Character

  • g: the gravitational acceleration—usually taken to be 9.81 m/s2 near the Earth’s surface
  • θ: the angle at which the projectile is launched
  • v: the speed at which the projectile is launched
  • y0: the initial height of the projectile
  • d: the total horizontal distance traveled by the projectile

h(t) = v0 * t + (gt^2/2)

Where v0 = initial velocity, t = time, g = gravity.

Instead of trying to define the jump mechanic by tuning the above formula, we should instead focus on defining jump duration, max jump height, horizontal jump distance, and/or time to max height. The results of these equations should define our jump behavior in the above formula.

Given our control restrictions, we also need to access whether air control should be granted. My first thought is to restrict air control completely to focus the dexterity test on the timing of the jump(s) and less on the overall control of the character. Air control provides the player with a higher degree of control over their character, which does mean we can make slightly more demanding levels. This is definitely something we will want to experiment with in our prototyping.

Flat Terrain

Jump Time

Jump Height

Note: t = T * 0.5

Horizontal Jump Distance

Where v equals velocity of object launched from horizontal.

Angle of Reach

Notes

Launch Speed

Vertical Jump Distance

 or 

 if θ is 45 degrees.

Maximum Jump Height

Time of Jump

 or 

if θ is 45° and y0 is 0.

Sum(F) = mass * acceleration

Where Sum(F) = Normal Force – Weight Force

Weight = Mass * Gravity

Mass = Weight / Gravity

Gravity = Mass / Weight

Considerations

  • Must factor in vertical velocity when determining how much added velocity is applied to character. Otherwise, the character will unintentionally jump really high. Consider applying a quadratic falloff formula to determine the amount of added velocity that is applied to the character to resolve this effect.

Leave a Reply

*

captcha *