Skills

Mathematics in video game development

Illustration: Azra Humayra

It is the last period of a long school day, and the subject is mathematics. You sit there wondering when you'll need to use these concepts in real life, counting down the minutes until the bell rings. If you are into video games, your mind probably drifts to thoughts of getting home, using your free time, and diving into your favourite game on your computer, console, or phone. There's a twist, however: those math concepts that feel too abstract to you are quietly working behind the scenes in the games you love.

Without maths, video games as we know them would not exist.

Think of a simple combat game where your character slays demons. Every time you win a fight, your score increases. Every time you take damage, your health decreases. What is it that keeps track of these values? Variables, and these variables are worked on and manipulated by basic algebra. The game uses equations like Score = Score + 10 or Health = Health – 20. Your experience points, money, and inventory all work the same way.

Even upgrading weapons or levelling up characters involves algebra; values increase or decrease according to rules set by the game. Algebra is the reason you can earn points, level up, and keep track of progress.

Now, imagine you fire an arrow at a demon. The arrow doesn't move in a straight line; rather, it arcs through the air before landing. That curve is a result of physics implemented by physics engines, which use extensive mathematics to simulate how these things might play out in the real physical world. Calculus is used to calculate motion: how fast the arrow moves, how gravity pulls it down, and where it will land.

In addition, the way your character runs, jumps, falls, or even slides across a surface is constantly being calculated using rates of change and acceleration, velocity, displacement and time, all core concepts in calculus.

Now, let us say you open a chest in our example game and get an epic sword, but your friend opens the same chest and gets a small pile of coins. This is a consequence of using a mathematical concept called probability in video game design. Role-playing games (RPGs) and battle royales lean heavily on probability. Critical hits, dodge chances, loot drops, or even which enemy spawns are all controlled by probability.

Without it, games would feel predictable and boring, because there would be no thrill in opening loot boxes or suspense in the gameplay.

Take a moment to think about the graphics in your favourite game. The landscapes, the characters, and the realistic environments look seamless, and in some cases, almost hyper-realistic. However, beyond this, they're made of simple geometric shapes. In fact, triangles form the building blocks of almost every 3D model you see in a game. By combining millions of tiny triangles, designers create mountains, monsters, buildings, and everything in between.

Geometry also determines how light bounces off surfaces, creating shadows, reflections, and textures that make the world feel alive. Even in 2D games, geometry shapes the playing field. Angles, coordinates, and grids are used to place objects precisely where they need to be. Whether you're exploring a castle in 3D or playing a classic side-scroller, geometry is quietly holding the game together.

Additionally, think about the enemies you face; they don't just wander. They seem to make decisions, dodge attacks, or chase you down. That is artificial intelligence, but at its core, it's built on logic and algorithms. The math here is about decision-making. Enemies might follow simple rules (if the player is close, attack; if far, hide) or more advanced strategies that adapt to your moves.

Have you ever played a game where one weapon feels too strong, or a character seems impossible to beat?

Let's consider our previous example: say a particular demon boss in our game is nearly unbeatable, and it takes up so much time and effort that it breaks your immersion into the game, turning it into a frustrating experience. That is a balancing problem whose fix always comes down to maths.

Developers constantly adjust values like damage points, cooldown times, or resource costs to keep gameplay fair. These tweaks are based on mathematical testing and feedback. The balance is what makes games challenging without being frustrating and rewarding without being too easy.

It is not just what you see on screen; what you hear is also driven by math. The background music that changes when a boss fight starts, the footsteps echoing in a cave, or the perfect sound of a sword clash – all of these are controlled using patterns and frequencies. Even the way sounds fade in or echo across environments is determined using mathematical formulas. This is what makes a game's atmosphere feel immersive.

The next time you're in math class and find yourself looking at equations and wondering why they matter, think about the last game you played. From keeping score to rendering breathtaking graphics, mathematics controls almost every aspect of your gaming experience. You don't need to solve equations while you play, but knowing that the games you love would not exist without maths might just make the subject feel a little less distant and a lot more exciting.

Bipra Prasun Das is an undergraduate student at North South University

Comments

কঠোর নিরাপত্তায় জাকসু নির্বাচন শুরু

জাকসু নির্বাচনে সুষ্ঠু পরিবেশ নিশ্চিত করতে আইনশৃঙ্খলা বাহিনীর বিপুল সংখ্যক সদস্য মোতায়েন করা হয়েছে। সাদা পোশাকে ও ইউনিফর্মে প্রায় দুই হাজার পুলিশ সদস্য কাজ করছেন।

১ ঘণ্টা আগে