Support Forum

Recast makes a far way path, , but actually it is very near ,why?

HI, we are using A* in our game,and I met some troubles::
sometimes ,the AI just does not go straight to right way as picture, the green line is Recast Path (around far away),the tank should go through the red line:

坦克走奇怪线路
I am using Recast on my map ,and my map is very huge (32000X32000)
In most case , I can get a good path with Recast ,but sometimes , when I try to go some place or avoid some NavmshCut area, the AI will make a roundabout path to target , but it should be a very near distance, here is my config , what should I do to make a right way ??

here is my config about a*


I have read the project about RecastDemo on Github, C++VERSION,
I can start the RecastDemoproject and export a navmsh.bin as navmesh data,
In Astar document ,I see you modify some recast function to C# version ,and
Is there any way ,Astar can read the .Bin data directly??

Hi

If the navmesh has some very small triangles placed next to very large triangles, this can happen in some cases. Though your case looks quite extreme. Do you have a picture of your navmesh?

I’d also recommend that you set your funnel modifier quality to ‘High’, or if you are using the RichAI script, enable funnel simplification.

No, there is not. This package cannot read recast’s original navmesh data file.

Thanks ,I will try it


red “X” is start, blue one is End, ,and I use NavmeshCut for city,
I Set"Max Border Edge length =500" on Recast Graph panel , so Now much less tris in the mesh


whole MESH IS 32000 x 32000

it seems ,NavmeshCut makes a lot of very small triangles, in my game every player own a city which should be avoided on navigation , and the player can move the city from one place to other place ,so the whole mesh is dynamic , or is there any other solution to repalce NavmeshCut ??

I try “Use Tiles” ( on github the origanl Recast project never use it on his data) and set the Tile Size =500 on recast Graph panel, and the new ground data make the pathfinder work much better ,
Hopes it can helps others ,cheers

:grin:

1 Like