Support Forum

Playground slides

I have 2 part to the question:

  1. Is it possible to make the agent prefer to go around the stairs when going up, and slide down when going down? This has to do with one-way cost maybe, but i can’t find a definite “how-to” to do that
    All i know is, the cost should still be the Euclidean distance (xyz), but multiplied by comparing the next node’s Y pos, exponentially
  2. If i have Spiderman, depending on the recommended way to achieve #1, can i make him ignore this uphill cost and take the slide upwards if that is closer?

So I’m trying to follow #1 in your suggestion here:

I have public class RecastSlopeGraph : RecastGraph
And traced to where AddConnection is called, and that’s all the way in NavMeshBase.ConnectTiles.744, but ConnectTiles is not virtual
Actually, i’m also not sure how to override TriangleMeshNode to add slope information

But, if i make changes to core then it’s pretty straightforward.
I’m just not sure if this is the correct approach, also in terms of extending the package in general

Sorry, just another update. Seems like i’m also not sure how to best describe this
So far the heuristic makes the search prefers the one that gets it closer to target
I want to mix this heuristic(?) to also score it less if the cost is too high. So, to make it also prefer to “conserve energy”
Is this possible?

I know the Penalty value can change the agent’s decision to take another route. But the (1 way) connection “cost” is not accessible in ITraversalProvider
Is there a way to figure out what node you’re currently in (in the search process), in ITraversalProvider? This would be your #2 solution, but without knowing where you’re calculating from, it’s pointless

If only Path.GetTraversalNode also takes GraphNode parent parameter, then this would be a super powerful feature…

Alright. It works!
Following this post

Accessing pathHandler gets the whole magic i was looking for!