views:

1128

answers:

3

I would like to use a rule engine for my game. It will be used for NPC AI, and GM AI.

What might be a good and fast Rule Engine for this purpose ? It must be Java and Open Source.

I would like to hear from people who have used Java Rule Engines for Artificial Intelligence about their experience.

A: 

Try Drools.

duffymo
+2  A: 

There are two choices that I've seen: Jess and Drools. Jess, frankly, has issues. It's not open source, nor is it free. It has a Lisp-like syntax, which is either a plus or a minus, depending on your point of view.

Drools, on the other hand, is both free, open-source, and under the JBoss umbrella, so it's likely to stay around for a while. The rules are invoked using straight Java, but are written using a DSL that is pretty intuitive to the non-programmer.

The only "gotcha" I've seen with Drools is that compiling the rules can be slow, so you'll want to run your compilation at startup or in a static block, sometime when the user won't mind waiting around a bit.

Good luck!

rtperson
+1  A: 

We will try and address compilation perf later this year. It's just not something we've focused on or profiled yet, instead focusing on runtime performance.

I'd be very interested to hear about your progress. I'm thinking of doing a Drools PacMan game to start to explore about how best to use rule engines for games. As Games are often about events and checking relations between objects it seems that a properly tune rule engine could provide some benefits. The later part, the "tuning", will become important as in many cases the engine could be far more efficient in it's partial matches if it knows about the problem space up front. Ideally with games this is often the case, so we can provide hints to the engine to tailor it in places to those use cases.

We have some current research going on for adding probability, that should also be interesting for games.

Anyway please do contact me if you made any progress, mproctor at redhat d0t com