Computer Science In Gaming

I studied computer science for 3 years to get my degree. I also started my game development journey during that period, and the one thing that I can tell you confidently is that computer science is deeply rooted in game development.

Computer science is an essential part of gaming. Algorithms, data structures, complexities and optimizations, math, programming, and many other computer science related fields are all concepts and tools that are heavily used in the process of making video games

Computer science concepts in gaming

The following is a list of some of the things that you learn as a computer scientist, and apply as a game developer.

1- Programming

Programming is at the heart of game development, and software development in general.

Building video games involves writing a lot of code, A LOT.

I have tried building websites, mobile apps, backends, and desktop apps before. In general, I found myself having to write a lot more code when building games than when I was working on any of the other mentioned software.

Obviously it all depends on the size of the projects that I worked on, but I believe that it takes a lot more code to build a video game than to build many other kinds of software.

If you have 5 enemies,  each with a different behavior, you’ll need unique code for each one of them. If you have 10 weapons, each with slightly different behaviors, you’ll also need unique code to reach one of them and the list goes on.

Now imagine how many types of enemies, vehicles, doors, guns, and animals triple-A games have, and we haven’t even scratched the surface.

I think you get the point, building games requires a lot of coding, and as a computer scientist, coding is a skill that you already possess.

You definitely won’t jump into making AAA games immediately, however, even small to moderately sized games will still contain a lot of objects and systems that require unique functionality.

But that is not something to worry about as a computer scientist. Programming is one of the first things that you learn in computer science. 

It doesn’t matter what language you learn, what matters is that you learn the core principles and rules that generally apply for all major programming languages.

If you are interested in knowing the best programming language for game development though, then you can check this article.

Here are some notes before we move on to the next thing on the list:

You can build video games without coding as there are a number of game engines that support “visual scripting”. However, visual scripting is just “simplified programming”, and learning the core concepts of programming is essential for building video games.

You can also join the gaming industry without having to know a thing about programming, but you will most certainly not be on the engineering team. Game designers, artists, writers and others do not need any programming skills to become part of the gaming industry.

2- Advanced algorithms and data structures

Building video games is all about solving problems. While this is true for any other software development process and not just video games, what makes video games different is that games are more likely to have unique problems that are rarely seen somewhere else since every game world has its own rules and its own mechanics.

With that said, having an understanding of how algorithms work, and how to translate these algorithms into code is extremely useful.

For example, the A* algorithm is a famous one in game development. If you have an enemy that follows the player and attacks them, chances are this enemy needs to know how to pick the shortest path towards the player, and how to avoid obstacles along the way.

A* is the perfect algorithm for this kind of problem since it is all about finding the shortest path from one point to another point.

There are times when you find yourself in situations where none of the algorithms that you know would solve the problem that you are facing, and this is when you either have to go do some extensive research, or figure out an algorithm by yourself. 

This does contribute to making game development hard, but this is also what makes game development fun.

Computer science is all about algorithms. My computer science background helped me a lot when it came to figuring out the best algorithms to use for the problems that I was facing. 

Data structures is another area that involves both computer science and gaming.

Knowing what data structures to use to efficiently store level information, progress, inventories, active quests, player stats, enemy stats, and so much more, is an essential part of game development.

3- Math in general

Have you ever complained about being forced to study math rules that “you will never use”? Well, some of these rules will end up saving your day if you decide to pursue game development.

I regularly find myself scrolling through my old university books trying to find the math rules that I know will help me solve the problem that I am facing at the time.

As a computer scientist, you get to learn linear algebra and matrices, numerical computing, calculus, discrete math, statistics and many other math fields.

Most/all of these math fields have their application in gaming. I have dedicated articles talking about the importance of algebra and calculus in video games.

Other math fields are also extremely important too. For example, statistics is very important for dealing with randomness in video games and so on.

4- Complexities and optimizations

Using the Big O notation to deal with the complexity of algorithms is a major part of computer science.

You often need to know the worst case scenario for an algorithm in terms of how much time it takes to execute, and how much memory it uses. You also check the best case scenario and the average case scenario as a computer scientist based on the actual problem that you are trying to solve.

This can be extremely helpful in gaming. Performance is a huge thing to worry about when developing video games.

A drop in the frame rate of a game can destroy the player experience. With that said, as a game developer, you always need to keep in mind the impact of the algorithms that you are using on the performance of the game, and your computer science background can help you do that.

CONCLUSION

If you are a computer scientist who is thinking about game development as a career choice, I’m happy to let you know that it won’t take you long before you can get started. 

You can actually start right now by learning how to use some of the best game engines.