CSE 3210 · AI Laboratory

Knight
Invasion

Duel Arena

A tactical board game where two knights race across a burning 9×9 grid. Move like chess, block like a strategist, survive the fire.
Minimax vs Fuzzy Logic — let the algorithms duel.

Full Desktop Experience

The Windows build includes full animations, smooth token movement, glowing effects, and polished UI built with Pygame. Everything the browser demo can't show.

SHA256: E03424B8EC901E3777F930899A87BF60AE97A84DC5FB41EA9C5F8DA41F18915C
File: Knight-Invasion.exe · Size: 14.78 MB

Gameplay & Screenshots

s1 s2 s3 s4 s5 s6

What Makes It Special

♞

Knight Movement

Standard chess knight L-moves on a 9×9 grid. Every move is a calculated leap — up to 8 directions, but fire and blocks narrow your options fast.

⬛

Strategic Blocking

Place two permanent blocks per turn instead of moving. BFS validates every placement — you can never trap your opponent with no path to win.

🔥

Fire Hazard

Random symmetric fire cells spawn at game start. Landing adjacent to fire forces you to move — no blocking, no hesitation. The board breathes danger.

🧠

Dual AI Engines

Minimax with alpha-beta pruning and iterative deepening duels Fuzzy Logic's membership-function inference system. Optimal vs. heuristic — who wins?

Game Modes

⚔ Two Player

Hot-seat local duel. Both players share one keyboard and board. Classic tactical showdown.

🤖 vs Minimax AI

Face the optimal tree-search agent. Depth-6 iterative deepening with time-bounded alpha-beta pruning.

🔴 vs Fuzzy AI

Challenge the fuzzy inference system with 8 linguistic rules mapping race advantage to block/move preference.

🔵🔴 AI vs AI

Watch Minimax and Fuzzy Logic battle autonomously. Pure algorithmic warfare — sit back and observe.

The Agents

Blue Knight
MINIMAX · ALPHA-BETA

Kazi Rifat Al Muin's agent searches the game tree up to depth 6 using iterative deepening and alpha-beta pruning. A heuristic evaluates BFS distance, row progress, mobility, and block power. Time-bounded at 0.9s — always returns the best move found so far.

6
DEPTH
0.9s
TIME LIMIT
500
BFS WEIGHT
Red Knight
FUZZY LOGIC · FIS

Dipta Chowdhury's agent uses triangular membership functions across distance, race advantage, and opponent proximity. 8 rules fire weighted strength values — defuzzification via centroid yields a crisp action preference from "must move" to "must block".

8
RULES
5
FUZZY SETS
BFS
PATH EVAL

Rules & Mechanics

Objective

Player 1 (Blue) starts at row 0 and must reach row 8. Player 2 (Red) starts at row 8 and must reach row 0. First to reach the opponent's starting row wins.

Knight Movement

  • Moves in an L-shape: 2 squares one way, 1 square perpendicular
  • Cannot land on fire cells, blocks, or the opponent
  • Must stay within the 9×9 board boundaries

Blocking

  • Place exactly 2 permanent blocks on empty cells instead of moving
  • Blocks cannot be placed on fire, other blocks, or any knight
  • Both players MUST retain a valid path to their goal row after any block placement — enforced by BFS
  • If no valid pair of blocks exists, you must move

Fire Hazard

🔥 Fire cells are generated symmetrically at game start. No knight can move onto fire. If your knight is adjacent (including diagonally) to any fire cell, you must move that turn — blocking is disabled.

Difficulty

  • Easy: 4–8 fire cells on the board
  • Medium: 8–12 fire cells on the board
  • Hard: 12–16 fire cells on the board

Turn Order

  • Players alternate turns — one action per turn
  • Either move the knight OR place two blocks, never both
  • No passing — you must take an action each turn

Play Now

Browser version — Two Player mode. Click a mode, choose difficulty, then play!

Select mode → New Game

Full Desktop Experience

The Windows build includes full animations, smooth token movement, glowing effects, and polished UI built with Pygame. Everything the browser demo can't show.

SHA256: E03424B8EC901E3777F930899A87BF60AE97A84DC5FB41EA9C5F8DA41F18915C
File: Knight-Invasion.exe · Size: 14.78 MB