Opensource Java AI library (ai4j)

Hey guys,

I just put out the first release (pre-alpha) of my opensource (BSD license) Java AI library called ai4j (ai4j stands for artificial intelligence for java). You can find it on http://www.ai4j.org. Although this current release (0.1) is far from being feature complete, the final goal is to have a stable Java library that contains group of common AI algorithms used by games and related applications in an abstracted and extendable form.

The current release aids with:

  • goal oriented behaviour
  • state oriented behaviour (state machines)
  • genetic algorithms
  • path finding
  • decision trees

The upcoming releases plan to aid with:

  • artificial neural networks
  • fuzzy logic
  • more path finding
  • blackboarding systems
  • minimax
  • examples that show the ai library in action

If you decided that you’d like to use the library, feel free to go to http://www.ai4j.org to download it, submit bugs, submit feature requests, or to help contribute. Any help would be greatly appreciated.

Thanks!

That would be a really cool system, but how exactly would you use the same library for each game? Seems like AIs are so implementation independent that it would be difficult getting this just how you want it.

That is true. I’ve tried to abstract things out and add various niche features as best I could. For example, the A* implementation will let you write your own heuristic if you want, it’ll let you do a full A* search, it’ll let you do a partial A* search (return the first path it sees that has the end node), and the graph system that it works with is pretty extendable.

There are other things that I wanted to add but I couldn’t figure out a proper way to abstract them such that they could be used in most games. Steering behaviour was one of those features that seemed so dependent on the actual game that it seemed like a waste of time for me to try to do anything with it. One way to think of it is that ai4j helps you design/write your AI system, but it doesn’t write the AI for you. It’s not so much an AI engine as it is a group of common algorithms.

The neat part for the user is that ai4j’s opensource. If the user sees that a feature needs to be tweaked such that it works with their specific game, they can go ahead and do that (although most of the time I think this would be unnecessary as the library is abstract enough to handle most cases). If they see that some feature or abstraction is missing, they can add it in. And if they choose to, they can submit a patch back to ai4j so everyone else using the library will be able to take advantage of those changes :slight_smile:

Can I suggest that for artifacts like ANNs, decision trees, and GAs, that you only make a facility for applying them in a game, rather than a whole learning framework. You might want to consider looking into WEKA http://www.cs.waikato.ac.nz/ml/weka/ (this is the standard suite for testing algorithms used by the machine learning community - and it happens to be in Java!), and make your library compatible with their output formats.