views:

624

answers:

6

I have taken an AI course, and the teacher asked us to implement a game that makes use of one of the AI algorithms. Here is where I need a bit of help:

  • I don't know to what kind of games each algorithm is applied
  • if you could just give an example of a game or game type and the algorithm it uses, I would appreciate it

I don't need any coding help, I can manage that (my language of choice is Java). I only need a little help on selecting an algorithm.

+4  A: 

Alpha-beta pruning is a good one for game trees in general, and turn-based games like chess and tic-tac-toe in particular.

Ben
+1  A: 

Any game can use any AI algorithm, if you have a 2d game where "enemies" follow you, you can use fuzzy logic to make the trajectory. In the same way that you could use a net(of any kind) to make them "learn" the best way to follow you. (If they where plenty, you could use genetic algoritms to make them learn in generations)

So go, think of something fun and THEN ask where a decision could be improved with AI and have FUN(this is the most important part of it)

And you can check this book to get some ideas, my bet is your uni have it somewhere in the library

DFectuoso
+11  A: 

In adjunct to Ben's answer, a good combo is alpha-beta pruning along with a game like connect 4. The heuristic for something like tic-tac-toe is too simple, and for chess, too complex. But connect 4 or a similiar "middle of the road" game can be an excellent place to see how the heuristic makes a big difference in both efficiency and quality, and it's also complex enough to even get some "niche" heuristics that can win some scenarios over other, generally better heuristics. The rules of connect 4 in particular are simple enough that it's very easy to come up with your own successful heuristics to see these things in action.

Another common AI to play with is A* for pathfinding, such as unit travel in an RTS or sandbox environment.

nezroy
+1 for mentioning A*
rmeador
+1. Connect4 is ideal since there's at most 7 possible moves per lookahead - that makes it less necessary to do pruning if you have lots of memory and you're not trying to look ahead 42 levels. Still, you can implement pruning even for a few levels since the purpose is education, not an proper game.
paxdiablo
+1  A: 

You could try the N puzzle and the A* search algorithm using Manhattan distance as the heuristic function.

Pål GD
+1  A: 

As already mentioned A* is a great algorithm for pathfinding in games. Here is a tutorial (with source) on how this is implemented.

Good luck!

EnderMB
+1  A: 

What about Markov Chain Monte Carlo or MCMC algorithmn. http://en.wikipedia.org/wiki/Markov_chain_Monte_Carlo

In my A.I. class I did one with Bayesian Networks to calculate Probability. it wasn't too too difficult but was def. interesting.

Mercfh