Issues with 2D Pathfinding, maybe you can help?
Hi!
I'm currently working on a top down rpg game. Character is moving by clicking on the map, then creating a "target" point, creating a pathfinding path from character to target, then moving there leaving a trail, similar to an Indiana Jones style map, basically. Since the map is using forests, denser forests, mountains and so on, which all use different movement speeds to walk through, i'm not using obstacles on the streets, to have the character use those as much as possible, but also giving the player the option to stray from the path to explore forests and the like.
You can see on the picture how I set it up visually with lots and lots of single pathfinding obstacles., I hope the general gist of it is somewhat clear.
Now, my problem is that a) the pathfinding doesn't seem to work that great, the character slides along or into lower-speed zones more often than not, or takes "wrong" routes through a lower-speed zone without reason, but b) if I raise the obstacle zones' costs to 2 instead of 1, it does avoid a) but straying off-path becomes completely unpredictable if desired. Sometimes a click right next to the character works, more often than not it won't. I'm assuming that's because costs add up or something.
So what I would like is some option to keep my character on-path generally, but let the player stray into some obstacle zones without much hassle if they want to. Does anyone know of an alternative how to do this, or of a better working way to have the kind of pathfinding i'm looking for?
(I also made a quick and dirty try with NavMesh pathfinding, but while the character movement on-path is much better, it would also be impossible to stray from it, and it would destroy a lot of my other mechanics from what I gather. But I admit I just tried it on a blank scene, since I can't get it to work yet on my actual scene).