Node/Pathfinding Calculator - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Node/Pathfinding Calculator (
/showthread.php?tid=604351)
Node/Pathfinding Calculator -
jeffery30162 - 03.04.2016
I am creating an npc taxi system to where it will calculate a path from the npcs current position to the players position.
Currently I am using routeconnector but the nodes are not the greatest, do you know of an others, or do you have any suggestions?
Re: Node/Pathfinding Calculator -
NaS - 03.04.2016
The Nodes are great, what you need is interpolating the Nodes to lower distances and smoothing, look at AIped and my NPC Drivers FS, it also includes a Taxi call function.
The driving doesnt look the best, but with performance in mind I don't think it can be improved much, except SAMP adds more stability to the NPC movement.
Re: Node/Pathfinding Calculator -
jeffery30162 - 03.04.2016
If i use intersection between nodes in calculated path, How do I know when the npc has reached that point to tell him to comtinue to the next?
Thats not even the issue, the issue is bridges
If the npc has calculated a route to take under the bridge, when it approches the bridge it will use the nodes that are above them on the bridge instead of the ones under
Re: Node/Pathfinding Calculator -
NaS - 04.04.2016
Quote:
Originally Posted by jeffery30162
If i use intersection between nodes in calculated path, How do I know when the npc has reached that point to tell him to comtinue to the next?
Thats not even the issue, the issue is bridges
If the npc has calculated a route to take under the bridge, when it approches the bridge it will use the nodes that are above them on the bridge instead of the ones under
|
The FCNPC plugin uses FCNPC_OnReachDestination for that, and for the bridges, use either ColAndreas or MapAndreas for it, if the Node's Z is more than 1.5 or 2.5m below the Z level use Node Z, else Map Z.
If you fully depend on ColAndreas Bridges and Tunnels are not a problem at all.
Re: Node/Pathfinding Calculator -
jeffery30162 - 04.04.2016
how do I correctly position the vehicle on a hill for it does not appear jumpy when going from pos to pos