Game programming
From QAOP Wiki
Contents |
Getting started
Languages
To code PC or console games then the most important language to learn is C++. It may be easier to start with C, (a subset of C++) in which case the Stanford University Computer Science Department had some very easy to read documents. After covering the essentials and pointers and memory the linked list basics and problems and binary trees. C++ For Game Programmers starts by building from C to C++ very quickly and effectively, then goes on to teach the finer points of the language.
After you know how C++ works and you are actively using it you should buy Effective C++ and More Effective C++ by Scott Meyers. These book are collections of short "items" that each cover a specific topic of C++ programming with the accessibility, clarity and depth that you will find it hard to find elsewhere. Get in the habit of flicking through these books and reading any items that are relevant to your current interests and you can't go far wrong.
Game programming
I've put together a simple little code-base to help get people started. A Space Invaders style enemy bounces around the screen and the player can move his ship with the cursors. The source code is set up in a Visual Studio 2008 solution and uses [SDL http://www.libsdl.org/] (included) to take the pain out of getting a window open, graphics drawing and user input. I hope it should just work. I've included a little readme in the source to explain some of the programming practices used.
The best way to learn is by example. Wikipedia has a handy list of list of open-source video games.
Essential reading
If you are interested in game programming then you must buy and read Game Engine Architecture by Jason Gregory. The author is a programmer at Naughty Dog, the studio behind the fantastic Uncharted 2: Among Thieves for PS3. The book is an excellent introductory text in game programming, but assumes you can already program. The section on animation is particularly excellent.
Mathematics
A solid vector maths library is essential for programming 3D games. Writing your own can be a real re-education in vector maths, C++ and software engineering. Several books cover the topic well, including the excellent 3D Math Primer for Graphics and Game Development by Fletcher Dunn and Ian Parberry. However, at the end of the day you need a fast and solid vector maths library, in which case you could do a lot worse than to use the Sony Computer Entertainment SCE Vector Maths Library which is available as part of the Bullet Physics SDK. To quote Erwin Coumans from the Bullet Physics Simulation Forum:
"Sony Computer Entertainment Inc. contributed Vector Math library and SIMD math library as open source under the BSD license. Bullet physics SDK will be the main repository. Vector Math was previously only available to licensed PlayStation 3 developers.
Vector Math provides linear algebra useful for 3D graphics (vector, matrix, quaternion). SIMD implementations for PowerPC PPU, Cell SPU and x86 SSE are available, next to a portable generic scalar version. You can read the overview document on-line. Reference manuals and documentation is included in the doc folder.
...
Both libraries are included in the Bullet distribution under the Bullet/Extras folder, available from Bullet 2.55. Download Bullet physics SDK."
Game physics
I have put some of my own notes on game physics in this Wiki. I don't aim to replicate the work of others, I merely aim to bring together information from different sources in to cohesive and comprehensive articles.
Debugging
Software
See useful software.
Design
UML is great for visualising the interactions of components in softward. Great game-oriented overview of in Buckland, "Programming Game AI by Example", Appendix B.
Audio
A great little tool to make arcade sound effects is sfxr
AI
Websites
- http://www.gamedev.net
- http://www.gamasutra.com/category/programming
- Insomniac Research And Development