/GameAI2021

Updated Game AI Samples for 2021 and Beyond

Primary LanguageC++MIT LicenseMIT

This repository contains Game AI sample code.

  • AlphaBetaTwoGames shows how the exact same algorithm [the exact same code] is able multiple games as long as the games have two players who alternate turns and at most one player can win. The sample compares the AlphaBeta pruning optimization to the MiniMax algorith. See the AlphaBetaTwoGames README for moe information.
  • DesktopTowerDefense is a Unity3D project that demonstrates path finding. The project is a start toward making a 3D clone of an excellent but obsolete FLASH game, Desktop Tower Defense. AI controlled "meanies" try to navigate from left to right and top to bottom. Click in teh play area to build walls. The meanies use Dijkstra's Algorithm to automatically adapt and find new paths around obstacles. A future version may adapt Dijkstra's Algorithm to use A* path finding. A* chnages from using a Queue to using a Priority Queue where priority is based on a huristic that adds an estimate of the cost of the remaining journey to the cost of the journey so far. If the estimate is accurate, A* is a much faster algorithm than Dijkstra's, but if the estimate is poor, A* can perform worse.