Game Programming Guide - Tips, Tools and Careers

Game Programming Guide

A game programmer is the person that takes a designer’s vision and gets it to actually work in the game engine we use. I work in the mobile game programming team at Kwalee, so for us it’s primarily Unity. For example, if the designer wants a dice to roll in a particular way, I’ll write the script to handle the logic. We also collaborate with game artists to make sure our games both look amazing but also achieve great performance on device.

 

In this blog, I’ll draw on my five years working at Kwalee to share essential insights and advice about being a game programmer. I’ll walk you through some of the languages, tools and principles we use, my career advice, as well as beginner and advanced tips.

What does a game programmer do?

We write the code and help the game become a reality. While game designers create the concepts and game artists create the assets, a programmer will create the functional, playable experience. We create and optimise the game’s performance and troubleshoot any issues that are identified.

 

We ensure that a game feels great and runs with a high performance. To do this, we have to ensure that the code itself is clean and expandable, which is harder than you think. We use coding standards to maintain consistent quality across all our teams - a document that may contain naming standards, formatting etc. However, sometimes things aren’t always as straightforward and from time to time you may need to think outside the box to get things done on time.

 

Our responsibilities also include making sure the game runs well on the end-user hardware. For example, in our mobile games, we need to avoid older devices getting too hot, so we work with artists to optimise the number draw calls. A draw call is a command sent from the Central Processing Unit (CPU) to the Graphics Processing Unit (GPU) to render an object on the screen - it tells the GPU to draw graphical elements like textures, meshes or shaders. We need to minimise the number of these draw calls in our game because having too many can cause issues like frame rate drops or stuttering. There are many ways of solving this, but things like batching multiple objects into a single draw call or reducing the number of unique textures and materials can all help. This is especially important for mobile, as there are so many different devices on the market, all with varying technical specifications. 

 

What are the main game programming languages?

Most of our time as day-to-day game programmers is spent scripting in one of a range of programming languages - we are software developers of a different type after all. There’s lots of languages to pick from. Some seem easier than others, but once you’ve learnt and mastered one, you can definitely learn others - the main challenge is getting your foot in the door.

 

Here’s an introduction to some of the most popular game programming languages:

 

  • C# - a versatile and popular programming language used widely in game development. It’s one of the easiest to pick up if you’re a beginner. One of its best features is automatic garbage collection - so it manages memory allocation for you - very useful for busy programmers like us.
  • C++ - in contrast, this is an unmanaged language, so you have to manually allocate and deallocate memory, which makes it a bigger step up in complexity and difficulty. However, it does allow for greater speed, control and performance.
  • Java -  like C#, Java has its own memory management and garbage collection, making it easier for developers to handle memory without getting too bogged down in the details. It’s widely used in web development and enterprise applications, and while it may (arguably) not be the top choice for game development, it remains a solid option for creating scalable and efficient applications.
  • Swift - this is Apple’s native language for building apps and games for iOS and macOS. However, this means it’s less useful for cross-platform development - since we aim to always publish our mobile games on both Android and iOS.

 

How do you become a game programmer?

There’s a range of different ways you can become a game programmer. My route is pretty conventional - I studied Games Design and Programming at the University of Staffordshire. Originally, I thought I was going to go into game art - I was always very passionate about art as a child, plus I really enjoyed the art modules at university, but whilst there I discovered that I really enjoyed creating gameplay. It could take me several days to create a single high poly model, but I could make a duck fly and explode in half the time. Prototyping lets me see the result quickly right in front of me.

 

However, the beauty of programming games is that  it's accessible to most people even if you don’t come through a traditional route. I had friends at uni aged 50+ - it’s never too late to experience something new. At Kwalee, we’ve even hired someone who learnt primarily through YouTube videos and made a game for the fun of it. There’s so many opportunities for fresh and eager talent today. Looking at portfolios of newer students, they’ve got so much more under their belt. We see fantastic talent come through and it’s an exciting time in the industry.

 

A question you’re probably keen to ask - will AI affect programming as a career? It can be extremely useful, and it’s getting better. Perfect if you need something explained or you’re stuck in a problem. You can use it to troubleshoot bugs, or refactor (‘clean up’) your code by pasting it in the latest ChatGPT. However when we look at portfolios we want to see the work you have done and are proud of, AI is fine to use, but try not to use it as a replacement for your own skills.

 

What is a typical day in the life of a game programmer?

Let me give an example based on my life. I’m a Lead Programmer (I call it my dream job) so it’s a great mix of hands-on and managing other programmers!

 

A typical day in my world is to get in, get a latte, then double check any bugs or blockers for the QA team. Check with the team to see if anyone needs me to do anything to unblock their work. Then the music goes on and the tasklist goes up. We’ll share progress videos via slack to get quick feedback, whilst also bouncing between 2-3 projects to support members of my team. We also spend a lot of time investing in shared systems to make our programming more efficient - it all needs to be maintained, updated and fixed regularly to keep things running smoothly.

 

Beginner game programming tips

