Unformatted text preview: Science – Game Design A* pathﬁnding • A* algorithm is widely used as the conceptual core for pathﬁnding in computer games – Most commercial games use variants of the algorithm tailored to the speciﬁc game – Original paper: • A* is a graph search algorithm • A Formal Basis for the HeurisDc DeterminaDon of Minimum Cost Paths • Hart, P.E.; Nilsson, N.J.; Raphael, B. • IEEE Trans. Systems Science and Cyberne6cs, 4(2), July 1968, pp. 100
107 – There is a large research literature on graph search algorithms, and computer game pathﬁnding UC Santa Cruz Computer Science – Game Design Overview of A* algorithm • The following slides borrow heavily from: • Problem – A* Pathﬁnding for Beginners, by Patrick Lester • hpp://www.policyalmanac.org/games/aStarTutorial.htm – A unit wants to move from point A to point B on a game map, ideally along the shortest path • Assume the game map is a rectangular grid – Makes explanaDon easier, algorithm can accommodate many grid types – The literature views the map as a graph – Open/walkable (open terrain) – Or closed/unwalkable (walls, water, etc.) • Map squares are UC Santa Cruz Computer Science – Game Design Running Example • A unit in the green square wants to move to the red square – From here on out, we’ll call the squares “nodes” to be consistent with the research literature • Moving • ObservaDons – Horizontally or verDcally requires 10 movement points – Diagonal movement requires 14 movement points – Cannot move through blue squares (wall, unwalkable) – Can’t just draw a line between A and B and follow that line – It’s not ideal to just follow the minimal line between A and B unDl you hit the wall, then walk along wall • Not an opDmal path • Wall in
between Pathﬁnding example. Green square is starDng locaDon, red square is desired goal. Blue is a wall. Black is walkable, blue is unwalkable. UC Santa Cruz Computer Science – Game Design Open and Closed Lists • StarDng the search – Add A to open list of nodes to be consi...
View
Full Document
 Fall '08
 Tantalo,P
 the00, to00, game00, Computer00 Science00

Click to edit the document details