This project showcases various pathfinding algorithms implemented in a grid-based system. It demonstrates how different algorithms solve the pathfinding problem, highlighting their strengths and weaknesses. The project is built with the aim of providing a comprehensive comparison and a practical implementation reference for anyone interested in pathfinding techniques.
Pathfinding is an essential aspect of many applications, especially in game development and robotics. This project compares different search algorithms, showing how they navigate through a grid to find the shortest path from a start point to an end point.
Visualization of pathfinding in action.
- Visualization of pathfinding algorithms in action
- Comparison of algorithm efficiency and performance
- Customizable grid size and obstacle placement
- Move units and target by selecting them with the mouse
Example of customizable grid and obstacle placement.
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- A* Search
- Dijkstra's Algorithm
- Greedy Best-First Search
Comparison of different pathfinding algorithms.
- Clone the repository:
git clone https://github.com/KaNaruto/Pathfinding-Using-Different-Search-Algorithms-In-Unity.git
- Open Unity Hub.
- Go to the "Projects" tab and click the "Add" button.
- Navigate to the cloned repository folder and select it.
- Wait for Unity to load the project.
- Launch the Unity Editor and open the project.
- Customize the grid by setting the start point, end point, and obstacles using the provided UI.
- Select the pathfinding algorithm you want to visualize from the dropdown menu.
- Click the "Start" button to see the algorithm in action.
Contributions are welcome! If you have any improvements or new features to add, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Create a new Pull Request.
Inspiration from various pathfinding resources and tutorials one of them was Sebastian Lague Pathfinding Tutorial.
For further understanding and a visual guide on pathfinding, check out this YouTube video.