Node graph settings

Hello Dear Aron
1-In the node graph, how can set a penalty for the path between two nodes?
2-How to affect the slope of the terrain on graph nodes, so that the path between nodes that are on the unauthorized slope are out of reach

Hi

  1. You might be interested in https://arongranberg.com/astar/docs/graph-updates.php
  2. There’s a setting called ‘max slope’ in the grid graph settings, maybe that’s what you are looking for?
1 Like

Hi
Thank you for your answer, but both of my questions were about the point graph

Sorry, I mistyped a node graph instead of a point graph in the first my post and title of topic

If it is not possible to set the penalty and slope for each node in the point graph, please guide me how to change the source to add these two properties to this graph
Thanks

Hi Dear Aron , please help me about those questions in point graph , thanks

Hi

Usually you’d use a grid graph for a terrain, which includes settings for adding penalties to slopes.

For a point graph. This depends on how you create it. Do you create all nodes from code or are you using gameobjects in the scene?

1 Like

Hi

The grid graph is slow for very large terrains, and it is also difficult to determine the penalty in Custom paths

I want to create points by code but exclude points from navigation, that are on a slope greater than the specified slope relative to neighbors points
I can also set penalties between different points

Hi

If you create the point by code (using point graph.AddNode and node.AddConnection) then you have full control over all penalties. Just make the cost larger in the AddConnection call.

1 Like

Hi
Excellent, and what about the slope?
Thanks

Hi
please help me about slope on the point graph
and please say to me about update cost of one node on the point graph after create it
Thanks

Since you say you create all connections by yourself, you can just not create a connection if the slope is greater than whatever threshold you want. Not quite sure what you are asking for here.
Adding a connection to the same neighbour will replace the previous cost.

1 Like

Thank you for your answer
I’m sure what I want just i am not complete familiar with your system