Skip to main content
5 of 7
added 188 characters in body
Philipp
  • 121.5k
  • 28
  • 261
  • 342

The minmax tree method

You basically have the AI simulate every possible move it can make and every possible response by the other players for several turns in advance, and then pick the path which is most beneficial to it.

The advantages of this method is that it can usually deal very well with any changes to the gameplay because it only looks at the consequences of a move without having to consider why these consequences happened. You can also scale the difficulty very easily by setting the number of turns the AI calculates in advance.

The hardest thing about this algorithm is usually the rating function which determines what "most beneficial" means, but for an economy simulation it is surprisingly easy because you can usually express this in net-worth of the players (having more money and assets than the other players = good, having less = bad).

This method is very popular for games like Chess where you have a limited number of possible moves per turn, no randomness and no information hiding. According to your description your game seems to look like this. But you might be omitting some additional complexity.

When you have a very large number of possible moves, the decision tree becomes so wide that calculating more than one turn ahead takes too long even on a high-end computer.

When you have randomness or information hiding, you can either assume that the most likely event will always happen. Unfortunately this will greatly weaken the AI in case something unexpected happens instead. Or you can have the AI cheat. Have it know what will happen in advance by using the current random number generator state for the simulations and have it take any information into account it shouldn't actually have access to. This is very likely to make the AI frustrating to play against because it will soon become obvious to the player that the AI has an unfair advantage. Still, there is a large number of very successful games which make use of this technique.

The strategical rating method

This seems to be the method Jon is describing in his answer. In this method you evaluate all possible decisions the AI can make and have certain rules which rate the feasibility of the move based only on the current game situation.

Such rules could be "do not sell when the price is lower than average" or "do not buy when the other players have a lot of the same resource". The AI values all these factors by assigning relative scores to them and then makes the decision which has the best score.

This method requires to have a deeper understanding of the game as a whole because you need to define rules and ratings of what is a beneficial or detrimental decision. It also makes the strategy a lot less flexible to balancing changes which affect which decisions are good or bad.

Philipp
  • 121.5k
  • 28
  • 261
  • 342