Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 1.01 KB

README.md

File metadata and controls

27 lines (15 loc) · 1.01 KB

A* Algorithm

This project demonstrates an application of the A* algorithm in an 8 directional movement system.

Application

A C program that displays randomly generated dungeon configurations and find the shortest path between two point using A* is provided.

Uses the seed 7907.

Invoking Instructions

The program can be compiled using the Makefile (compiled with make) and run with ./program.

Press Q to quit. Press ANY KEY (other than Q) for a new dungeon configuration. The terminal size must be at least 72x24 for the program to run.

Dungeon Generation

Dungeon configurations are generated by randomly placing points and drawing lines of varying sizes between them.

Pathfinding (A* Algorithm)

For each dungeon configuration the shortest path between its source and target is found using the A* algorithm in an 8 directional movement system.

An approximation (using integers) of octile distance is used as the heuristic which will never overestimate the actual path cost making it admissible.