Beginner Games ProgrammingSo you want to be a games programmer? The only thing better than playing games in my opinion is writing them. Whilst it can be hard work learning to write computer games, it is also incredibly rewarding. Where do I start?You need to learn a programming language. There are many possible languages but to do this properly you should learn C++ as nowadays it is the most common language that games are written in. There are still games being written solely in C and a smattering of assembler but the trend is very much to C++. This is mainly because games have got bigger and more complex. With C++ you can more easily manage and maintain huge amounts of code than with C. Other languages like C# (C sharp) are starting to become contenders. Games written in C# run slower than C++ games (Managed DirectX is about 7% slower) but the advantage (in theory) is rapid development. A 7% drop in speed may be worth it if you get your game out in quarter the time! Microsoft have released XNA which is a set of tools that allow you to quickly program games for Windows and the Xbox 360 console. Programming is done in C#. This may be an ideal place to start learning games programming although if you want a career in games you will still need to learn C++. OK so I learned a language, what is next?The next step is to learn to use a graphics API. An API is a way of communicating with hardware and is often provided free. The two main graphic APIs for PC games programming are OpenGL and Direct3D. They are both very powerful and have pros and cons (often the subject of heated debates). Most commercial PC games are written using Direct3D. Direct3D is an API that is part of the DirectX SDK that is freely available from Microsoft (see DirectX Q&A). The SDK contains other APIs for input, sound, music and video. What about a formal education?When I was a kid all I wanted to do was write computer games but there was very little material available and certainly no formal education. I did a computer science degree which was quite useful but nowadays you can actually do a degree in games programming. I wish that had been available when I was younger! There are quite a few Universities around the world now running courses at undergraduate and post graduate level. In the UK the top two Universities for games programming are Teesside (where I lecture!) and Abertay. Hull is also apparently good for postgraduate learning. A lot of Universities have unfortunately got on the band wagon a bit and set up poor quality game programming courses. My advise is that if they do not teach you C++ from year 1 avoid them - they are not for people seriously looking to get a job in games. Also check that they have lecturers from the industry and good industry connections. What about maths?The amount of mathematics required to program computer games varies a lot depending on what you aim to specialise in. A normal games programmer will have good skills with vectors and basic maths but does not need to be an expert mathematician by any means. If you are wishing to work in graphics then higher maths skills will be needed as they will if you plan on working on physics. The bottom line is that I would not let a fear of mathematics put you off games programming. So is that all there is to writing games?Not by a long way. There are a lot of skills and knowledge you need to obtain - however it is great fun just learning. I used to work as a games programmer and now lecture on the subject. I have used this site to hopefully pass on many of these skills. There are also many other sites on the Internet that can help you and nowadays there are also a lot of books available. One of the big issues I observe with new games programmers is when they have learned to do the graphics but then come to putting it all together. This is really a software engineering task and again I try, on this site, to pass on some of my knowledge in this area. I hope to add more on this in the future especially as I am planning on carrying out more formal research on games software design. Now I want a job!Getting a job in the games industry is the dream of many people. I used to work as a games programmer and also occasionally interviewed potential candidates. I have passed on some of this knowledge on my Industry page. Final WordWe all learn differently. Some of us learn best by reading books, others learn best by example. Find out how you learn and use this knowledge in your choice of learning materials. Don't give up! There will be points where you will be ready to give up. You are bombarded with so much new information that it can seem too much. However stick at it, break problems down into smaller steps, and one day your name could be on the next big release - good luck! How can this site help me?The pages on this site can take you from a little C++ knowledge, to setting up a DirectX application, through to 3D graphics, techniques like collision detection and into other areas like music and video play back (a full index can be found here: Games Index. I do not teach C++, there are many good sites and books that can help you there. Once you know some C++ this site can get you up and running with the DirectX API and on to writing games.The best way through these notes for the beginner is: - Learn enough of the Windows API to act as a base for DirectX
- Learn how to set up the Direct3D API
- Draw some sprites and learn about textures
- You are now ready to program 2D games, visit the 2D Games page for useful techniques.
- If you are looking to create 3D games then visit the 3D rendering section where you will learn about rendering triangles, using the z buffer and the Direct3D matrices.
- Look at some of the more advanced graphic techniques like animated 3D models, lighting, skybox, camera, terrain, picking and collisions.
You can search this site using the search box that can be found at the bottom of each page. Once you have worked through the above you are well on your way to being able to create games. After creating the graphics you may wish to add music and sound effects and handle input. There are also pages describing general game programming techniques and specific graphics techniques. Further Reading- See the resources page for some books about learning a language and useful links.
- Teesside - University of Teesside main page and here is the page for the game courses. We run courses in games programming, games science and graphics science as well as the more arty subjects of game design and games art.
|