Hello, I need to prevent my agents from going to close from obstacles.
I can create a navmesh whose holes are larger than obstacles, but for complex geometries is quite difficult and requires a lot of time.
Using recast can be an option but I do not use character controller for my agents ( they are simple rigid bodies) and I don’t know if the recast can work with them (actually i’m using the free version but i’m considering to switch to pro).
I then thought, to change the penalty of the nodes with are closer than a target distance to the obstacles.
So things I need to do are:
- cycle over all graph node
- check if an obstacle is close (i know how to do this given the node position)
- then set its new penalty.
I need to do this only when the application starts up and the graph is loaded, so in preprocessing not in runtime.
My problem is that the code related to the update graph is quite complex and I don’t know how can I integrate the code I’m writing with that. I saw that all samples using graph-update are developed using a grid-graph, and the update is done a selected region, so I think I would need to write another function to update graph instead of using graph-update.
Is that all a good idea or are there any better ideas on how to solve this problem?
Thanks a lot for the help.