Path Finding With Different Elevations

So, given that i have that i have an enemy who is on a plat form 5 meters higher than the player, and has a ramp going down to player elevation… When i path find, how do i check to see if the drop off of a platform, in this case 5 meters, is greater than 3 meters (or whatever height) and there is another way to get to a position (in this case, the position of the player).

I basically want the enemy who is on said platform to walk down the ramp, instead of walking off the side of the 5 meter high platform (which would cause fall damage). Also, if no other path exists for said enemy to go down that is safer than jumping, he should jump.


Any help is appreciated <3

quite simply,

have a point we’ll call “B” at the bottom of the ramp.

now also have (say) three points (F, G, H) which are where HE WOULD LAND, IF HE JUMPED.

so, forget about where ther guy is standing (on the platform).

path-find separately from B, F, G, H.

make an intelligent decision based on whatever factors you want.

(obviously, once you decide, have him separately move ro B.F.G or H, and then turn on your pathfinding-whatever algorithm for the rest of the travel.)

This is very common, you have to “stage” your pathfinding.

I get concerned generally when beginners get all “a-star!” … often it’s better to step back … is there a simpler way?

So, I hope it helps.

It’s funny, what you’re doing is EXACTLY like GPS engineering in europe

(ie, you have to consider the stupid channel tunnel and that fucking long storebeltsbronenwhatever brucke as special cases that poop all over your otherwise elegant algorithms.)