Questions about terrains with lots of elevation changes

Hi,

I’ve been toying with the free version of this great project for a couple of days now. Using grid graphs mostly. I’m thinking of buying the asset from the store for the multithreading and runtime updating but I’ve got a couple of questions that I’d like to get some answers for.

  1. Is there an out of the box way (or some known convenient hack / workaround) of penalizing or denying the AI from moving up steep enough hills but still allowing downhill (of similar steepness) movement at the same time?

And as a similar kind of question, what would be the best way of prioritizing a certain route for an agent? Say for example making an agent prefer areas that have been marked as roads but still allow areas not marked as roads?

  1. Is it possible to have 2 grids (with differences) on the same terrain and and then switch (in code, based on some trigger etc.) which grid an agent uses at a certain time?

Would greatly appreciate any answers or ideas!

Thank you!

  1. Sorry. In the grid all connections have the same cost in both directions. It is possible to hack it to get it working, but in my experience you get better results from simply adding a penalty for walking on any slope. In the pro version it is possible to automatically apply a penalty to slopes, or read penalties from a texture.

  2. Yes, that is possible. See the graphMask parameter here: https://arongranberg.com/astar/docs/class_seeker.php#ab50a876ab529ceb3eb9b97deb5a48d1e.