Beneath all those cool character animations, smart enemies, and fun game mechanics in your favorite games is one thing: math.

**Mathematics is the foundation of every game** and necessary for everything to work as the designers intended.

This doesn’t just include huge games like Middle Earth: Shadow of Mordor and its enemy-generating Nemesis system.

Even Pac-man employs math to decide how the enemy ghosts move, how long they take to regenerate after being eaten, etc.

Even Pong, arguably one of the simplest games ever made, uses math to dictate the speed of the paddles and movement of the ball.

Table of Contents:

## Math = The Foundation of Game Design

In the same way that math doesn’t work unless you learn and apply the rules, a video game can’t have rules without math. When you think about it, video games are essentially virtual worlds with lots of rules that keep everything working as intended.

No math means Mario keeps floating up after jumping, bullets in Call of Duty shoot in random directions, and even your favorite character in Angry Birds move in inconsistent ways if it moves at all.

Most of the time the math you learned in high school and college is no different than what was used to design a game.

To name a few, some of the **common branches of math utilized in game development include:**

- Algebra
- Trigonometry
- Calculus
- Linear Algebra
- Discrete Mathematics
- Applied Mathematics
- And more …

More specific elements of math almost always used in games include:

- Matrices
- Delta time
- Unit and scaling vectors
- Dot and cross products
- And scalar manipulation

## Math In Programming

While math is useful even in the art side of game development, it’s the programmers who make use of it to create the characters, mechanics, and more.

Without math, programmers wouldn’t be able to make objects in the game do even the simplest of things, including movement.

Game code combined with variables, vectors, and more is what tells Sonic to run slowly when the player barely presses the D-pad, runs faster when at a full dash, stops completely when he runs into a solid object, and run move differently when underwater.

It’s not hard to see why a game without programming and math would just be a bunch of pretty, useless art.

Together they allow games to simulate our worlds, such as moving water and physics, as well as to deliver something outside real-world possibilities.

Only in Portal can we know what it feels like to step through portals, while only in Halo can we dash at ridiculous speeds to impale a foe with an Energy Sword.

Lifelike water, pathfinding, procedurally generated levels, critical hits, AI that reacts to player input, and even the game engine architecture itself– all of these are not possible for a programmer to do without math.

If you’re considering a career as a game programmer and even designer, expect math to be your greatest tool for creating worlds that players will enjoy thanks to addicting gameplay that not only works as intended but is fun as well.

## Does Programming Require Knowing Math?

Yes, to a certain degree.

If you want to have a strong sense of control over programming basics, it’s wise to have at least the basic knowledge of math concepts like logic, algebra, and more. You won’t be required to answer complex math problems while coding, but there will most likely be example problems using math equations, and logic.

## How Much Math Do I Need To Know To Code?

This depends because not everything in code needs the programmer to take part in the mathematical process. You won’t be solving equations and going into detail. If you are hung up on numbers and problems, the computer can usually figure out those details.

## Math in Video Games

Video games and math are basically interchangeable in how enmeshed they are with each other. Every action you do in-game is due to a math calculation of some sort.

Luckily for us, we harness the power of computer programming to cut away all the complicated math that would take hours to complete by hand. Without math, games wouldn’t be what they are.

Running, jumping, flying, diving, surfing, and basically any physical activity is governed by some sort of school of mathematics.

## Numbers

Everyone knows numbers; they’re what makes our society push onward. The same goes for math in video games. If it weren’t for all of those 1’s and 0’s, we wouldn’t be able to program and create games properly.

## Discreteness

This refers to the limits in which certain aspects of gaming have. Discreteness is the opposite of continuous, meaning a neverending set of numbers. In games, we need discreteness to contain and build our game.

## Geometry

Geometry, the field of math that questions the properties, shape, and size of things in a given space, is vital for math in video games. It’s based on right-angled triangles. The geometry makes up nearly all we see in our video games.

## Coordinate Systems

You need to have a concept of where an object is in space and time. We do this by using different numbers to label the coordinates, where the object will take space.

## Iteration

This is all about computers repeating themselves. This is a crucial function during the game development process. You can’t have long pauses in gameplay, so you need to split up different portions and make sure they’re all working correctly.

## Physics

Another huge area of gaming, physics, is the broad field of math in video games. Whether your character is hitting a baseball, jumping over a hedge, or shooting at a target, physics plays one of the most prominent roles in games.

## Cheating

No, these aren’t video game cheat codes. Cheating refers to using shortcuts in the programming process to make our lives a little easier. This is using mathematical functions to simplify hard functions.

## Intelligent Motion

Intelligent motion is the many different algorithms used by enemy characters to undertake specific actions in reaction to the player’s presence. Things like acceleration, velocity, and position all affect how enemies react to a target.

## Pitfalls

As you can probably guess, pitfalls refer to anything in the coding process that can mess up your code and your game. These are accidental mistakes or bugs within the code.

## FAQs

### What math do you need for video game design?

It’s recommended that you know the basic concepts of geometry, algebra, some trig, and logic. However, this is different for most people and shouldn’t dissuade you from trying if you don’t know more advanced math.

### Does game development require math?

Yes, it requires a few different subsets of math.

### What kind of math is used in computer programming?

Algebra, trigonometry, calculus, logic

### Do you need to be good at math to be a programmer?

You don’t need to be ‘good,’ necessarily. It’s a bit complicated, as math in video games is a broad concept. Essential functions like finding the sum and multiplication can be delegated to your computer.

### Can you learn to code if you’re bad at math?

Yes, absolutely. Some people are fantastic programmers who have struggled with or even failed calculus classes.

### Does coding involve math?

Yes, it can use anything from linear algebra to calculus, depending on the project.

### Is coding harder than math?

It depends entirely on the capabilities of the coder. Some find it much more comfortable.

### Can you be a programmer if you’re bad at math?

Yes. Coding isn’t as dependent on harder math concepts as you might think. Many examples used in tutorials and books use these more difficult concepts to illustrate how to do something, which could prove to be an issue.

Being better at math helps you understand more advanced concepts and what they represent.

### Can you be a programmer without math?

No, as a lot of coding is based on the mathematical field of logic. You can perhaps get by without using trigonometry and calculus, but you will most likely need to know some algebra and logic.