“I want to build a computer opponent that is hard to beat and fun to play against.”

An AI opponent is a program that plays a game against a person. It runs one loop many times a second or once a turn: it reads what it knows of the game, decides, and acts through units that must move and fight. Its decisions sit in layers. A strategic layer picks goals, the army to field and the economy to pay for it, a tactical layer runs each fight, and movement carries out the orders. Where both sides order at once, it must also predict the other side's sealed orders and mix its own plans, because a plan that never varies can be countered before it lands. The goal is the player's experience, not the win, so difficulty, personality and legibility make the AI a rival people can read, beat and want to face again, and testing against other AIs and against people finds the blind spots a player could exploit every game.

Product

AI opponent

You might say: computer opponent, CPU player, computer player, AI player, enemy AI, bot, skirmish AI, artificial opponent, game AI

A player run by the computer that competes against a person in a game. Over and over, it reads what it knows of the game, decides and acts, until the match ends.

Ask
Does it give this player a fight that is hard to win, fair to lose and readable enough to learn from, with no blind spot that beats it every time?

What to look for

  1. Rival armies, racers or soldiers that act with nobody at the controls
  2. A difficulty setting chosen before the match
  3. A rival leader's name and portrait in the HUD
  4. Enemy forces arriving out of the fog of war

Parts

Catalogue: Genre

Catalogue: Platform

Sources

  1. Kevin Dill, What Is Game AI?, Section 1.1, IntroductionGame AI should be about one thing and one thing only: enabling the developers to create a compelling experience for the player.
  2. Soren Johnson, Playing to Lose: AI and Civilization (GDC 2008), Talk introductionI highlighted the difference between “good” AI and “fun” AI and how writing AI for Civ is tricky because it fits somewhere between those two extremes.
  3. Glen Robertson and Ian Watson, A Review of Real-Time Strategy Game AI, Section 1, IntroductionVideo games often have real-time constraints which prevent players from thinking extensively about each action, randomness which prevents players from completely planning future events, and hidden information which prevents players from knowing exactly what the other players are doing.
  4. David Churchill and Michael Buro, Hierarchical Portfolio Search in Prismata (Game AI Pro 3), Section 30.2, AI Design GoalsThis required the creation of several different difficulty settings so that players could continue to be challenged from beginner all the way up to expert play.
  5. David Churchill and Michael Buro, Hierarchical Portfolio Search in Prismata (Game AI Pro 3), Section 30.2, AI Design Goalswhich can become quite boring if the AI does the same thing every time it encounters similar situations.

Use it on your project

teardown-audit: audit my project against the "Game AI" teardown at https://teardownatlas.com/game-ai/

Paste it into a coding agent that has the teardown skills.

Every part

Flatpack

  1. Give it senses
  2. Lay the paths
  3. Plan against hidden orders
  4. Choose how it decides
  5. Fight the battles
  6. Plan the war
  7. Give it a character
  8. Let it learn the player
  9. Show its intent
  10. Set the difficulty
  11. Test and tune
  12. Seat the opponent

An AI agent wrote this map with the teardown skill. It can contain errors: check the sources before you rely on a part. About and legal