Advertisement

Most Common (read: EASY) AI language

Started by August 21, 2006 02:23 PM
16 comments, last by Hollower 18 years, 3 months ago
I want to start learning how to program the AI for my game and I thought this would be the best place to ask before I hit the internets and try to find something in the tubes. I heard that Prolog is the used quite alot and if so, where are some good sites/resources that I could look into. Thanks
Uhh... prolog is used in some very specific applications of AI, mainly because the language itself is like a big redefinable database...
But it works best on a very specific set of problems only, I think Prolog is considered an NP-Hard language, not NP-Complete?

Lisp and Scheme are often reccomended, since they're totally functional and that lends itself to OO design and AI and whatnot... I had an AI class based in this language...
It's purely academic though, and the paradigm is very different from whats used in actual games. Still, its an often reccomended language since the functional approach tends to 'free' your mind to see some problems in new ways...

if you know C/C++ as your main langauge, and are comfortable there... then why not stay there?
Advertisement
Generally in games the AI is either done natively (in whatever programming language used for the game, usually C++) or done in an engine-specific scripting language that was developed for level design and AI.

If you're talking academically, I belive lisp is very common (as mentioned above).

-me
You could use a scripting language like python,lua for the game AI. So you would have your game part in C/C++ and then you can do the AI in lua and embed lua inside C to do your AI. You can pick up a scripting language like python or lua and it can be relitvly easy for some people.
:)/$/
For game content AI, I believe the problem is not "which language to use" but "which will ease your job to get what you want to be done, done".

If you gave us a little more detail about what you're planning to do, we could probably help you more.
AI can be programmed in any language. Prolog is probably overkill for your needs. Use whatever you wrote the game in.

Quote:
Uhh... prolog is used in some very specific applications of AI, mainly because the language itself is like a big redefinable database...
But it works best on a very specific set of problems only, I think Prolog is considered an NP-Hard language, not NP-Complete?


The STO-problem is NP-hard, but this test is omitted from most Prolog implementations for efficiency reasons anyway.
Advertisement
I just want my AI to be like every other gamedevvers....realistic? I was going for the Half-Life 2, Killzone, or F.E.A.R AI. Kind of wanted them to be able to plan and move about to corner the player or succeed in not getting themselves killed. I was thinking that Fuzzy Logic or FSM would be the best options to give them a 'mind'. I'm not sure. I've never coded AI and I have not one clue where to begin this. I know it'll take sometime but I have it more now than I will later.

Thanks for the help
I am also interested in a AI lib for FPS/adventure games.
I found OpenAI, which is suppose to be the OpenGL equivalent or so it says. It turns out it uses Java (I use C++) and the project hasn't been updated since 2003 and I'm guessing it has poor documentation.

Ya, what kidd175 said. I don't know AI and a 3rd party lib would be great.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
There is no easy way to good AI, and there will never be. Even using the best AI toolkit (Im working on one :P), you will always need a lot of work and expertise from your side. Begin at the beginning (e.g., simple state machines), then climb up.

As for the original question, AI is usually coded either in your native language, and*or in a script language your game engine use.
In Far Cry Instincts we used Lua. Its pretty simple to use and hook up with your engine.

As Steadtler recommended... start with simple FSMs, then, if you find your system lacking anything, build new layers to control the planification of your AI.

Hope this helps

Eric

This topic is closed to new replies.

Advertisement