SA-MP Forums Archive
Gps System Using Nodes [PAYING] - 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: Gps System Using Nodes [PAYING] (/showthread.php?tid=289437)



Gps System Using Nodes - Kyle - 11.10.2011

N/A.


Re: Gps System Using Nodes [PAYING] - Kyle - 11.10.2011

bump da dump!


Re: Gps System Using Nodes [PAYING] - Gamer_Z - 11.10.2011

whyui donr;'t uyoui usew somenione nodews rewader tot reasd noes??
MAns sryyyyyu I'm a bit druhnk I hope Ijehleped u.................

https://sampforum.blast.hk/showthread.php?tid=269695
http://forum.sa-mp.com/showthread.ph...d.php?t=269695

FREWASAAHHHH TYEAHHH!!!!!!! NOOO NEEEEDPL TO PswaAAAAY


Re: Gps System Using Nodes [PAYING] - Kyle - 12.10.2011

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
whyui donr;'t uyoui usew somenione nodews rewader tot reasd noes??
MAns sryyyyyu I'm a bit druhnk I hope Ijehleped u.................

https://sampforum.blast.hk/showthread.php?tid=269695

FREWASAAHHHH TYEAHHH!!!!!!! NOOO NEEEEDPL TO PswaAAAAY
That don't really help, as it has no code there or calculation for understanding of the algorithm in gta.

Kyle


Re: Gps System Using Nodes [PAYING] - Ensconce - 12.10.2011

Nodes can either be created yourself or extracted from nodes.dat. However, there are around 27,000+ nodes in nodes.dat which make all the single player traffic work. You then need to select an algorithm to use to find the shortest distance form Point A to Point B. The most popular algorithm being used to do this is 'Dijkstra Algorithim' or a modification of it. It can find the shortest distance from Point A to Point B by working out the lowest 'cost' to all nodes adjacent to a given node. It does this for all nodes, which is why using nodes from nodes.dat can take very long.

So, to make a GPS, you need to first research the dijkstra's algorithm and understand how it actually works. Then you can look up some pseudo code for it and apply it to pawn, you'll probably have to modify it to make it work though. Then you need to either drive around SA, and save the co-ordinates of all the intersections. These will be your nodes. You also need to figure out a way to find out the 'neighbours' of a particular node. Then you put it all together, use Race checkpoints, and create a command that searches for the nearest node to the players location, and figure out the shortest path from that node to the node nearest to the finishing location.

I do not believe in scripting for money, which is why I have taken time to tell you how you can create such a GPS system.

TL DR: How to make the GPS system.


Re: Gps System Using Nodes [PAYING] - Gamer_Z - 12.10.2011

Ok I was a bit drunk I see.... but em yeah Ensconce provided some usefull information and I'm going to investigate it and if I success in making some working routes I will try to make a filterscript or plugin (if it takes too much time) for it which will calculate the route in background.


Re: Gps System Using Nodes [PAYING] - Kyle - 12.10.2011

Quote:
Originally Posted by Ensconce
Посмотреть сообщение
Nodes can either be created yourself or extracted from nodes.dat. However, there are around 27,000+ nodes in nodes.dat which make all the single player traffic work. You then need to select an algorithm to use to find the shortest distance form Point A to Point B. The most popular algorithm being used to do this is 'Dijkstra Algorithim' or a modification of it. It can find the shortest distance from Point A to Point B by working out the lowest 'cost' to all nodes adjacent to a given node. It does this for all nodes, which is why using nodes from nodes.dat can take very long.

So, to make a GPS, you need to first research the dijkstra's algorithm and understand how it actually works. Then you can look up some pseudo code for it and apply it to pawn, you'll probably have to modify it to make it work though. Then you need to either drive around SA, and save the co-ordinates of all the intersections. These will be your nodes. You also need to figure out a way to find out the 'neighbours' of a particular node. Then you put it all together, use Race checkpoints, and create a command that searches for the nearest node to the players location, and figure out the shortest path from that node to the node nearest to the finishing location.

I do not believe in scripting for money, which is why I have taken time to tell you how you can create such a GPS system.

TL DR: How to make the GPS system.
First of all thanks for taking time to write this up, but it's Dijkstra's algorithm I do not understand. I've watched many tutorials on the internet on it and yet still cannot understand it, hence me paying for it.

Thanks

Kyle


Re: Gps System Using Nodes [PAYING] - [03]Garsino - 12.10.2011

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
First of all thanks for taking time to write this up, but it's Dijkstra's algorithm I do not understand. I've watched many tutorials on the internet on it and yet still cannot understand it, hence me paying for it.

Thanks

Kyle
Paying people won't help you learn it at all. You'd to better off by keep trying yourself.


Re: Gps System Using Nodes [PAYING] - Gamer_Z - 12.10.2011

Quote:
Originally Posted by [03]Garsino
Посмотреть сообщение
Paying people won't help you learn it at all. You'd to better off by keep trying yourself.
I'm making one and progress is going well


Re: Gps System Using Nodes [PAYING] - RyDeR` - 12.10.2011

@Gamer_Z:

You better don't release that. If you do so, it won't be considered as unique anymore cause then, everyone will have it in his server.