Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am about to develop a web game that is similar to board games like Risk, and iOS games like Lux and Strategery. I am curious to know what the concept behind the AI for such games should be like.

I know it's going to involve a lot of move calculations and and calculating all possible options. But can someone elaborate on this please? I am actually a web programmer who usually develop websites and program logic to them, so game development is something new to me.

Also, my boss would like to implement different difficulty levels for the AI. What are the principles behind something like this? Would the difficulty level correspond with how many steps/turns ahead the AI would calculate for each movement? (Like easiest difficulty would be the AI only calculating all possible moves for this turn, whereas in the next level of difficulty, the AI would calculate all possible moves for this turn and the next turn?)


share|improve this question
This comes from another angle, but is essentially your question. – Anko Feb 28 '13 at 10:52
You might want to email the developers of Lux Delux, or see if you can reverse engineer it. They have already done what you wish to accomplish, and may be able to assist you better. – user32059 Jun 18 '13 at 10:35

i don't know about Risk but i had developed a Chinese Chess game few years ago. I think you can try Minimax which the game calculate every possible decisions and each decision will branch out a node for all the players until a certain depths within reasonable time. I think it is suitable for most turn based games. For 'difficulty' your game will randomized the node paths based on success rate of the paths, higher difficulty will give more 'weight' to the higher success rate paths. Also, you might want to limit the depths of the calculation, easier = less depth, harder = deeper depths.

share|improve this answer
Honestly, I don't think Minimax is suited to Risk because there are too many possible options. Imagine a territory with 50 armies in it. There are a TON of possibilities there. – Almo Feb 28 '13 at 2:00
@Almo Alpha-beta pruning – Supericy Feb 28 '13 at 6:21
@Almo There are many states, but most of them are functionally very similar and so easily clumped together, so I think there's a lot of room for optimizing Minimax for the purpose. – Tom Olson Feb 28 '13 at 8:09
Does Alpha-beta pruning work so well in a game with a random element? (honest question) There is also the unknown element of which cards the opponent has; I seem to remember that in Risk that if you own the country of a card when turning it in, you get bonus armies there. – Almo Feb 28 '13 at 9:36
Another honest question... will minimax deal well with more than two players? My experience with it is in two player no-luck games. – Almo Feb 28 '13 at 10:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.