# Introduction

One of the basic areas of videogames and animation is the design of 3D images on a computer using mathematical formulas. Manufactured from combinations of polygons, these images can range from a rabbit to a pile of scrap metal. The images that the player sees, from the character passing through the stage to the enemies and obstacles, are formed of those polygons. The place where the objects are located and the location where the character is in reference to those objects, everything is decided by mathematical formulas. Even in basic 2D games, math is what tells the game if the character jumped to a solid platform or fell into a hole.

Another area of ​​video game development that uses mathematics is the design of the physics of the world. Regardless of whether the game world is simple or complicated, there are always physics that must be applied. If a player presses the jump button, then the height that the character will reach must be determined. If a soccer ball is kicked, it can not follow a straight trajectory, so the programmer must apply the algorithms necessary to decide the gravity drag rate, the way the ball will slow down through distance, etc. . The same applies to first-person shooter games, in which the trajectory of bullets fired over a large distance must be calculated.

How much damage a character receives for certain actions requires mathematical formulas. For example, a fall from a certain height must be calculated, especially if falling from great heights does more damage. In addition, simple mathematics, such as how many points a character must obtain to perform certain actions, must be calculated mathematically. Also, the way the character's energy bar works or the points of damage is decided by the math. In RPGs, where a character has a certain percentage "to hit" set by his stats, there must be a formula to determine the possibility that the character has to hit his enemy.

# Fields of discrete matemathics in video games creation

## Combinatorics

During the development of a video game the combinatorial analysis is extremely important, since using combinations, permutations and randomness simplifies the task of creating worlds within it. For example, using this type of operations you can create 3 types of trees and that these can be combined to create a forest, changing its position, size, grouping, etc.

This same application and with the same method is how you can create citizens and characters from the world of videogames.

## Graphs

Graphs can be used to make a flow of the different paths that the user can travel within a video game. Some games in which the user has the opportunity to make different decisions and depending on these decisions is the course the game takes and the story can be changed depending on this.

## Matrices

Matrices have an important role in video games development because they serve for the rotation and change of position of an element. For example, a three-dimensional world in a video game can be rotated by means of matrix operations in order to change the coordinates of a specific point. A game with three-dimensional scenes in which the camera can be rotated needs matrices. Likewise, matrices serve to simulate and order the different choices a user can make during a game, as well as create a tree graph. This especially can be applied in games of chance and the different probabilities that a player has, the options that can be drawn.