You want to get started with game creation and programming but don’t know where to start? That’s what this series is all about!
This first part is for you if you have little to no programming experience. You’re going to learn:
- That you should learn programming foundations first
- That Programming is for everyone. It’s not just about math and it’s not just for men or young people
- How to get started today
Take it one step at a time
Game creation can feel overwhelming at first. We’ve all had a tough time getting started whether we remember it or not.
To make games alone you have to learn both:
- Game design, how to come up with interesting mechanics, rules, and goals for the players
- And programming, or how to translate your design in a language that the computer understands
That’s a lot to tackle all at once! Like any creative discipline, it takes time. Don’t worry though: learning can be a fun experience!
You may not be able to communicate your vision at first and you’ll stumble upon obstacles along the way. But you’ll also have plenty of “ah-ha” moments and deep satisfaction when your family and friends get to play your games.
When you are just starting out, you should focus on code and game design separately. Be it in parallel or one after the other, you should learn the basics, write a few programs, design simple games on paper… then bring both disciplines together to make video games.
That’s what we’re going to explore in this series, starting with programming.
What do you want to create?
To stay motivated it’s best if you understand why you’re learning and what your objectives are.
What drives you to create your own game? Take a moment to think about the following questions:
- What game do you want to make?
- Are you doing this for fun, as a hobby, or to become a professional?
- What do you need to learn first to achieve these two goals?
There’s no right or wrong answer here. Here’s how I got started, a long time ago:
I want to create a small RPG inspired by Japanese games for fun, finish it, and share it with my friends. I want to do everything so I need to learn to do game design, to write a story, to code the game, to draw characters and environments, to design levels, to make sounds and music, … err, where should I start?
It was a lot to take on alone but this goal became the beacon that guided me all these years: I’ve built foundations in all of these domains to some degree. Jack of all trades, certainly master of none! It took me a long time to be able to make games as I got into programming last.
You will have to be patient. Start small and hone each skill you need separately. You don’t have to do everything all alone either. With a little bit of experience you can team up with complementary game creators during game jams for example.
Let’s assume that you want to make video games by yourself. Maybe it would just be game prototypes that you can try out with your friends and flesh out with the help of a developer at a later stage. You’re going to have to dive into code, but…
To code games, you need programming foundations
If you jump straight in a game editor and try to write code you’re in trouble. A game engines is a large collection of technologies that add hundreds, if not thousands of new tools and functions to learn on top of programming foundations. You’re going to get stuck often and you’ll hit frustrating roadblocks. If you don’t know what variables, functions, loops, objects, and classes are or how they work to some extent, you’ll want to build solid foundations first.
You need to write code to become a developer. Many beginners are afraid to write code that breaks. You won’t break your computer. Sure your app will crash and there may be bugs but that’s okay. You can only learn by trying.
To get good foundations you should:
- Learn your first language and get a sense for basic programming tools like variables, functions, loops, and classes
- Write simple programs like text-only interactive games or scripts to automate boring tasks on your computer
- Read code from other people and try to understand what it does
Keep the KISS principle in mind to avoid frustration: Keep it Short and Sweet. You can learn fast with short focused practice sessions.
The first language you’ll learn isn’t that important
There are hundreds of programming languages out there. But it isn’t that bad: by learning one language you learn a lot more than syntax. You’re going to learn concepts like variables, loops, and objects that work about the same in most programming languages. C++, Java, C#, etc. have a lot of similarities so moving from one to the next won’t feel like starting over again.
Learning a given language is a small part of learning programming. As you gain experience, you’ll acquire more and more knowledge that you will be able to transpose across tools and languages: how to structure your code, how to avoid bugs, how to learn on your own with a programming manual or reference…
Programming is for everyone
You don’t need to start with a tough, low-level language like C++. When I was in middle school, a more experienced developer taught me C++, his argument being that it is one of the most widely used languages. At the age of 14, I got a 1000 pages long intro to C++. I had a horrible experience reading it and concluded that programming was not for me. I was disgusted from programming and stayed away from code for years.
I got back into code with Construct 2’s visual event system, working as a junior game designer on mobile games. The engine’s creators sold it as a programming-free engine. That seemed perfect for a designer like me!
There are different types of developers, and different paths to becoming a developer. There are languages, programs, and technologies that will prove to be a better fit for your skills and what you want to make.
Programming is for everyone. You don’t need to be a man, to be young or “gifted”. If I had started earlier I would’ve avoided a lot of obstacles in my career. It’s a myth that we should debunk right now.
Women can code just as well as men. Designers and artists can also code. Again: programming is for everyone. You’ve just got to find the tool that’s right for you.
Don’t start with C++
Unless you like to learn the hard way, you don’t have to start with C++. C++ is a complicated, feature-packed language designed to write code that runs fast. It’s not meant to be accessible. It’s not meant to be part of your first programming experience. Especially if you are young and don’t like math or if you are not very comfortable with a computer. Lucky for us, it’s not necessary at all to get started with programming or to become a professional game developer.
There are different types of developers: some like to code for the sake of it while others are driven by projects. You shouldn’t be discouraged if you aren’t part of the first group. I don’t like math, or programming in itself, it’s ok : it doesn’t prevent you from creating games.
There are thousands of ways to code. You don’t have to do complex math to build games. You can challenge yourself with complex algorithms if you want to. Or just animate characters moving on the screen!
Even if it feels scientific at first, programming is a creative problem-solving activity. There are always multiple solutions for a given problem. In an upcoming guide in this series you’ll learn about a paradigm, a set of mental tools to structure your code called Object-Oriented Design. As the name suggests it involves design work. Keep this in mind as you’re taking your first steps: doing code is not just about maths. I am a designer at heart and I enjoy programming.
Visual programming is still computer code
Do you feel uncomfortable writing code as text? At first that’s normal; you’re learning to communicate with a machine using a foreign tongue.
You may be tempted to stick to visual programming tools, thinking it’s not really programming but it is. Whether you use Scratch, Clickteam Fusion, Unreal’s Blueprints or anything similar, you already have some programming experience.
As a beginner the main differences between text-based and visual programming are:
- Visual programming is a little more accessible at first, as it is visual in nature, but is often slower to write and manage as your code gets more complex
- With text-based code you can make typos. Unlike us, a computer can’t make sense of a keyword if you swap two letters.
- But modern code editors are here to help: they smartly autocomplete keywords as you type, they can tell you when you’ve made a mistake and often even highlight issues for you.
- As with every discipline, practice makes perfect: the more you write, the fewer typos you’ll make.
In my experience working only with visual languages does not scale well. As your projects grow in size, visual languages will become more inconvenient. They’re often slower to use than text as you end up navigating through menus and connecting blocks to do basic operations.
To give you an idea the VisualScript example above only takes 2 lines in the text-based GDscript language:
func _process(delta): position += direction * speed * delta
You will only see the drawbacks of visual code after you have learned and gotten comfortable with text-based programming. It is okay to start with visual code. Just don’t count other programming languages out because they’re harder for you to get started with. As a designer I’m glad I made the transition: it felt a little uncomfortable at first but I never looked back.
I recommend to start with Python
As a game development tutor, I see so many beginners jump head first in an engine and fail. They follow step-by-step tutorials or copy-paste code from demo projects hoping to build their own dream project. As they lack programming foundations they get stuck as soon as they tweak a line of code. Doing that, you mostly end up wasting time and building up frustration.
Coding is like writing in a foreign language: you’ve got to learn some basic vocabulary and grammar first, use everything you learn as often as possible in order to commit it to memory, and take your time.
Be patient. It won’t take too much time before you can get started with game programming. Try to spend about 20 hours focusing on programming basics. Then you can start having fun with game development if you want. Just don’t forget to keep building and sharpening your core programming skills in parallel!
I recommend to start with Python for at least 3 reasons:
- You can create all kinds of programs with it: automate tasks on your computer, code web applications, science applications, even games…
- It has a huge active community. Python is taught in many schools and universities so it’s easy to find good learning resources for teenagers and adults alike. My friend Chris Bradiel even teaches Python to kids!
- It is easy to approach thanks to its simple syntax
Python looks like this:
numbers = [2, 4, 6, 8] product = 1 for number in numbers: product = product * number print('The product is:', product)
With these instructions the computer calculates the product of
1 * 2 * 4 * 6 * 8 and tells you the result:
The product is: 384
Python is great to get started with code. For aspiring game creators it’s also a reliable tool: it’s the most common language to write plug-ins for graphic applications such as Blender, Krita, and Gimp. This is not only true for Free Software: large 3D applications like Maya or 3DSMax also let you write new features with Python.
During the last Europython I’ve met companies who use Python in game development work. Crytek and EA (Frostbyte) use it in their assets pipeline, the build system, and automated tests.
As explained earlier, we’re talking about your first text-based language here. It certainly won’t and shouldn’t be the last you’ll study. Python is a good stepping stone on your learning journey: it’s a middleground between visual programming languages like Scratch and strict ones like C++.
You’ll find few games written in the Python language. Game development companies mostly use Python for the creation of tools outside of the game engine: everything that has to do with processing art and other assets to use in the game for example.
Various studies show that the number of Python developers is growing steadily year by year. […] Many people are starting to use Python for data science and machine learning.
Two resources to learn to code for free
I don’t want to flood you with a long list of resources. Instead, here are two free courses that I recommend.
Harvard’s CS50 open course
CS50 is a free course that will teach you to think like a programmer. It doesn’t focus on a particular programming language, although it includes Python. Instead, it explains what programmers do and focuses on the most important techniques and tools you need to learn to become a programmer. The course is designed for programming beginners. Each lesson gives you many details on why things work in a particular way.
Automate the Boring Stuff with Python
Al SwiePut your new Python knowledge to good use with this free book! It is a collection of nice tricks to make your computer work for you. Need to rename many files in a complex way or automate web searches? Each of these programming drills will help you better understand your computer and the Python language by giving you new tools to save time in your future projects.
The Python community also put up a nice guide to help you go further with the language.
That was a long article, right? If you should only remember a few key points:
- You’ll need some programming foundations before you can make your own video games
- Learning to code may feel hard at first but it will get easier with practice
- You don’t have to start with a difficult language
- Code is for everyone. Not only people who like math, not only men
- Learning to code is a bit like learning a foreign language. You’ve got to write and read a lot of it to become comfortable
It is time for you to use the resources above and to start building your programming muscles! Pick one course, learn in short, focused sessions, and try to practice on your own to learn most efficiently.
In the next part we’ll get started with game design. You can find me on Twitter if you have questions!