I want to learn how to code AI, whare do I start?

This topic is locked from further discussion.

Avatar image for ghostsniperOP
ghostsniperOP

484

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#1 ghostsniperOP
Member since 2004 • 484 Posts
Well, I would like to know how to make videos games. And I would like to code AI. Now heres the thing, I know nothing about it. Im willing to spend alot of time learning how to do it. I have a C++ book that im reading. but I was wonderingif theres a book that teatches you how to code AI in video games. And if it also came with a program for you to test your AI code and well, see if it wroks. Sorry of this is the wrong forum, but I have no idea what to get.
Avatar image for Deihmos
Deihmos

7819

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#2 Deihmos
Member since 2007 • 7819 Posts

going to school is the best option. Without that degree no one will take you seriously.

Avatar image for ghostsniperOP
ghostsniperOP

484

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#3 ghostsniperOP
Member since 2004 • 484 Posts

going to school is the best option. Without that degree no one will take you seriously.

Deihmos

yes I know that, but I would like to know the basics first.

Avatar image for XaosII
XaosII

16705

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#5 XaosII
Member since 2003 • 16705 Posts

AI is relatively advanced. If you are starting to learn programming and you have a beginners C++ book, you'll probably have to read that book entirely before you can start tackling AI.

Im not aware of any books that teach both AI and programming from the ground up as you go. Most AI books i've seen have no code and are mostly just concepts that the programmer implements - but that requires a decent amount of programming knowledge since you need to convert concepts into code since the code isnt given to you.

I would recommend a book like this: Beginning C++ Game Programming. I havent read it (since i dont use C++), but it seems like a game programming book for an absolute beginner. It seems the farthest you get will just be text-based games, but it should give you enough knowledge to spend time on creating your own custom AI for it.

Avatar image for neatfeatguy
neatfeatguy

4415

Forum Posts

0

Wiki Points

0

Followers

Reviews: 21

User Lists: 0

#6 neatfeatguy
Member since 2005 • 4415 Posts

I've got a couple of computer "geek" friends that started getting heavy into programming and all that fun stuff needed for writing code for games...let me tell you something (this isn't meant to discourage you, just from my own personal views/opinion)

I tried watching these two guys work on a final for one of their courses; and the final was to write an AI program. The object was that you worked in a 5 x 5 grid: At one end of the grid was a cat and at the other end of the grid was a mouse - their job was to write an AI program that would allow the mouse to out-smart the cat and arrive safely at the oposite end of the grid.

I've never seen these two guys struggle so hard before over this one project (and these were brainy guys, doing all the calc and trig classes and being able to blow through C and C++). So, learning to do AI is no simple task.

Be prepared to become frustrated and greatly annoyed at times....and if you can stick through all of that, then maybe you'll have what it takes to knock out some good AI programs eventually.

Avatar image for onemic
onemic

5616

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#7 onemic
Member since 2003 • 5616 Posts

going to school is the best option. Without that degree no one will take you seriously.

Deihmos

That's not exactly true. Of course that's the safest option of getting into the industry, but there's also the realm of modding. designers and leaders of top mods for certain games(i.e. HL2, UT2004 etc.) are quite often in demand by the videogame industry.

Avatar image for karmageddon2k4
karmageddon2k4

919

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#8 karmageddon2k4
Member since 2004 • 919 Posts

I've got a couple of computer "geek" friends that started getting heavy into programming and all that fun stuff needed for writing code for games...let me tell you something (this isn't meant to discourage you, just from my own personal views/opinion)

I tried watching these two guys work on a final for one of their courses; and the final was to write an AI program. The object was that you worked in a 5 x 5 grid: At one end of the grid was a cat and at the other end of the grid was a mouse - their job was to write an AI program that would allow the mouse to out-smart the cat and arrive safely at the oposite end of the grid.

I've never seen these two guys struggle so hard before over this one project (and these were brainy guys, doing all the calc and trig classes and being able to blow through C and C++). So, learning to do AI is no simple task.

Be prepared to become frustrated and greatly annoyed at times....and if you can stick through all of that, then maybe you'll have what it takes to knock out some good AI programs eventually.

neatfeatguy

Ya i would agree with you. I'm a developer and i can program some games in C++ but AI is very tough when you get into it. You'll want a university software engineering degree most likely if you really want to get into it. The main reason being the math involved is quite complex. Basic AI is quite easy but anything where it actually has a brain is where it gets tough.

