A* Pathfinding Project

Collider-Accurate GraphUpdateObject?


#1

My situation is as follows:

I have four “player” bases (ignore the extra two generic ones), three controlled by AI. Nobody should be able to enter the bubble around a base except their own. In order to avoid doing three different recast graphs (yes, this is procedurally generated), I thought changing the tags of the ground in each base would allow me to do what I want. I’ve attempted both GUO’s and GSO’s, the second saved as part of the base prefab, but both yield similar results to what you see here. The tagged zones around each base are simply too big to be acceptable, especially where it seems to be “double-generating”, with both the darker and even-larger lighter colored areas.

The tags are being assigned based on code I’ve found in other topics, using the bounds of a sphere collider the exact size of each bubble. I’m assuming that the original recast graph was just generated in such a way that that collider intersects all of the nodes that are now tagged, even as far away as they can get. So next I tried changing the graph generation settings. Tile Size is now down to 45 and still gives what you see here, even after increasing my initial scan time by about 5x. I also tried decreasing Voxel Size, but that increased by scan time by 60x and I didn’t even let it finish to see results.

I saw in the “Working With Tags” tutorial video that you can have GSO’s with very well-defined edges, but I assume that only applies to Grid Graphs? Is there any way to only encompass the area of my sphere collider without resorting to separate recast graphs with the obstacle layers tagged appropriately? If the single-graph scan is already going to take so long to get the accuracy I need, I may as well do it that way, right?


#2

Hi

For this I would strongly recommend a grid graph as that will give you much more predictable zones and things will generally be easier.
If you want to do this on a recast graph you can follow the small video tutorial here: https://arongranberg.com/astar/docs/recastmeshobj.html#area