Pathfinding trouble with corners

Started by daniel, Mon 23/07/2018 18:58:18

Previous topic - Next topic

daniel

Hey guys,

I have this overview map with 3 hotspots that are connected by a path that "snakes" up a mountain.
The pathfinding doesn't seem to like the corners.
I've made a little diagram:



When at either Hotspot 1 or 2, the character will not go to Hotspot 3 directly.
Only once the character is at the corner marked green does he find his way up.

I already tried thickening the walkable areas but that didn't help.

What's the simplest way to get something like this to work? Is there some way to make pathfinding more effective?

cheers

Crimson Wizard

#1
Pathfinding in AGS has certain known issues, very similar to what you describe.

One potential scripting solution that comes to mind is Character.AddWaypoint command. Instead of telling character go all the way to Hotspot 3 with Walk, tell it to go to the green area first then to hotspot 3 using AddWaypoint.

Note, the work-in-progress AGS 3.4.2 version has a new pathfind inside which works much better (and faster). But if you are in the late stage of developing your game upgrading may be a bit risky, so this is only something to keep in mind for the future.

daniel

#2
Yeah I saw the alpha has new pathfinding but was reluctant to update.
Maybe I'll check it out if the addwaypoint thing doesn't work.

Thanks for the suggestions!

EDIT:

So I've tried the AddWaypoint thing and it works...except I couldn't figure out how to call the room change once the character reached the last waypoint :tongue:
I've loaded up my game in the 3.4.2 alpha and everything seems to be running fine and the pathfinding is greatly improved. So I guess I'm gonna stick with that for now.

SMF spam blocked by CleanTalk