If you are like me, you probably have the impostor syndrome.
And let’s be honest, I’m not good at math and often it’s a hard problem for game dev.
Today I’m going to talk about A* also known as A star pathfinding.
At first, I thought I would not be able to do it myself, so I spent a lot of time looking for the right A* pre-made assets and I tried many.
Most were hard to understand and use, plus Artillery Royale does not use anything close to a grid and basic A* assets often presume that you have some kind of grid, so it was like trying to fit circles into squares.
Anyway, at some point I decided to learn about that A* algorithm to be able to understand a better those assets.
I thought it was only going to be for my developer culture because it would have been too hard for me to implement from scratch, but I realized it was really easy.
I read a bunch of blog posts and I decided to give it a go, using my own graph data.
And guess what? It worked like a charm.

Those are the resource I learned from:
-
https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2
This one explain the basic of A* with the simple formula behind it. -
https://web.archive.org/web/20171022224528/http://www.policyalmanac.org/games/aStarTutorial.htm
This one is the one referenced in the previous post, really great too, more detailed. -
https://www.redblobgames.com/pathfinding/a-star/implementation.html#csharp
This one is the cherry on the cake, it gives you A* implementations in multiples programming languages.
To be honest, if you read this you will be able to get somewhere.
For me the hard part was not the A* algorithm but building a graph that represent the game. A* (in the examples I found) is often used for grid based game, but it can be used for any graph.
Now I have a working A* path finding for my AI and I’m really proud (except that I lose several days trying to figure out assets from other instead of trying to understand A*).
Lesson learn, it’s quite often better to dive a little deeper than the asset store and look at what is behind the scene.
Note, it’s the second time I felt in this trap, when building the destructible map I started with an asset and in the end switched to my own code.