You don't need to use C++ when you're getting into AI but it is a good starting point because a large portion of books you'll find at book stores involve c++. If you want some solid books look for ones written by Andrew Lamothe. They're very well done. I own several of his and i find them easy to pick follow and cover the foundation well.

But before you do AI you will need to at least have a starting point in gaming. Even if this is something really basic and then from there build your AI on top of that. Also if you don't want to get into developing games from the ground up i would suggest looking at how to build on top of the unreal engines, hl2 and such. They're easy to quickly setup games and the code is easy to follow.

Avatar image for KorJax
KorJax

2564

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#9 KorJax
Member since 2004 • 2564 Posts
In the games industry, your portfolio/experience means more than a degree, although a degree will deifnatly help (although they will hire you anyways if you show you can create some amazing AI in games, or code your own game, and show that you can work hard).
Avatar image for Termite551
Termite551

1125

Forum Posts

0

Wiki Points

0

Followers

Reviews: 14

User Lists: 0

#10 Termite551
Member since 2006 • 1125 Posts
I would guess there are some prety good books on AI on amazon, you should check it out. I personnaly am a programming n00b and Im studying Java to make games (Java has lots of potential, easy networking aswell). But to me, AI is a very far flung concept. And I think its definetily one of the last things you will learn to do in programming.
Avatar image for Termite551
Termite551

1125

Forum Posts

0

Wiki Points

0

Followers

Reviews: 14

User Lists: 0

#11 Termite551
Member since 2006 • 1125 Posts
Oh yeah, and also a degree can help, but it really depends on how good you are at programming (Or art depending on your job). Just because you have a degree in computer science and finished top of your class, you might not have the skills required to make a game.
Avatar image for The_PC_Gamer
The_PC_Gamer

2910

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#12 The_PC_Gamer
Member since 2003 • 2910 Posts
AI is one of the hardest parts of programming because there are millions (depending on program) IF and THEN statements that need to be coded. After each step, another set of IF and THEN's opens up, so by the end u have a looooooong list of all possible actions and corrent responces that the system must produce. And coding it is tedious.
Avatar image for teuf_
Teuf_

30805

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#13 Teuf_
Member since 2004 • 30805 Posts
Well...I will let you in on a little secret: game AI isn't really all that advanced in the general case. With most of of your CPU time being taken up by rendering calls, occlusion/frustrum culling, collision detection, and physics...there's not a whole lot of room left for AI. Most games get by with rather simplistic routines.

Of course, you could always strive to be a trailblazer and try to come up with some pretty advanced yet computationally cheap algorithms. :D
Avatar image for the_mad_madman
the_mad_madman

316

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#14 the_mad_madman
Member since 2004 • 316 Posts

If you want the very basics, find an open engine editor that allows you to edit AI scripts and start with figuring that out. I used to do some mapping and editing on the old Dark Engine for the Thief series, and most AI there is a series of scripts that come down to essentially 'do this unless this this or this happens, and if this happens, do this, etc.' Not especially hard once you've got the games particular coding lingo down, but it still tends to become a bit tedious when you've got to consider so many elements which the player can do. I imagine with newer engines the process is much, much more complex. Still, it's a start. You wont be coding entierly new AI anytime soon, but if you can figure out the general idea it's a start.

Source engine maybe? UT engine? There are piles of mods for those two, so I imagine there must be some basic AI tweaking open to you in the editors. Give it a look!

Avatar image for mrbojangles25
mrbojangles25

60746

Forum Posts

0

Wiki Points

0

Followers

Reviews: 11

User Lists: 0

#15 mrbojangles25
Member since 2005 • 60746 Posts

You need some sort of formal education. Im not saying to enroll yourself in MIT or anything like that, but maybe take a night class or something at a junior college or a trade school, if they allow that sort of thing.

The reason I say this is because my roommate is a computer science major. He has worked part-time coding programs for the past two years. He is an extremely bright guy, and not only academically but creatively as he writies his own music and plays in a couple bands.

This last quarter, however, he took a design class where the quarter-long project was to design a game from the ground up. All the modeling and stuff like that took them about two weeks, but the AI took them the whole quarter and when the project was due they still werent finished (fortunately he cut out the unfinished part and got a good grade).

My point is that while you can further yourself by being self-taught and by reading books, you are definately gonna need training and education. If it took my roommate multiple quarters of classes and two years of job experience to become proficient with programming (and a whole 10-week quarter to know AI programming), its gonna take more than a C++ for Dummies book to train you.

Avatar image for crazymonkey092
crazymonkey092

974

Forum Posts

0

Wiki Points

