Extending minimax algorithm for multiple opponents

The minimax algorithm is well described for two players for games like tic-tac-toe. I need to write an AI to play the tank. In this game, tanks must move in a maze in which there are obstacles in the form of walls. The goal is to collect coin piles. If it were only two players, the minimax algorithm could be implemented. But how to implement it more than two? At each step, each player will try to maximize their winning margin. I can’t think of all the players as one enemy trying to reduce only my winning edge, creating the levels of two players, as in the original minimax algorithm. Sorry if the question is not in a good format. Still new to this forum

+4
source share
2 answers

You can no longer use minimax for this. Unless you make the hybrid goal of maximizing profits and minimizing the amount of other profits. But it is very difficult to implement.

It is best to create algorithms that can learn at a strategic level what needs to be done. Turn the game into two players: I am against the others and start from here.

+3
source

Working with the minimization function with several minimization agents consists in launching the minimization function with the same depth for all agents. After all minimizing agents have passed, you run the maximize function on the last minimizing agent.

# HOW YOU HANDLE THE MINIMIZING FUNCTION - If this pseudocode helps make better sense out of this. scores = [] if agent == end_of_minimizing_agents: # last minimizing agent for actions in legal_actions: depth_reduced = depth-1 scores.append(max(successor_state, depth_reduced)) else: for actions in legal_actions: scores.append(min(successor_state, depth)) bestScore = min(scores) return bestScore 
0
source

All Articles