If you’re starting out and aspire to be a fully fledged programmer, here’s my beginner tips!

 

  • There’s so much to learn online, on YouTube and there’s so many example games that you don’t have an excuse not to learn! The popular engines are free and are a lot of fun to use!
  • At the complete opposite end of the spectrum, it may be 30 years old, but you should try and read the influential book "Design Patterns: Elements of Reusable Object-Oriented Software" by the so-called Gang of Four authors, which introduced some of the foundations of game patterns we use everyday in programming.
  • You may have your own ideas, but make sure you start simple so you’re grounded with the basics.
  • When you’re not tied to a commercial project, you can write as much code as you like, so have lots of fun creating insane things.
  • Building a portfolio is really key (and it’s how I got my job). But be very careful not to just upload the same old bog standard uni work, because we’ll see lots of applications with these. Even spending an extra day of reskinning and adding more features will help you stand out.
  • Creating your own real world game is also a smart idea - it’s very cheap to get a game on Google Play, so get something released that you can show recruiters/publishers/family/pets on your phone. You may even make a few thousand dollars a year until you’re set up with an exclusive full time gig, that’s a bonus! Or it might tempt you into making your own full blown game and partnering with a publisher.
  • Don’t just learn about programming - learn about art, design, QA and other disciplines you’ll interact with. For example, it’s worth understanding QA methods because you can fall into the trap of assuming something works, but you need to play it as a user, not as someone who wrote the code and has a defined view of how you expect it ‘should be played’. Be destructive, try the random things people might do, smashing random buttons and other bizarre behaviour.

 

Advanced programmer tips

Here’s some of the tips that have helped me go from junior, to programmer, to senior to lead.

 

  • You can always benefit from more learning, and remember that without mistakes we cannot learn!
  • If you are really passionate about something - you could become more specialised. For example, if you love playing with shaders and render pipelines, learn more about how to use graphics shaders to expand your ability to render complex visual effects and use render pipelines to optimise performance or to make some awesome effects.
  • You could make something really cool, like a complex system, upload it to an asset store to showcase it if your contract allows and show off your advanced work. You could develop a niche as a particular type of programmer, such as a gameplay programmer, server programmer, graphics programmer or multiplayer programmer.
  • Alternatively, you can go down the management route like me, and mentor people. My tactic for progressing my career has been to absorb new responsibilities. First, I started improving smaller things, i.e. small workflow changes.. Then I made processes easier by using templates to save time when creating new projects. Then I got a taste for mentorship and management, which helped me gain more confidence and now take part in peer reviews, code reviews, hosting workshops and leading teams on projects.

 

Whether you’re working as part of a team or as a manager, it’s just as important to give praise as it is to give constructive criticism. When reviewing code, it’s good to hype people up!

 

What are the key principles of game programming?

There are some key topics that simply have to go into a blog covering game programming. These are some of the most important things we consider.

 

Source Control/Version Control

Just as you have save points in games, there are save points in project development. They act as general storage for the project and mean that three or four programmers can work on a system simultaneously, create a change and push it to the server. It allows us to track those changes and easily roll back if anything were to break. If two developers work on the same file, that file will become part of a merge, if there are conflicts we can then manually resolve them or pick an individual's changes to apply. This will happen a lot when using Prefabs or Scenes within Unity.

 

These terms sometimes overlap, but generally, source control focuses on the code and version control includes all the project files, assets and documentation.

 

When you first start using Source Control it can feel a little scary to begin with, it can seem very overwhelming and when it comes to conflicts you may find yourself unsure on what to do. But the nature of version control helps you save moments in time, so if you’re frequently updating and using detailed commit messages, it’s incredibly useful and safe. You can revert to multiple points, have multiple branches etc. Think of it as the developers safety net, so we can avoid a version of Pixar’s Toy Story 2 - accidentally deleted and then recovered from a hard drive at the home of their Technical Director, instead its all safely there on the server.

 

Object Oriented Programming

This is the type of programming we primarily use at Kwalee. It uses objects to represent real things, or abstract concepts, and aims to organise the codebase using principles that mirror how we see and interact with objects in the real world. It helps maintain complex systems by organising code into distinct classes that you can reuse, scale and maintain more easily.

 

Of course, there’s debate on whether it’s good or not. While it’s not the highest performer, it works well. Just as with languages, each has its own pros and cons and you should learn one to start off and get a grip of how languages and compilers (translators of human code into machine code) work. You can also consider other types, such as functional programming which treats it more like maths, logic programming which uses facts and rules or procedural programming which uses step-by-step data.

 

Programming Patterns

These are wonderfully useful things - reusable solutions that can help with common problems you’ll face in your software design. They give you a template to fix an issue, so you don’t have to reinvent the wheel each time and can follow proven solutions.

 

For example, the Singleton design pattern helps you ensure there is only one instance of a class such as a game settings manager throughout your entire game, and gives you a global access point to it. The code for this pattern means only one instance of the SettingsManager class exists so you don’t need to recreate or duplicate it every time you need it.

 

There is also the Factory Pattern which can help you create objects in a more organised and flexible way. You can define methods for generating specific types of objects, like characters or items, based on input parameters, allowing you to easily create more objects of a similar type without starting from scratch each time.

 

I hope this blog has given you a taste for game programming, whether you’re new to the field or an experienced programmer! If you’re a hardworking but fun person, you’d suit our team so find out more about Kwalee careers. Otherwise, you can learn about our mobile games or publishing and get to know more about what we release as a developer and publisher.

Tags