0

Followers

Reviews: 3

User Lists: 0

#16 crazymonkey092
Member since 2005 • 974 Posts

Programming is definitely tough, most books that teach it don't even make sense for beginners. But as always once you understand it more, Practice, Practice, Practice. Don't get discouraged because you get stuck or pissed at it. Just don't give up and before you know it you will be making complicated programs.

Like many have said(if your old enough and have time) take some courses on it. Although I recommend that you find someone super smart in programming and have them teach you. Thats what I did and I learned faster than the school I was at. =]

-Good Luck to ya

Avatar image for dark_death78
dark_death78

55

Forum Posts

0

Wiki Points

0

Followers

Reviews: 3

User Lists: 0

#17 dark_death78
Member since 2004 • 55 Posts

there is a lot of truth in what everyone has said so far

i myseld am doing a double in computer science and science, and AI programming isn't offered until our 3rd year, simply for the fact that they pound us with the truth that all programming is algorithms. Someone before mentioned playing around with scripts, yes that can help a bit of understanding, unfortunately that's far from programming an AI from scratch?

you'll realise the true difficulty in it by trying, simply put, you're a beginner? well, start with simply programming first, for example, set yourself smaller projects which test your algorithmic thinking (because all programming is simply maths (being logic) in code) and make a game such as bejeweled, where you're doing a lot of if this than this kind of stuff

remember AI isn't restricted to a certain programming language, just depends on how it's utilized, and generally it can be translated. So play around a little and see what you like (i have to be proficient with Java for example :P)

don't feel discouraged, but AI is well out of your reach at a beginner level, even i and some friends who are about 10 times ahead of me, are yet to even think about AI and we're already about to start 3rd year at uni. Remember, it depends on the complexity of your AI, scripturing isn't 'true' AI... ... you'll undersand eventually

