Frogboy, how does one go about learning to write good AI code (such as for a game like fheroes2, but in general too)?

And can one successfully advance their skill in their own time?  I enjoy playing fheroes2, but the AI isn't great yet.  Can I learn how to create good AI code as a hobby and interest?

Best regards,
Steven.

52,205 views 19 replies
Reply #1 Top

In programming, doing is the most important step to mastery. Though it is good to find and read good introductory material (particularly to get an intro to the langauge).

Reply #2 Top

It was really on the job training.  Years and years of making AI and slowly getting better at it.

But -- in general -- writing APIs that allow the AI to easily get as much useful information so that the AI programmer can easily put together strategies is crucial.

Reply #3 Top

Can I learn how to create good AI code as a hobby and interest?

Yes, you can !!! take a look at http://www.devmaster.net/ ... for AI, you have several article... Devmaster is the place to be... if you wish, you can found almost all the info/resource needed for create your own game ... and if you don't wish create a game engine, you have a huge list ( over 300 )... a lot of them are free...

Reply #4 Top

This is a great topic.

Now for my token stupid question... Are Bayes nets or MCMCs too computationally intensive to use for game AI? Anyone know?

Reply #5 Top

Quoting LightofAbraxas, reply 4
This is a great topic.

Now for my token stupid question... Are Bayes nets or MCMCs too computationally intensive to use for game AI? Anyone know?
Do you want to use them? If so, just assume they aren't. Worst case scenario, they're not and you change it. Best case scenario, they were, but you figure out how to make them work, thus winning fame, accolades, and of course copious attention from the ladies.

Reply #6 Top

Quoting Cruxador, reply 5
...copious attention from the ladies.

Ok, stupid question, maybe, but no need to be cruel.

Reply #7 Top

Well, as far as I know Frogboy AKA Brad is married. ;-)  If you want to learn AI, why not? B)

Best regards,
Steven.

Reply #8 Top

I want to chime in to corroborate Gwenio1 and Frogboy even further. I've learned to program by programming. Online documents, google, trial & error. And just always try to figure out a way to make the code more modular and more efficient. When looking back at old code from three years ago, it's pretty cool how much better I've become, even without any formal training.

Reply #9 Top

Best book resource to start learning about game AI programming is probably this book:

  • Programming Game AI by Example by Mat Buckland

Very good book, really well explained.

For general AI (a more academical approach), the best book is the classic:

  • Artificial Intelligence A Modern Approach by Russell and Norvig

This book can be hard to read as it is very formal.

And best forum and online resource for game AI is:

The forum is full of people from the industry and the insider material is awesome. Although I wouldn't pay for it until you have the basics under control. Gamedev.net is also a nice place for general game programming questions.

I hope it helps!

Reply #10 Top

Thank you for the recommendations!  I don't really want to make game AI my job, but I would look at getting into it as a hobby. =)

Best regards,
Steven.

Reply #11 Top

Then I would probably go with Mat Buckland book. It´s cheap, it requires little formal training, it´s very easy to read, it comes with a ton of examples, and it explains the most important algorithms and ideas right now in game AI (the only big one missing are Behavior Trees).

Reply #12 Top

Are there any decent books that describe Behavior Trees, and is that sort of thing necessary in a game like fheroes2/HOMM II?

Best regards,
Steven.

Reply #13 Top

Behavior Trees are pretty well described in a lot of articles in aigamedev.net, as Champandard (owner of the site) loves that technique. They have been mostly used in FPS games (although I think Demigod used BTs or GOAP which is pretty similar, not 100% sure).

But for learning, and for doing something for Heroes 2, you can go happily with Finite State Machines first, and then try more complicated things if you feel like it.

Reply #15 Top

But -- in general -- writing APIs that allow the AI to easily get as much useful information so that the AI programmer can easily put together strategies is crucial.

Actually, this is the part I'm more interested in:   how to go about writing an API?   I'm about to take on a BIG task.  To the tune of writing something like OpenGL.  And I don't mean writing IN OpenGL--I mean writing OpenGL.  But I've always been more into developing the video card than I have writing the C libraries interfacing to the video card.  How do you go about collecting requirements definition from your (potential) customer base?   And then organizing/software engineering that into an implementation, with an under-the-hood data model and an interface to the input vectors the hardware is expecting?

Anyone know any good books/white papers on API library development?  Particularly, where you're interfacing with assembly code or hardware drivers.   thanks!

Reply #16 Top

Quoting tetleytea, reply 15
Actually, this is the part I'm more interested in:   how to go about writing an API?   I'm about to take on a BIG task.  To the tune of writing something like OpenGL.  And I don't mean writing IN OpenGL--I mean writing OpenGL.  But I've always been more into developing the video card than I have writing the C libraries interfacing to the video card.  How do you go about collecting requirements definition from your (potential) customer base?   And then organizing/software engineering that into an implementation, with an under-the-hood data model and an interface to the input vectors the hardware is expecting?

Anyone know any good books/white papers on API library development?  Particularly, where you're interfacing with assembly code or hardware drivers.   thanks!

I did see a book on that on Amazon recently. Not sure how good it is.

I think OpenCL is a better example of a well written API than OpenGL. And all text strings should be UTF-8 format, because that is what everyone should use.

Reply #17 Top

Here is a very deep site about AI

the Association for the Advancement of Artificial Intelligence (AAAI)

http://www.aaai.org

 

To find links about game AI you have to drill down a ways. But there is a load of info there.

Reply #18 Top

Quoting tetleytea, reply 15



But -- in general -- writing APIs that allow the AI to easily get as much useful information so that the AI programmer can easily put together strategies is crucial.


Actually, this is the part I'm more interested in:   how to go about writing an API?   I'm about to take on a BIG task.  To the tune of writing something like OpenGL.  And I don't mean writing IN OpenGL--I mean writing OpenGL.  But I've always been more into developing the video card than I have writing the C libraries interfacing to the video card.  How do you go about collecting requirements definition from your (potential) customer base?   And then organizing/software engineering that into an implementation, with an under-the-hood data model and an interface to the input vectors the hardware is expecting?

Anyone know any good books/white papers on API library development?  Particularly, where you're interfacing with assembly code or hardware drivers.   thanks!

Writing a good API for something requires a very deep understanding of two things:

- the problem the API solves, the functionality you want to expose,...

- how the clients will use the API, what they need to work, what they don't need,...

That's hard, very hard :)