top of page

It's Been a While

  • Writer: Cameron Belcher
    Cameron Belcher
  • Feb 12, 2019
  • 2 min read

"Sometimes the greatest moments in life are the times you have to draw 29 cards from a deck of Uno." - Cameron Belcher

What does this quote mean you may ask? Well to me, at the moment, it signifies that enjoyment of life sometimes comes after the biggest challenges thrown your way.

The challenge I encountered recently was getting an A Star pathfinding algorithm into Unity. I was using a Dijkstra pathfinding previously, but as my team and I have found later, the algorithm slowed everything down. The solution to this problem was implementing a more efficient algorithm to pathfind. What better way to implement a better algorithm than to just make the current one better. That is A Star compared to Dijkstra.

Dijkstra is an algorithm that checks all of the surrounding nodes until it finally reaches the end point that you want to reach. Now this can be inefficient because it checks in ALL directions. even in the areas that aren't even close to the objective. To make this better we add on a heuristic and check if old nodes have better costs (this is a very simplified reasoning behind A Star) and boom you have Dijkstra that goes in a specific direction.

There have been previous trials for me on this specific challenge, but Unity usually crashed promptly after I would try this algorithm out. So I always kept with Dijkstra.

This algorithm is faster than Dijkstra which will allow for more AI within the scene if need be. And at the end of the day, if it's better then it's worth it!

For more info check out the project:

https://cameron.belcher@pineapple.champlain.edu/sp19-egd320-bachus-1-t4.git

I will try to get the project up on Github on my main profile:

www.Github.com/DrabbyPage

 
 
 

Comments


bottom of page