![]() |
#1 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Feb 2009
Location: Belgium
Posts: 3,066
Reputation: 692
|
![]()
Introduction
This is a basic implementation of the dijkstra algorithm, including a basic example of a GPS system working on nodes, using this include. Function(s) We have only one basic function: Code:
stock Dijkstra(const aeNodes[][], iStart, iEnd, aiPath[], const iSize = sizeof(aeNodes)) Here's how the node array should look like: Code:
enum e_Nodes { Float: e_fNX, Float: e_fNY, Float: e_fNZ, e_iLink1, e_iLink2, e_iLink3, e_iLink4 }; Example In the link below, there's a basic GPS system using this pathfinding include. The nodes included are complete LV nodes and were made by me a while ago. I will do the whole San Andreas world once I have some free time and when I feel like it. I don't recommend using the default San Andreas nodes from NODESX.DAT with this include as there are too much to calculate in a reasonable time. [ame]http://www.youtube.com/watch?v=rENx33otwE4[/ame] GPS.pwn Download Dijkstra.inc Last edited by RyDeR`; 17/05/2012 at 08:38 AM. |
![]() |
![]() |
![]() |
#2 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2010
Location: In a galaxy far far away, near the Netherlands
Posts: 2,842
Reputation: 2128
|
![]()
So, this is basically a sort of system including positions for checkpoints and the system calculates where's the closest position is? Am I right with this? Cause I'm afraid I don't really understand the working and usages of this system.
|
![]() |
![]() |
![]() |
#3 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2008
Location: Sweden
Posts: 1,066
Reputation: 120
|
![]()
Nice done, Ryder.
![]() ![]() |
![]() |
![]() |
![]() |
#4 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2010
Location: Latvia
Posts: 639
Reputation: 78
|
![]()
dijkstra's algorithm find the shortest path between any 2 points.
|
![]() |
![]() |
![]() |
#5 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2010
Location: Lithuania
Posts: 1,254
Reputation: 137
|
![]()
Well, there is this plugin released, you know?
|
![]() |
![]() |
![]() |
#6 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2009
Location: Home
Posts: 2,423
Reputation: 251
|
![]()
Just Amazing! Keep your work up.
|
![]() |
![]() |
![]() |
#7 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Feb 2009
Location: Belgium
Posts: 3,066
Reputation: 692
|
![]() |
![]() |
![]() |
![]() |
#8 |
Huge Clucker
![]() ![]() ![]() Join Date: Jan 2012
Posts: 224
Reputation: 1
|
![]()
Nice
|
![]() |
![]() |
![]() |
#9 |
Big Clucker
![]() ![]() Join Date: Feb 2009
Posts: 120
Reputation: 12
|
![]()
I love Dijkstra and it's really useful.
As you said with this algorithm you can do a lot of things. We learned it at school (graph theory) and it's not only for GPS Systems. Furthermore the plugin from Gamer_Z doesn't work on every server (on the other hand Gamer_Z work is also good) |
![]() |
![]() |
![]() |
#10 |
Spam Machine
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,597
Reputation: 3039
|
![]()
Actually, most GPSes don't use this simply because to calculate any route would take FAR too long. I believe they do multiple levels - find the shortest path between near you and your destination on major roads, then get you to and from those major roads using a subset of the smaller roads between where you are and the nearest point on the major road.
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
An algorithm for vehicle streamers | Double-O-Seven | Scripting Help | 1 | 10/10/2011 08:17 PM |
[Include] M4S7reamer v1 (object streamer that uses a zoning algorithm) | M4S7ERMIND | Includes | 17 | 22/07/2011 08:03 PM |
NPC Artificial Intelligence - Shortest path algorithm | Harry_Gaill | Screenshots and Videos | 76 | 14/05/2011 06:13 PM |
Bullets Algorithm ? | MJ! | Help Archive | 0 | 18/08/2010 07:38 PM |