Navmesh on a spherical planet

Thanks!I will have a try! :hear_no_evil: :partying_face:

Why the AI wont avoid the area I set by GraphUpdateScene.cs, I make sure I have set all correct. :flushed:


22

23

GraphUpdateObjects set to modify the tag cannot create new nodes. They will only update existing nodes. It will update all nodes which have a center that lies inside of the bounding box and the shape of the graph update object.

In your case no triangle centers seem to overlap that bounding box.

Hello Aron.In addition to setting “ASTAR_ RECAST_ LARGE_ Tiles” is true, Is there any way to solve this error? I dont want the vertex count be limited. :flushed:

And it have these error too,is there any way to solve them? :joy_cat:


I have used the ‘GraphUpdateObjects’ method to solve the obstacle question,but it doesnt work,which step did I do wrong? :flushed:
31

This is a trade-off between tile count and vertex count in a single tile. In your case you definitely should enable that since for a spherical graph you only have a single tile.

Ah, Unity has Updated their build groups again:( . This shouldn’t cause any problem, but it’s a bit annoying in the UI. I have to hard-code the build groups every time Unity update them which is pretty annoying.

I don’t have any problem updating a navmesh graph either with tags or making the nodes unwalkable.
Here is a screenshot of the setup I used:

Note that you can debug the tag values by setting A* Inspector -> Settings -> Graph Coloring to Tags.

You may have to set guo.updatePhysics = false.

OK,I will try it ,thank you very much :grinning:

What I want to modify is just as small as the red box, but in fact, it’s larger than I thought. What I can think of is to do more vertex points, but it will have the limit of “Too many vertex in the tile”. Can you give me some suggestions? :flushed: :flushed:
1

Can you not apply “ASTAR_RECAST_LARGE_Tiles”?
If it doesn’t work due to the error you can add it manually by editing the Player settings. Add it to the list of “Additional Defines” in the player settings.

Yes,I just want to make ‘ASTAR_RECAST_LARGE_Tiles’ false so that I can use the mesh whose vertices more than 4095.But where is the ‘Additional Defines ’,I cant see it in PlayerSettings.

You need to scroll down.
It’s called Scripting Define Symbols these days apparently.

image

Thank you.Can I specify that some ‘Graphupdateobjects’ only work on a certain layer, for example,‘Graphupdateobjects’ of radius 0.5 only works on Navmeshgraph1, and’ Graphupdateobjects’ of radius 1 only works on Navmeshgraph2? :flushed: :worried: I use ‘AstarPath.active.UpdateGraphs(guo)’,but it seems to be modify all graphs those in the A* PathFinder inspector

You can use

// Only update graph index 0
guo.nnConstraint.graphMask = 1 << 0;

// Only update graph index 1
guo.nnConstraint.graphMask = 1 << 1;

:heart_eyes: :heart_eyes: :heart_eyes: Ah,now I’m beginning to believe that I can solve the problems I’ve encountered! :grinning: Thanks!

Hi,Aron, at present I have used the ‘GraphUpdateObjects’ to ‘bake’ a obstacle on sphericial world(as long as each triangle is small enough,it’s enough for me) :smile: And now I want to use this method to realize ‘dynamic obstacle’,for example,this time my player will take down a box on ground and its ‘GraphUpdateObjects’ collider will overwrite ‘guo.setWalkbility=false’, then next time my player move the box to a far position its ‘guo.setWalkbility=true’, it is better to achieve the function like sliding door.Here is my code,but I dont think this is a good idea,because when I update the graph in runtime the frames will drop by several seconds(And is there any way to increase the speed of ‘UpdateGraphs’? )Or is there any ‘asnyc’ method to ‘UpdateGraphs(guo)’ ,then when updating graphs the game will not be stuck ? :hushed:


Hi,Aron,for solving the frames dropping when UpdateGraphs(guo),I have tried to put this method into a thread,but it will come an exception "UnityException: get_isPlaying can only be called from the main thread.Constructors and field initializers will be executed from the loading thread when loading a scene.
Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. " So I want to ask you does A* pro have an async method for ‘UpdateGraphs’?


Hi

It looks like you are updating every single collider every time you need to update the graphs. Is this really necessary?

The navmesh graph cannot be updated asynchronously I’m afraid. You can spread the update out over several frames by only scheduling a few graph updates per frame (and using FlushWorkItems every frame). However this will also prevent pathfinding from running a large portion of the time.