In what programming languages are the most famous games written?

Gaming is one of the most diverse industries as far as technology is concerned. Just like there are athletic brands that separate their product lines to cater to different sports and activities, video game development is as varied as the number of platforms used to play them on. From consoles like Xbox and PlayStation and handhelds to PCs and mobile platforms, game developers have to cater to a very diverse audience.

Nowadays, mobile platforms such as iOS and Android comprise the biggest market for video games with most developers making it a point to release an Android or iOS version of the game they develop for the consoles/PC. So it becomes very important for the developers to choose the right coding language for their game development.

Programming Languages Used in Video Games

Most console programming and game programming is done against third party tools called middleware. These tools provide an abstraction of the platform they run on and built-in conveniences that handle modeling the game world (physics, particle, lighting, audio sources, etc) so all the developer has to focus on is basically telling a story using the tools. They have to make the graphic assets and stage layout and AI logic and so forth and so on. But there’s much less to do than what you’d have to do programming directly using the console SDK (software development kit).

Take the Unreal Engine for example. You can use C++ for development or you can program your entire game using their scripting language. While another popular engine, Unity uses C# as the primary coding language. Most games on Xbox, PS4, iOS, Android, Mac, and PC use either of these two engines for game development.

Popular games like Metal Gear Solid 3: Snake Eater, The Elder Scrolls V: Skyrim, Dark Souls, Grand Theft Auto V are all built using C++.  All AAA triple games use C++ and C for engine and C# for tools. Some game developers use ActionScript and C# for Windows games. Facebook games are generally written in Flash though Flash is fast disappearing and the all popular Java is used Android games while Swift is the popular choice for iOS games.

C++ is the preferred choice of game developers for a variety of reasons. It comes partly from tradition and the fact that you can get a lot of C++ coders to work on the game development. But the biggest reason is that C++ object-oriented and compiles to a binary executable file, and is incredibly “portable” that is to say you can roll out C++ written games on multiple platforms easily.

It is also faster to develop in C++ than it is to code games in native Assembly language like Atari and Nintendo games of the 80s and 90s. Assembly language or machine code is hard to learn, tricky to debug and takes a long time to reach a finished state. It’s more cost effective if you use C++ as development times are shorter, debugging is easier and the code can be modular and portable.

A lot of popular games use scripting engines internally; by far the most popular seem to be Lua and Javascript. Old text adventures like Zork are usually run on virtual machines; the one Infocom games used is called the Z-machine and is usually programmed these days in Inform. There are other similar environments like Twine, TADS, Hugo, and ScummC (the last of which is designed to compile to the engine used in old LucasArts adventure games).

Indie games are a different matter. Games like Minecraft are written in Java, and simple browser games use Ruby-on-Rails or plain old HTML for coding.