Game Design For Beginners : Using Basic Math.
What about math?
When people think about Game Design the first thought is about the creativity and the artistry involved. Well, they are not wrong, however there is an entire mathematical and logical dimension that is often lost amidst the ideas that is important to create a good game and translate the aimed Game Experience.
Of course, you won't need to deal with super complex math like imaginary numbers, logarithmic functions or even the Bhaskar's formula. But is paramount that you think a bit like a mathematician and understand how to translate gameplay and mechanics to numerical values.
Let's start with the simplest game, one that everyone can play: evens and odds.
How to define, mathematically, what is an even or an odd number?
If you divide an odd number by two you will get a remainder equal to 1. Now you can tell the players (or the computer in most cases) that if they get a number that leaves a remainder equal to 1 the number is odd and if not, it is even.
Now you need to investigate the game’s rules. A player picks a result and chooses a number to be added to the opponent’s number. If he guesses if the result is even or odd, he wins.
We don’t usually think about it because the game is so natural to us that the math behind it is lost. I think that is one of the designer's goals for some genres: create mechanics that feel so natural that the player doesn’t perceive the numbers and workings around it. You just feel them.
However, if you are planning a MOBAS/RPG/MMORPG you need to toss the numbers at the player's face (we love spreadsheets).
Let’s now look at another simple case before ramping up for something more complex: Rock, Paper and Scissors.
The game doesn’t make much sense in a numerical point of view because it’s a logic game. You can even say it can be based on statements. A > B > C > A
The fun part, at least for me, is by increasing the game interactions by adding stuff just for the fun of thinking a name for the new elements. However, to be balanced it needs be an odd number of choices. Any even options will break the game balance by creating elements with more losing conditions (3,6,9,11...). Just try it and see for yourself.
A lot of games with elemental system uses this rule, to make it an instant win or to give a numerical advantage. Fire Emblem and Pokémon are great examples on how to use "rock, paper, scissors" to add an extra layer of depth.
Now let’s talk about the grandfather of games: Chess.
How to think mathematically? Let’s look to it a bit
It’s a grid. It needs coordinates to move around the pieces in a logic way. The columns are letters, and the rows are numbers. You can also communicate the coordinates by assigning a numerical value to each square from 1 to 64 because it’s an 8x8 grid.
Instead of a narrative description you can talk about the movement of a piece by explaining where it can move with numbers. You can say “the knight can move like an L”. That’s fine but not optimal, because how long is that L? And how about the direction? The optimal way is “It can move two squares/cells horizontally and one vertically, or one horizontally and two vertically. Both in positive and negative directions”.
You can make a character to behave like that in a chess-based videogame without a grid by replacing the "cells/squares" for the game movement units.
Games Like X-Com, Wasteland, Final Fantasy Tactics and a few other uses a grid system to control movement, skill/spells range and area of effect.
Don’t fret because at the start of any project no game designer has that exact number figured out. But when you are doing the balance and progressing with the project you must assign a value based on testing and player experience. It's ok to start with "moves in a L shape" or even a placeholder value because it may change a lot.
The Game Designer work is more about testing ideas, mechanics, hopefully with the help of a programmer, and team communication than just writing a document.
Recommended by LinkedIn
Designing platform games like Mario also requires a good amount of basic math.
Move speed, the jump speed and distance, the height and length of characters, enemies, obstacles, platforms, and everything else.
And we can calculate all that using grids on a sidescroller game. Even today we use grids, tile sets and atlas to create 2D games. If we always pay attention that Mario’s jump is 4 grid cells vertically (excluding the character size), and 4 grid cells horizontally we can create the level design avoiding trial-and-error methods. The other point it’s the production flow, with the cell size as parameter you can create the modular assets with ease.
This also used in 3D games. The relative size of the characters. The modular units of the wall and floors. The correct jumping distance from a ledge to a platform and so on. Grids are just super useful.
Time for the Big Leagues: Enemy Behavior as numbers.
Let’s take an example of a computer RPG and see how we can mathematize the enemy behavior to decide which character he should attack. Let’s say is based on Dungeons and Dragons ruleset.
We have a goblin melee attacker, and he needs to choose who is the best target (I will avoid going into fuzzy logic here okay). You may think, correctly, that he needs to pick the easiest to kill but that ideal target may change in the combat context.
Let’s think the conditions that makes a character a good or a bad target: A good target should be:
This will suffice for this example.
However, we know that a near death barbarian still have more health than a healthy wizard. Let’s assign values base on health percentile to assure fairness, so poor Gale (a BG3 mage) can survive more than 2 turns. Just let’s do that for a few important stats for the decision.
The target priority will be based into a sum of values, the lower the number the highest the chance of our goblin picking that target.
Let’s create a table and assign a value for each condition. I choose base 5 because it's divided in 5 parameters. But you can assign any value you want.
Our goblin does a check on every character to calculate his priorities and the best and worse targets are:
A 40% health Ranger was stunned by an orc, giving to any attackers an increased chance to hit (85% total), and it’s 10 meters away from our green boy has a priority value of 7.
The full health wizard with mage armor, 60% chance, at the balcony, 20 meters away, has 13 priority value.
The goblin attacks the ranger.
Of course, this is an oversimplification, there are many variables the Game Designer must take in consideration like the damage the target is dealing by turn, the resistances to spells and status effects, the amount a potential target is healing and so on.
If you want to see how a game like Dragon Age: Origins manage target acquisition check this link
Conclusion
Of course, the mechanics you have to apply values in games are almost infinite. Like the damage per second a gun can deliver in a shooting game, the time to kill, or the difficulty rating of an encounter for better balance. You just need to remember that math is also a language and a precise one, the more you can describe the reality or the rules of a game in numbers the better you will understand how that mechanic you created works.
Fun exercise
How you would turn a game like hide and seek into a videogame and what should be the character stats to translate a his/her/their strong point and weakness? Some characters can hide better or have better earing? How you could use a "rock, paper , scissors' system on your game? The characters have special skills?
Oh, there is already a game like that.
If you want to to understand the programing of a chess videogame movement system check this link (if you know nothing about programming go for minute 3 of the video).