what do you other guys think? or have i blown it out of the water? :(

Lari

Avatar image for SgrArchAngel
SgrArchAngel

25

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#18 SgrArchAngel
Member since 2004 • 25 Posts

head over to www.gamedev.net and post in the appropriate forum

Avatar image for danielsom
danielsom

25

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#19 danielsom
Member since 2004 • 25 Posts

I would say that attempting AI programming while learning basic programming is a little bit on the impossiable side. I finished my masters of computer science degree with a focus on AI and I can tell you that AI is tough if you want it to be effective. AI programming is not IF and THEN statements, most of the AI programming that I did used very few of those but rather a method to do almost perfect decisions in as little a time as possiable using a few decision parameters.

A degree in programming would be a good place to... start, then you will need to work on game programming and after that you may be able to start going into game AI programming. As far as I know C++ or any of the other common languages are used for the programming of game AI but rather a more decision based language that uses rule and such, LISP or something I can't remember.

It is good that you are interested but it is good to be realistic and see that to achive your goal you have a looooooonnnnggggg road ahead of you!!!!

Avatar image for corsoski
corsoski

25

Forum Posts

0

Wiki Points

0

Followers

Reviews: 3

User Lists: 0

#20 corsoski
Member since 2003 • 25 Posts

I'm not so sure AI necessarily has to be so complex and difficult to learn. If you want to write general AI then you need to get into research, because despite developments in Intelligent Agents and autonomous systems (like the NASA Mars rovers and whatnot) not very much has happened since the speculations about "humanlike AI soon" some 20+ years ago. A few examples of modern advances include areas like Evolutionary Computing and Genetic Programming, which show promise for specific domains in automation and "cognitive theories" (like Global Workspace Theory) that shows promise for human interaction (mimicking human "attention" to a task).

I wouldn't worry so much about a degree unless you want to get into research.

For the specific problem of AI in games there are a number of subjects you can get into that don't require advanced knowledge in semantics and computational theory:

Constraint Programming, Planning, Learning Decision Systems (boosted decision-tree stumps are great for many dynamic scripts)

but most of all Game Design!

A well designed interface and dynamic animations can give a very convincing illusion of intelligence where the behaviour of agents in the game are actually quite simple, even random. Remember that in modern games it's more a matter of pervasiveness and plausibility -- something like the "fourth wall" of a stage. Even a very capable AI in a poor presentation will make the player disappointed (feeling that the computer is "cheating" or "auto-killing").

A good introductionary text at undergraduate level is AIMA (AI: A Modern Approach) often referred to as "Russel and Norvig" after the authors; aima.cs.berkeley.edu. That text doesn't deal with computer games explicitly but the appications are easy to imagine.

The real key to understanding AI in computer games, IMO, is to really understand the importance of data -- it's easy to apply existing techniques to a game but that technique will be rather useless if you haven't chosen good information to extract from your game-environment. Thus, the modelling your game uses (e.g Gameplay Programming) is essential for succesfull application. IMO of course, you can probably find ppl who disagree with that and claim that a good AI should be able to perform well with the same set of data that a human would use (ie proponents of so-called strong AI).

Speaking of modelling, someone above mentioned mods - modifications to existing games. This is a great way to see how others have done and sometimes existing games clearly illustrate the shortcomings of many games' data models. Plus it's a great way to really get into programming and content creation without the often insurmountable hurdle of getting a game engine up and running to start testing your AI.

To summarize:

Learn Game & Art Design. Understanding convincing presentation is very important - how does the game seem intelligent?

Learn and think carefully about information and questions like "what do I need to know to decide X" or perhaps more importantly "how can I pretend that I know X"

Learn and apply existing techniques without regard to their original applications

Mod!

// raphael

amateur researcher; complex adaptive systems

Avatar image for shogoh
shogoh

571

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#21 shogoh
Member since 2003 • 571 Posts

There is a LOT you need to learn before being able to code AI: basic programming, data structures, mathematics... AI programming can be simple or very very complex. I have an degree in software engineering and I know only the basics of AI. This is the book I bought for one of my classes: link. To learn complex AI you will need to get into a book like this. I don't recommend you buy it, it is far too advanced... you need to start a degree.

Avatar image for rimnet00
rimnet00

11003

Forum Posts

0

Wiki Points

0

Followers

Reviews: 7

User Lists: 0

#22 rimnet00
Member since 2003 • 11003 Posts
Real AI doesn't get tought until Junior year computer science in college... so, you have a long way to go before even considering it. Also, the book that the poster linked above is the same book I used in college. It is the book for AI and is used in just about every good computer science program across the country. Also, he was completely inline when saying that you need to learn how to code, learn data structures and a have a great deal of math under your book before even learning basic AI. AI isn't easy; it was in fact one of the hardest classes you could take at my college, with half the kids failing the course. Though this of course varies on where you take the class; but that should still be an indication.

For example, if I were to tell you basic AI builds off the concepts of weighted DFS and BFS models; a first day AI student immediatly know what that refered to, and would know the basics on how to code it within an hour. If you are only beginning to code... for you to learn AI is a waste of your time, because it would take you forever to learn anything since your foundations are even there yet; as opposed to building your foundation, and then taking the advanced material and learning it in 1/10 the time.
Avatar image for karmageddon2k4
karmageddon2k4

919

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#23 karmageddon2k4
Member since 2004 • 919 Posts

there is a lot of truth in what everyone has said so far

i myseld am doing a double in computer science and science, and AI programming isn't offered until our 3rd year, simply for the fact that they pound us with the truth that all programming is algorithms. Someone before mentioned playing around with scripts, yes that can help a bit of understanding, unfortunately that's far from programming an AI from scratch?

you'll realise the true difficulty in it by trying, simply put, you're a beginner? well, start with simply programming first, for example, set yourself smaller projects which test your algorithmic thinking (because all programming is simply maths (being logic) in code) and make a game such as bejeweled, where you're doing a lot of if this than this kind of stuff

remember AI isn't restricted to a certain programming language, just depends on how it's utilized, and generally it can be translated. So play around a little and see what you like (i have to be proficient with Java for example :P)

don't feel discouraged, but AI is well out of your reach at a beginner level, even i and some friends who are about 10 times ahead of me, are yet to even think about AI and we're already about to start 3rd year at uni. Remember, it depends on the complexity of your AI, scripturing isn't 'true' AI... ... you'll undersand eventually

what do you other guys think? or have i blown it out of the water? :(

Lari

dark_death78

I agree with you. Actual AI programming where it has some brains other than your really basic..If you see the player on the screen shoot otherwise stand still, is very hard. There is a lot of math involved to calculate the best actions in given scenarios. I think to just get a feel for how things work and to get a bit of a foundation you should start with basic scripting. You'll get a bit of an understanding on how it integrates into games and can play around with that. Once you're getting the hang of that i'd suggest University or if your really smart go buy the books and teach yourself although this is a really hard thing to do on the advanced topics.

Also going to your local chapters and such and picking up beginner books is a good start

Avatar image for juggernaut8419
juggernaut8419

872

Forum Posts

0

Wiki Points

0

Followers

Reviews: 1

User Lists: 0

#24 juggernaut8419
Member since 2003 • 872 Posts

There is a LOT you need to learn before being able to code AI: basic programming, data structures, mathematics... AI programming can be simple or very very complex. I have an degree in software engineering and I know only the basics of AI. This is the book I bought for one of my classes: link. To learn complex AI you will need to get into a book like this. I don't recommend you buy it, it is far too advanced... you need to start a degree.

shogoh

I used that book as well for the first AI clas s I took. I thought it was a good overview of the needed concepts to begin AI work. Of course you will have to get other more specific books for machine learning and stuff like that if you truely want to understand the topic. Nevertheless, that book gives you the tools to make some cool stuff like an AI car for the DARPA road challange (the overall small group project I did in my clas s).

Avatar image for blacksorrow07
blacksorrow07

263

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#25 blacksorrow07
Member since 2007 • 263 Posts

iwant to learn how to make mods, skins, maps, and other stuff for games such as Cod2, Crysis, and Cod4.

i am gonna start learning how do those stuff at the end of this year when i get my new computer, core 2 duo E6650, 8800GTS, 2gb of ram.

what programs do i need for those stuff?

and i am 14 so i have a lot of time on my hands. so can somebody list me books to learn about the basics of programming games, and other stuff to add into it?

PS. i also need to learn the CMD commands. where can i learn about those?

Avatar image for mrbojangles25
mrbojangles25

60746

Forum Posts

0

Wiki Points

0

Followers

Reviews: 11

User Lists: 0

#26 mrbojangles25
Member since 2005 • 60746 Posts

iwant to learn how to make mods, skins, maps, and other stuff for games such as Cod2, Crysis, and Cod4.

i am gonna start learning how do those stuff at the end of this year when i get my new computer, core 2 duo E6650, 8800GTS, 2gb of ram.

what programs do i need for those stuff?

and i am 14 so i have a lot of time on my hands. so can somebody list me books to learn about the basics of programming games, and other stuff to add into it?

PS. i also need to learn the CMD commands. where can i learn about those?

blacksorrow07

A few years ago I Sort of dabbled in that stuff, making models and whatnot. It was more out of boredom and interest than to actually pursue it as a career.

Halflife has an extremely good SDK and a lot of community support for such things.Hammer for the levels, Milkshape for the models, and I forgot what program to make the textures (was it Wally's?). It may not be professional, but the stuff is user friendly and I am sure very relevant to whatever professional tools actual developers use.

Avatar image for YourOldFriend
YourOldFriend

4196

Forum Posts

0

Wiki Points

0

Followers

Reviews: 2

User Lists: 0

#27 YourOldFriend
Member since 2005 • 4196 Posts
I know ModDB.com has a ton of tutorials for modding and developing, but you should really establish a foundation to work from. And of course, start very small. Get a degree when you can, but younger initiative is always a good thing imo.
Avatar image for kyrieee
kyrieee

978

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#28 kyrieee
Member since 2007 • 978 Posts
First, learn c++. THEN try getting into game programming. Do small projects, plan them first and make sure you finish them. Don't get in over your head. By books, lots of books, ask questions. Read code!
Avatar image for blacksorrow07
blacksorrow07

263

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#29 blacksorrow07
Member since 2007 • 263 Posts
my dad has C,C++ and other stuff and i am reading the C book.
Avatar image for dark_death78
dark_death78

55

Forum Posts

0

Wiki Points

0

Followers

Reviews: 3

User Lists: 0

#30 dark_death78
Member since 2004 • 55 Posts

on account of what a lot have said i just realised that maybe it would be a good idea to play with SDK's first

by grabbing what you can experience from pre-made games such (especially for modelling and design and stuff) you'll get a head start. I remember when i started modelling for fun i played around with the Q3 options given to me, and exporting and learning the basics and getting the hang of it, and after understanding most of the jargon i was very confident when i first picked up 3DSMAX for example, because i knew straight away what most of the stuff meant that i was looking at on the screen

programming through a programming language (any for that matter) has more to it then some people think... for example if you want to actually "see in action" what you've coded... you have to first code the base etc etc, which takes the bulk of the time, in comparison to what you actually wanna see if it works (thus why programming with Java for example, lets me see how it runs through numbers and basic text, without the hassle of compiling and worrying about graphical representations)

so i think that SDK's and stuff that's available out there is an excellent place to start to help you get into programming, scripting and eventually even advanced stuff as AI

Good luck to you guys, hope to see some good stuff in the future

Lari :D