For a remaining college venture, I’ve carried out an A* algorithm for pathfinding throughout a tile graph. To date, it has labored far surpassing my expectations. Nonetheless now I am within the technique of including a bit extra complexity to the extent and I’m not positive that tile graphs will reduce it any longer.
I wish to add a number of flooring, however for the sake of simplicity I’ll simply create two flooring. At this time second, I’ve a 2D array of Nodes that symbolize the only ground in a stage. I do not assume this will probably be scalable any extra to something apart from one ground. I’m proposing a technique to seek out paths throughout two flooring utilizing a number of clusters containing nodes for various sections of the map the place some nodes are flagged as exit nodes that can result in different clusters.
Furthermore exit nodes can even be marked for those that lead up stairs to a second ground. The heuristic value of shifting from one ground to a different will probably be larger than if an agent was to easily transfer throughout the identical stage.
I am pondering if an agent is making an attempt to traverse from one path to the following, it first checks to see if the beginning node and exit node are on the identical ground. If that’s the case, then the fee is solely the euclidean distance, in any other case it tries to seek out the trail to the exit node on the cluster it is at present on, compute the trail to that node, then compute the fee to the following exit node inside that very same cluster. Repeat advert nauseam.
In order a visible illustration of this, it is a horrible illustration of a ground plan. The one highlighted nodes are the exit nodes
That is what I might provide you with. Is there another approach apart from looking out by means of a ton of tiles and clustering? To date on a tile of 100X100 efficiency appears to be okay and never a problem. I’ve heard of utilizing nav meshes, however I am not solely positive tips on how to implement them in my venture. Since this class is a sophisticated sport improvement class, if we do use nav meshes, we have to create and implement our personal and never use Unity’s inbuilt navmesh