# Doing a passable 4X game AI

I am coding a rather "simple" 4X game (if a 4X game can be simple). It's indie in scope, and I am wondering if there's anyway to come up with a passable AI without having me spending months coding on it.

The game has three major decision making portions; spending of production points, spending of movement points and spending of tech points (basically there are 3 different 'currency', currency unspent at end of turn is not saved)

• Spend Production Points
• Upgrade a planet (increase its tech and production)
• Build ships (3 types)
• Move ships from planets to planets (costing Movement Points)
• Move to attack
• Move to fortify
• Research Tech (can partially research a tech i.e, as in Master of Orion)

The plan for me right now is a brute force approach. There are basically 4 broad options for the player -

1. Upgrade planet(s) to its his production and tech output

2. Conquer as many planets as possible

3. Secure as many planets as possible

4. Get to a certain tech as soon as possible

For each decision, I will iterate through the possible options and come up with a score; and then the AI will choose the decision with the highest score. Right now I have no idea how to 'mix decisions'. That is, for example, the AI wishes to upgrade and conquer planets at the same time. I suppose I can have another logic which do a brute force optimization on a combination of those 4 decisions....

At least, that's my plan if I can't think of anything better. Is there any faster way to make a passable AI? I don't need a very good one, to rival Deep Blue or such, just something that has the illusion of intelligence.

This is my first time doing an AI on this scale, so I dare not try something too grand too. So far I have experiences with FSM, DFS, BFS and A*

• The correct way to approach this problem is to do research on it yourself. Implement what you describe and see how well it works. Then make it better. Once you think you have a good algorithm, re-implement the AI to use the new structure. I'd suggest building this in a scripting language like Lua, to make it easier to throw the old code away. Apr 3, 2012 at 15:27
• To clarify, I could try implementing what I have in mind. I am just wondering if there are other ways to create an AI besides min-maxing or the traditional 'iterate-and-compute-best-score' method. Apr 3, 2012 at 16:37