For a last faculty undertaking, I’ve carried out an A* algorithm for pathfinding throughout a tile graph. To this point, it has labored far surpassing my expectations. Nevertheless now I am within the strategy of including a bit extra complexity to the extent and I’m not positive that tile graphs will reduce it any longer.
I want to add a number of flooring, however for the sake of simplicity I’ll simply create two flooring. At the moment second, I’ve a 2D array of Nodes that signify the one flooring in a degree. I do not suppose this might be scalable any extra to something in addition to one flooring. I’m proposing a way to search 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 will even be marked for those that lead up stairs to a second flooring. The heuristic price of shifting from one flooring to a different might be increased than if an agent was to easily transfer throughout the identical degree.
I am considering 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 flooring. If that’s the case, then the associated fee is solely the euclidean distance, in any other case it tries to search out the trail to the exit node on the cluster it is at the moment on, compute the trail to that node, then compute the associated fee to the following exit node inside that very same cluster. Repeat advert nauseam.
In order a visible illustration of this, this can be a horrible illustration of a flooring plan. The one highlighted nodes are the exit nodes
That is what I might provide you with. Is there some other approach in addition to looking out via a ton of tiles and clustering? To this point 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 completely positive tips on how to implement them in my undertaking. Since this class is a sophisticated sport growth class, if we do use nav meshes, we have to create and implement our personal and never use Unity’s inbuilt navmesh