Gallius asks “I grew up with games; I’ve been playing them all of my life. My programming knowledge is very limited. Over the last few years I’ve developed an interest in creating my own games. Would you mind pointing me in the direction of some good resources for not only AI, but also game programming in general?”
It’s a great question. Since you’re keen to learn programming, my advice is to actually make games (with help from examples) and integrate AI into them. It will take some time for you to become comfortable as a coder, but these days it’s easier than it’s ever been.
Here’s how I would approach your situation:
Get familiar with Python as a programming language.
Download PyGame and look into some examples.
Implement simple game AI techniques like steering behaviors.
Experiment with AI techniques from existing libraries.
That, in a nutshell, is the best way to learn about AI and programming with games. Here’s why and how…
Screenshot 1: Ants2D simulation in PyGame by Simon Oberhammer
Becoming Comfortable with Programming
The traditional programming language used in the games industry is C++. It’s important to keep that in mind, but frankly, it’s probably the worst place to start for a beginner. In my time, I started with Pascal but these days there’s much better.
I recommend you start with Python; it’s a programming language that’s intuitive to work with and easy to understand. You’ll also be able to build industrial-strength products with Python too, for example:
Eve Online is primarily a Python application, though the low-level engine (graphics) is written in C++.
Civilization 4 uses Python for various AI, gameplay, interface and configuration scripts.
Many studios, including Rockstar Games, rely on Python for certain tools, as it does a great job at bringing many different pieces of functionality together.
What makes Python such a good language to start with?
Batteries included — There are libraries for everything!
Intuitive yet powerful — It’s designed for easy reading.
Third-party bindings — Many game engines are supported.
Open source — Most programs and libraries are entirely open.
Here are some good free resources to get you going:
Beginner’s Guide at python.org
Dive Into Python by Mark Pilgrim
Byte of Python by Swaroop C H
Spend the time and get comfortable with Python; it’ll pay off in the long term. Then just as you start feeling comfortable, move on!
Venturing into Game Development
The next step is to start prototyping with 2D graphics using PyGame. PyGame is a library that provides the primary elements you need to build a game.
Here’s some advice to get you on the right track:
Download, read the documentation and install it locally.
Try some of the games and/or demos to see if it works.
Take an example and modifying it, or build your own simulation.
Once you’ve got going, start thinking about different things you’d like to build using artificial intelligence. A great place to start with game AI is using Craig Reynold’s steering behaviors to build “boids” that wander, avoid obstacles, seek and flee other boids.
Experimenting with Artificial Intelligence
Finally, once you’ve got the hang of creating simple games, you can move on to using more interesting AI techniques. I don’t recommend you implement advanced technology yourself, you can do that later. However, you can learn a lot by simply applying existing software to solve problems for you, and use that in your games.
If you’re serious about AI, you should read Artificial Intelligence: A Modern Approach.
A good place to start is with the Orange library. It will allow you to play around with machine learning techniques as a user without having to implement any of the low-level algorithms. Applying AI in practice as a black box is one of the best ways to learn about neural networks, decision trees, Bayesian networks. See the getting started guide for Orange.
Words of Encouragement!
You can’t learn coding over night, but it can be easy if you enjoy the process! It gets more fun as you go along too. Keeping a diary isn’t a bad idea either as you’ll be able to catalog your own progress, which I find encouraging.
Anyway, the rewards are certainly worth it. As a programmer you’re more likely to get into industry easily and be paid more!
Does anyone else have some advice for Gallius?












Comments
Comment on this article. | Show full forum thread.A good 3D game engine fully designed to be used in Python is panda3D
(www.panda3D.org).
It provides also a very nice Event & Messenging System as well as a tagging system for every object in the render .
(Ex:you can tag entities with flag like "friend", "factionA" etc...)
However no AI has been implemented so far in this engine, so it's a good place to be the "pionner"
Indeed; great suggestion! Rebuilding a good game is a great way to learn.
Manakel,
I'm aware of Panda3D; it looks very good I have to say. Some ex-colleagues of mine are now using it professionally.
I didn't mention 3D as it's a bit more advanced already... I have another question in the queue for next week about that :-)
Mihai,
Thanks for your advice. Some of the python books i mentioned take that practical approach. It does really help!
As for Java, it certainly has the advantage of having good tools (Eclipse) and a more verbose compiler for a static-language. I can't say I have much experience with it, but it seems to do the job!
Alex
FPS is a slight preference but I'm open, and I'm not picky about languages either.
There was an active dev community for counterstrike bots back before CS Source, but it seems to have died away and most of the sites have vanished. :/
As far as Python, I found that introduction for absolute beginner by Michael Dawson "Python Programing" is also good, because it focuses on very simple games like asteroids or tic-tac-toe (again, see Amazon reviews) but is not as friendly for the kid since it is heavy on coding (even if simple) right from the get go. But than you can use Python LiveWires or PyGame as continuation. Again, if you have a young tween at home, the Game Maker is a fantastic resource.
http://www.amazon.com/gp/product/0470068221/ref=cm_arms_pdp_dp
Is there many resources which writted by C++?
I'm interested in AI but I know i need to learn principles. I know programming in C.and I've worked with micro controllers and robotics but i know neither of these can lead me to AI(at least academically) . another problem is I'm sophomore in electronics . i know that credits related to AI in software engineering (undergraduate) are algorithm designing , AI and neurion networks (in my country) .so it seems i have no chance to study AI academically.so I'm determined to do it on my own. im really willing to know the principles of AI.I don't know exactly how to get started I mean should I learn a programming language more seriously or try to learn and study the same credits i have mentioned, what should i do as a person with this limited knowledge about AI .thanks
Not long ago I was in the same boat as you. I got my undergrad in CPE, but I was always fascinated with A.I. I took genetic algorithms my senior year which really got my cogs turning. I recently went back and got my M.S. in C.S. specializing in A.I. I can safely say that the best text I have ever come across for teaching background theory is Artificial Intelligence: A Modern Approach (2nd edition). Keep in mind that A.I. is a somewhat broad field, and this book covers more than just techniques that apply to games.
I would also suggest that if you think this is more than a hobby, more than just a fleeting interest, you should seriously consider dropping EE. I know it may seem like a waste to take 'fields and not actually use it, but you may save yourself years of soul searching by following your interests now.