CS 470 Artificial Intelligence Winter 2006, Instructor:
Jeffrey Horn
HOMEWORK
2:
(program 2): Heuristic Planner (A* Search) in
Java
PROBLEM DOMAIN 1 |
Pacman-like
maze |
2D, dynamic, with moving opponents |
(by
Brian Postma)
- GOAL:
- To show how A* can be used to generate plans that move an avatar through
a 2D maze to collect all energy pills while avoiding disastrous collisions
with moving ghosts, within the shortest amount of time (i.e., fewest number
of moves).
- Actually, this problem domain is very similar to
Problem Domain 2. But Problem
Domain 1 takes place in a much more confined 2D space, a "maze" essentially,
in which obstacles cover more area than does "open space", and movement is
not inertial. Furthermore, the moving obstacles in PD1 actually come
after you!
- CODE:
-
Here is a little DOS app. that runs a
PACMAN-like game showing the shortest path to the goal, dynamically updated with
each move by the player. (Sorry, no source avail., but it is a nice
illustration!)
-
Here is a paper with Java A* code applied to path finding in a 2D maze.
-
Also, Brian Postma has a complete Pacman game in Java, source available
here and/or
here.