Most Widely Used Programming Language (for games)

Started by
44 comments, last by Inisheer 10 years, 3 months ago

So far I've learned a couple of programming languages that I found out weren't that useful for game development AFTER I put the time into learning them (the concepts certainly helped, though). I'm trying to avoid this mistake again by doing a bit more research first. The first thing that comes to mind is C++, but what programming language have you personally seen used the most in the context of game programming?

Advertisement
While major AAA games often have a C++ engine, they rely on many languages internally. Often they will have one or more scripting languages for game logic, plus additional languages used for tools and ancillary technologies.

Over my own career I have written games of varying quality in every one of these languages:
C
C++
C#
Java (standalone)
Java (applets)
Objective C
HTML + JavaScript
Pascal
Flash
Python
Assembly
COBOL (just one game as I learned the language for fun at age 15...)
Assorted forms of BASIC, including one for a DSP board.

Those are games that I have personal experience with.

Some of those games were very simple, such as 'guess the number' style games. Others were much more complex, including several AAA titles I have worked on. Some were just for fun because I had time to kill -- I worked with a traffic sensor company and we draw a little road that showed the cars as they drove by; I couldn't stop myself and threw in a simple frog-like sprite that could hop around the lanes.


Really it all depends on what you want to define a game as. I recall a comic strip years ago where people programmed two elevator shafts as paddles in a very large pong game.

What programming languages have you used? You should tell us this because we have people who are experience in different languages that can guide you more on this.

In the industry, it varies. AAA triple games use C++ and C for engine. C# for tools. Some of the casual game development company use ActionScript and C# for Window 8 games. I heard you can use Flash for Facebook games. Anyone correct me on this if I am wrong. You can use Java for Android apps.

It really depends on what platform your application is going to be on.

I learned game development with Java for 8 months now so I thought I give you advice on the subject.

Download an open source game project of the given language you are going to use. Look at how the codebase is laidout. In the Internet, you get some awesome games like Pong but their codebase written has horrible coding style. So look for a well-written codebase for a simple game. One of the best way to learn game development is to analyze the foundation of the codebase and start tinkering with the code instead of writing out the code one by one. Then start taking it apart and adding your own code.

Essentially, this step is the hands on work you want to have when learning game programming. Analyzing an open source game project eliminates a lot of the guesswork of what you still need to know to program something like pong. If you know pong, you have a better understanding to write a simple arcade shooter game. You want to improve and deepen your conceptual understanding with every game you write.

Generally, if you want to use C++, you can do that but the other step is learning the library that is compatible with C++. So you are actually learning two things when you are programming games. You will need to learn how to link a game programming library to the IDE you are using with C++. This applies to a lot of programming languages. You don't have to use C++. It really boils down to which language you know well enough out of the other ones you also know.

I used Java and it is a great language to learn for general programming and game programming. Java is one of those rare exception where it does have a built-in library where you can set up the graphics environment for your game yourself or you can also link a Slick2D library that does a lot of the heavy lifting in setting up the graphics environment for you. So you can just focus on the game logic which is very crucial for anyone starting out programming games.

Anyways, the key thing is not getting caught up with which language should I use, but what do I get out of using this language? It is just a tool. Once you learn one, you can apply the concepts you learn to another language while still learning something new.

C++ & Lua and you should be good to go. I'd say these are probably the most common combination of compiled & scripted languages in the "professional" space.

Assuming that you mean Console and AAA PC games then C++. However there are probably hundreds (thousands?) of games released on the web every day using Flash.
Whilst most Mobile games are written in C++ there are a lot of people using Objective - C on the iPhone and Java on Android.

There are of course many who keep telling everybody at games development conferences that the future of games is going to be JavaScript and HTML5.

If you want to work on indie games like me, I'd say the way to go is:

- C# or JavaScript to work with Unity3D;

- ActionScript 3 for flash games (and actualy you can compile and publish flash to android and ios);

- LUA to work with corona SDK (a great engine to develop games for mobile);

I think these are the main languages that I've learned over the years.

And of course there is C++, wich I think is the must know for all game developers.

Keep in mind that "used the most" != "actually useful for your specific needs."



C++ has widespread penetration in the game dev market, but it's also a piece-of-shit nightmare. You can write a game in almost any non-toy language under the sun. Use the language you're most comfortable with, and get things done; fussing about with a dozen languages and never finishing a game is a great way to learn lots of things and never apply them to anything.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I'm extremely biased here because I've been a Flash developer for many years, but I would recommend ActionScript/Flash for a number of reasons:

1. Portability: Between Flash and AIR, your code can reach just about any device and any OS. If you're careful how you code things, the same code can run as-is in both Flash (web) and AIR (desktop/mobile/tablet).

2. Penetration: AIR and Flash combined are installed on some 1.5 billion devices (http://www.adobe.com/ca/products/flashruntimes/statistics.html). Only Java (in the runtime category) comes close to that level of penetration. Practically, this means anywhere Flash or AIR run, your game will run. This includes limited BlackBerry support and, increasingly, smart TVs too.

3. Ease of use / power: I'm not going to pretend that ActionScript code can run at native (C++) speeds, but the runtimes have been greatly improved and run impressively fast. You get access to all of the older Flash APIs as well as extended AIR APIs which, collected, is not easy to stick together into one native game package if you're slapping together disparate libraries. Plus, you're guaranteed that your code will run the same way no matter which device or OS you're running on.

4. History: Adobe has been evolving Flash for many years now. It's a solid product and with AIR, exactly the same skills/language/tools are used to produce apps that run with native privileges. Adobe has built in many great features including direct GPU integration, networking and P2P abilities, fantastic audio support, top-notch video support, and many other features you'll be glad are there once you start building your game.

5. Control: Along with the improvements mentioned above, Adobe has done a lot to "open" up the Flash/AIR virtual machines. This means access to a lot more low-level data which previously would be handled in the background by the runtime. A simple example of this is the sound API which previously could be used to control loaded audio, but the audio data itself remained hidden in memory and protected by the runtime. That data has been opened up as of a few versions ago, opening up raw audio data for applications such as realtime sound effects, software-based audio synthesis, and other useful functionality.

That being said, I would stay away from using Flex / FlashBuilder for producing your game. Great products for coding, but for visual design the old Flash IDE is best. If you're on a budget, FlashDevelop is a great IDE that easily competes with Adobe's commercial products.

At the end of the day, ActionScript is the language that powers both Flash and AIR, and it's also closely related to JavaScript and Java so it's a great "gateway" language too. If top-notch performance is a concern, Flash and AIR may not be the best solution (there's a reason it's called ActionSCRIPT), but you can produce impressive games without the hassle of lower-level languages like C++.

My highly biased two cents ;)

After 2 years of consecutive C++ the other languages (except ASM) are extremely easy to understand.
So go with C++.

After 2 years of consecutive C++ the other languages (except ASM) are extremely easy to understand.
So go with C++.

... and it'll only be another 8 years or so, until you start to understand C++! :p

This topic is closed to new replies.

Advertisement