Understanding the Minimax Algorithm with a Baldur’s Gate Example | AI Game Strategy

Minimax Algorithm Summary

Today in my AI class at university, I learned about the Minimax Algorithm, so I’d like to summarize what I’ve learned.


✅ What is the Minimax Algorithm?

It’s an algorithm where we assume the opponent always makes the best possible move, and within that, we try to make the most advantageous choice for ourselves.


✅ Examples of Where Minimax is Used

  1. ♟️ Turn-based strategy game AIs like chess and Go
  2. ⭕❌ Board games like tic-tac-toe or Othello
  3. 🤖 Decision-making for AI agents (e.g., game tree search)

🎮 Understanding Through an Example: Baldur’s Gate Combat

post-title-1744694100949

Player: Shadowheart (MAX)

Enemies: Emperor, Raphael (MIN)

When Shadowheart chooses an enemy to attack,

She calculates, "If each enemy defends optimally, who would still take the most damage?"
and chooses the one that will receive the maximum damage.


🧠 Tree Structure Overview

Shadowheart (MAX)
├── Emperor (MIN)
│   ├── Magic Barrier → Damage: 3
│   └── Cloud Skill   → Damage: 5
│   → MIN chooses = 3
└── Raphael (MIN)
    ├── Shield Skill → Damage: 7
    └── No Defense   → Damage: 10
    → MIN chooses = 7

This post was focused on helping you understand the concept, so I didn’t include any code.
I hope you found it helpful! 😊