Identifying sets of nodes and implementing custom logic for jumping

Hello, I am using A* Pro.

Suppose that my 2D game looks like this:

image

Technically, the walkable areas are:

image

Now, obviously I want my character to jump when going from one height to another. I would do this by iterating the pathfhinding nodes and checking if the Next node is on a different height, in which case I’d play a special animation.

To do this, the first thing I need to figure out is how to tag a set of nodes to belong to a specific “height level” - since this is a 2D game I don’t have any height data.

So my first question, what is the simplest way to identify three types of walkable nodes? Green for “height 1”, blue for “height 2” and yellow for “height 3” - do I just make three graphs?

image

The second thing is to perform a pathfind, but the tricky thing I’m not sure about is how to implement custom logic when the pathfinder is deciding whether to connect a node to another node:

In this example, I would want to tell the pathfinder to only lead me from node A to B if the “height level” difference is at most 1 (i.e. you can’t jump two height levels at once, my characters can only jump one or none at all).

But, it might depend on some runtime variables too. If my character owns a jetpack, perhaps I do want to allow traversal from height 1 to height 3.

Thanks!