Game Math

Discussions about Math functions usage with in a game to enhance playability.


In reference to what I use for game development please see my FAQ page.

I have been looking at easing functions to enhance game play.  One useful method I have used such a function for is acceleration on flight path.   I used  a slow acceleration function to slow the start of a missile when being launched.  It has a better feel to the game when there is a slow acceleration.

A normal movement by linear speed accomplishes the goal of getting the object to its destination, but a more meaningful visual is to perform a slow accelerate.  Using an easing function can accomplish this.  Granted acceleration can be accomplished over time in a game by adding speed for every game step event.  This is another method.

Create Event

stepcount = 0;

Step event

speed=QUAD_EaseIn(stepcount, 0, max_speed, 1)
stepcount+=1;

Script (“QUAD_EaseIn”)

t = argument0/room_speed //step #
b = argument1 //beginning
c = argument2 //change
d = argument3 / room_speed //duration seconds

return c*(t/d)*t*t*t + b;

Hear is the updated result which IMO has a better feel.

Good luck.