5 minutes read
How To Create a Video Game: Choosing a Programming Language

How To Create a Video Game: Choosing a Programming Language

Many software developers will tell you that the reason they got into programming in the first place was because they wanted to create video games. Even after being in the field for some time, many still want to use their skills to create a new and exciting game for others to enjoy.

What is actually involved in creating a video game? What programming languages are used to create video games? How are the graphics and other visual elements created? And what tech is involved in creating multiplayer games and distributing them? In this five part series, we’ll look at each one of these areas in depth. First, we’re going to look at the different programming languages that games are written in, and which language you need to learn first in order to develop a game.

Video Game Platforms and Coding Languages

The first thing you’ll need to decide when creating a video game is what platform to develop it for. Each platform has one or more preferred programming languages, as well as a unique set of tools and software that will be required to build a video game.

In this series, we’re going to focus mainly on PC video games created for Windows. But we will mention other platforms and languages that you should be familiar with, especially if you’d like to pursue a career in video game development.

“How

Mobile Gaming: Java and Swift 

Mobile video games have taken the industry by storm. More than 2 billion people — ¼ of the world’s population — play video games on their mobile devices. So game developers have rushed in to supply the demand.

Mobile games can take different forms. Some are mobile-adapted versions of well-known games, like Minecraft Pocket Edition. Others have launched their own viral franchises, like Angry Birds. In either case, lots of design, development and testing go into mobile games to ensure a smooth experience with good performance on the less-powerful hardware found in phones and tablets.

Mobile games are generally written in the preferred language of the mobile platform they’re targeting. For iOS, this means Apple’s Swift language, or Objective-C for older games. For Android, this means Java, or the Android-specific variant Kotlin.

Mobile games can also be developed using game engines that are designed to work cross-platform. Platforms like Unity and Unreal Engine allow developers to write the game once and build it for both Android and iOS. This also gives developers the advantages that come with using a game engine (more on that later).

Browser-based Games: HTML5, CSS and JavaScript

While some may not consider these “true” video games, browser-based games are still very popular. In the past, many browser games were developed using Macromedia (later Adobe) Flash or Java. But both of these platforms have fallen out of favor as browser plugins, mainly due to security issues that plague both of them.

Fortunately, though, the capabilities of modern browsers has advanced significantly over the years. By using modern web technologies like HTML5, CSS3 and JavaScript, browser-based games can be just as interactive and visually appealing as Flash games.

Browser-based games may also make use of JavaScript frameworks and libraries, like Node.js and Angular. These frameworks help developers to build games more quickly and with more functionality than having to do everything from scratch.

Console Games: C or C++ 

The big players in the video game console market — PlayStation, Xbox and Nintendo — each provide their own software development kit (SDK). An SDK includes tools and software to build games specifically for that console. Often it includes a modified version of the console that can be used to test unfinished games.

Underlying the SDK, however, in most cases is C++. This allows the SDK to use proven software development tools like LLVM and a programming language that many developers are already familiar with. The console SDK also has extensions and libraries that allow developers to use the specific hardware of that console — the graphics processors, controller features, and other unique parts of the console experience.

PC Gaming Honorable Mention: Java and C#

Some cross-platform games have been developed in Java. Minecraft is one of the most popular examples, with millions of copies sold. RuneScape is another popular game written in Java. This allows the game to be run across multiple platforms without needing to recompile or make many changes to the software. However, Java has not caught on for video game development, and so remains the exception rather than the rule.

C# (C Sharp) is a Microsoft-developed programming language that has become popular with Windows developers. It uses the .Net Framework to run “managed code” — code that uses a collection of pre-built libraries to handle many low-level functions. Microsoft has created a game engine called Unity, which is programmed in C# and can create multi-platform games. However, outside of Unity and a few other titles, C# has not become popular with game developers.

Why C++ is the Language of Choice for Video Game Developers

After discussing the different gaming platforms and the languages they use, you may feel a bit overwhelmed. However, the simple truth is that the majority of video games, especially big-name AAA (“triple-A”) titles from big-name developers and publishers, are written in C++. There are a number of reasons why C++ has remained a popular choice for video game development over the years. Here are just a few.