MV Shaz's Smart_Path_MV plugin getting stuck on walls?

I've been using Smart_Path_MV by Shaz throughout the entire development of my game, and it's had no issues up to this point.
I have a system in place for this map where the NPC in the white/purple cloak walks to different points of the map depending on the player's Region ID. I have a parallel process event that checks the player location every 1.5 seconds, and if the NPC isn't already standing in their place, it tells them to walk there with the SmartPath command.
Not everything fits on the screen, so it's missing the wait command at the top and the second SmartPath command below, but here's the list of commands:
Screenshot_1.png


And here's a screenshot of the portion of the map in question:
Screenshot_3.png

The NPC is at the bottom sort of to the left, and he's meant to walk to where the duplicate is standing at the top of the image. This only happens after the player has pushed the dead tree into the pond and walks across it.

The issue comes up when the NPC starts walking, he walks up to the cliff directly left of the pond, and then turns upwards and stops, as if he's trying to walk through the cliff. Here's one last image of what happens when I playtest this portion of the game, just for reference:
Screenshot_2.png


To give a few more details, the cliffs are set as walkable tiles, and the events lining the top and bottom prevent the player from traversing them unless specific conditions are met. This made me wonder if the problem would be solved by making the cliffs unwalkable in the tileset settings, but that didn't change anything.
Other things I tried include setting the dead tree tiles to "Through", or changing only the water tiles that the tree is on to be walkable, to see if either of those were creating a barrier, but neither worked (would it be different if I tried both at the same time?)
I've thought about setting the NPC to "Through" when he's walking, but I know from past experience that would allow him to just walk through the cliff, which is not what I want (and creates some crazy narrative complications, as you could imagine).

Does anyone who's used Shaz's plugin know if there's a fix for this? Do I just need to find a new pathfinding plugin to use in this area?

And thank you, I know this is a bit of a long post.
Events can't go through events (in most cases). Its part of the rules of the engine. To me it looks like its getting stuck because of another event in the way (and yes even invisible events count).

As for why it's not going around? No idea on that one. Might be blocked by something else or it just sees the log and is like hey let's try it! Oh there's an event never mind and resets. So it might be getting confused by that.

Also check if you region marked it for another plugin as not passabile.
I notice you have a lot of events plastered across the cliff. Are any of those events set to Below Characters? The pathfinding you're using is biased towards the player, so it doesn't account for the THROUGH setting (an event can only step on another event if one of the two events is THROUGH). This means that, if any of the events on the cliff are Below Characters, the pathfinder might think it can pass through; but if that event is not THROUGH, the event won't be able to pass it and would get stuck.

This is just a guess. I'm not sure if it even makes sense (actually, I think it's more likely not the issue), but it's something worth checking.

Events can't go through events (in most cases). Its part of the basic rules of the engine. You'd have to make the log not an event.
This isn't correct. Events can go through events if either of the events are THROUGH.
They said above they didn't want to use through.
They said they didn't want to set the NPC to THROUGH, yes, which is quite understandable. But setting the log to THROUGH should be fine – they even said they tried it. However, apparently it didn't work.
The invisible events at the base of the cliff are set to "Below Character", but not "Through". That doesn't seem to be an issue though, as the NPC walks on those tiles with no issue.
Initially, the log tiles were  not set to "Through", and once I changed that the NPC got one tile closer to the pond (as seen in the playtest screenshot). I tried setting the log tiles in the water to "Through" as well -- also needing to make those water tiles walkable -- but it didn't change anything.

I looked through a few other forum posts and found that the plugin seems to struggle with larger maps? It's around 60x120, so that could be the issue.
The invisible events at the base of the cliff
I was thinking more about the invisible events pasted on the cliff itself. If the pathfinder thinks one of those events is walkable, that could cause this.

As I said before, it doesn't seem a very likely cause (they don't look like they're set to use a tile image) but it's worth at least checking.

I looked through a few other forum posts and found that the plugin seems to struggle with larger maps? It's around 60x120, so that could be the issue.
Nothing in Shaz's plugin depends on map size. However, it uses the same pathfinding algorithm as the game itself uses when you click on a tile to walk there, which does depend on map size and complexity. That's something worth checking as well – if you temporarily move the NPC out of the way and disable it, put the player on the NPC starting point, and click on the NPC's destination, does the player get stuck at the same place?

If so, then what you probably need is to raise the search limit. You have a few options for that.

  1. Globally raise the search limit for everything – put this code in a file, name it with a .js extension, and add it as a plugin. Make the number bigger until it works. The default value is 12, so don't go any lower than that. Raising it too high can hurt performance.
    JavaScript:
    Game_Character.prototype.searchLimit = function() {
        return 24;
    };
  2. Raise the search limit only for that one event. Put this line of code in a movement route script call for the event, before calling the pathfinding command. You can replace 100 with any number that works.
    JavaScript:
    this.searchLimit = () => 100
  3. Use my SFG_Pathfinding plugin, which allows you to use note tags to customize the search limit (as well as adding many other improvements to the pathfinding algorithm). It can be found here. You can just add <searchLimit:24> to the event's search box to adjust the search limit. My plugin complements Shaz's – Shaz merely adds a command to make an event pathfind, whereas mine reworks the pathfinding itself. Note: to use my event, you also need to install SFG_Utils, which can be found in my signature.
If so, then what you probably need is to raise the search limit. You have a few options for that.
Interesting, I haven't heard of that before. I'll give it a try when I sit down to work on the game next.
For the sake of information, what specifically  is the search limit? What changes by manipulating it? I lightly skimmed Google but didn't see anything, but I imagine knowing more about it would make it easier to know by how much I should be changing it.
A simple way to describe it would be that it won't find paths longer than the search limit – if it gets that far away from the start and hasn't yet reached the destination, it'll give up and try a different path.

Technically though, it's not about "length" of the path but rather "cost". I think they're the same for the default pathfinder, but they don't have to be (my plugin modifies costs in a number of ways).

Note that this does not mean it can't traverse paths longer than 12 tiles (or whatever the search limit is) when the map is larger than that – if there's no path shorter than the search limit, it'll follow a path that gets it as close as possible. Then, when it gets to the end of that path, it'll see it's not at the destination yet and find a new path getting it closer. This works better on open maps; it'll get stuck in mazes. (Also, that actually describes how it works in my plugin. The default pathfinder finds a path, takes the first step, and then finds a new path, over and over until it reaches the destination.)
A simple way to describe it would be that it won't find paths longer than the search limit – if it gets that far away from the start and hasn't yet reached the destination, it'll give up and try a different path.
Worked like a dream, thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/shazs-smart_path_mv-plugin-getting-stuck-on-walls.183526/