• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What might be the best language for programming a kickass game AI?

Any language you want. I've heard that Haskell isn't too bad for programming AI. However, there are plenty of AI's programmed in just about every language.
 
learning is not a feature of the language but of the logic you create. so any language will do.
AI is more about the logic and algorithms than about the language, so really you should pick up some reading material on it and don't worry about the choice of language too much (e.g. use what the books use).
 
From my CS courses they always seemed to imply a functional language was better suited for AI - languages like Prolog, Haskell and Lisp - because of their links to predicate calculus and flexibility to create learning structures that translate into axioms and logic rules.
 
How much programming experience do you have? If you want an AI that learns, language choice isn't your biggest hurdle. You need to understand machine learning topics, which are language-independent.
 
Originally posted by: Drakkon
From my CS courses they always seemed to imply a functional language was better suited for AI - languages like Prolog, Haskell and Lisp - because of their links to predicate calculus and flexibility to create learning structures that translate into axioms and logic rules.

Generally, though, functional languages aren't used because it really isn't that hard to just code it up in C++ or whatever other language you are currently working with.

For practical applications, you will see all sorts of languages, from an academia standpoint, you might see functional programming languages used more often as they write more like an equation so to speak.

End result, the language you use doesn't matter, the concepts are whats important.
 
Even some scripting language such as Perl or Python would do the job pretty well, I believe Civ4 uses Python.

The issue is to design a good AI, not to implement it.
 
Any language will do it all comes down to your design and implementation.

Having said that, I believe a high level language works best because it allows you to focus more on actual AI logic and less on programming fundamentals.
 
I agree with the others. The issue isn't whether a specific language is better suited for expressing the logic. But depending on the nature of the algorithms and the number of them that have to be evaluated performance can become a large concern.
 
Generally I find c++ not that great of a language for ai in the generic sense. However, most games do not utilize ai in the traditional sense. The rules of engagement tend to be more of a static nature. Naturally, this depends on the type of game you are developing. The AI used by an RPG or FPS is radically different than a RTS or TBS. It also depends on the complexity of the mechanics. CIV 4 would require a more advance AI to fully utilize all the strategies allowed by the game where as heroes V ai would be more simpliistic.

I would think that C++ would be adequate for most games AI; though I could see an RTS/TBS employing something a bit more advance (but I suspect most commerical games do not take this route).

This begs the question of why don't games learn from their past mistake 🙂
 
Related to the topic of AI, what are good recent books on AI? Are there good resources online? (unlike the OP, I'm not really focused on game AI)
 
If you're making the AI for something real: C or C++
If you're making it for fun: Whatever slow/interpreted/managed language you want.
 
Originally posted by: Aikouka
With all this wonderful advice, I recommend BASIC.

Works fine, we used it (DOS MS Basic PDS compiler) for a rule-based system to interpret statisics at a company I worked for in the mid-'90s.

As everyone else has said, the AI logic can be implemented with any language you want.

In games there is often fixed AI like pathfinding that's done in the main C++ code, then NPC behavior AI like (for NWN 2) "cast best spell if kobold appears" and "drink every potion they're yummy" that is done with some scripting language.
 
In games there is often fixed AI like pathfinding that's done in the main C++ code, then NPC behavior AI like (for NWN 2) "cast best spell if kobold appears" and "drink every potion they're yummy" that is done with some scripting language.

Yep, exactly. The brute force stuff has to be written in high performance compiled languages. NPC behavior is very often handled in script according to rulesets. The driver there is that behavioral, tactical, and strategic AI decisions have to be relatively amenable to change and implemented in an approachable environment. It would be a nightmare if that stuff was all still buried in C libraries.
 
FWIU, Lisp is the only language that was designed with AI in mind. And may be preferred simply because there is so much AI educational material out there that uses Lisp for examples.

But in reality, as long as you can do any sort of data structures you need, any language will suffice.
 
Back
Top