What is the most efficient way of programming a bot opponent for a one-on-one game?

I am currently making a simple strategy game in which two players try to destroy their opponent’s base by deploying their units on the map. Now, this game is played “player versus player” but I also want to offer the players an “offline practice” mode in which they fight a bot instead of a real person. Yes, I can program a crappy bot to randomly deploy units on completely random positions. Yes, I know how to add thousands of “if” statements to make the bot more “clever”. No, I am terrible at neural networks and I have no idea how to program a deep learning AI or whatever.

So, what would your suggestion be? Thousands of “if” statements? I’ve seen other games have clever bot opponents and they may not be working with neural networks, or, are they?

The best method I can think of without getting involved with AI is creating grids for where units will be placed.

Example of grid, sorry for the low quality.

From there, have the server deploy a unit in that same same row, but different column.

Another low quality example.

I really hope you do find a better solution to this though, I’m not sure how effective this would be. Best of luck!

1 Like