Pawn GPS Route Finder
#1

Today I set out to complete the challenge of creating a solely PAWN GPS Route calculator which calculates the shortest route from Node A to Node B.

In all it took me about 7 hours of solid work to complete the base with only struggling once. Nero_3D was on hand to help and offer his assistance which got me back on track in completing the work.

The calculator uses the default GTA SA nodes from GTA nodes.dat.

The worse case scenario for the calculator is approximately 305ms which is from Bayside to LS Docks.

I'm looking to expand this with expansion of functions and flexibility before I release it.

I may create a web-based version where you enter the start and end node, and the website echos a list of nodes for the route. Post your suggestions and questions below.

Credit:

Southclaw - Consulting
Nero_3D - Assistance and Consulting
Gamer_Z - The initial nodes.

Here is some screenshots of my work:

The loaded nodes:







An example of the Route Finder in action:







Reply
#2

How does it perform in comparison to plugin version?
Reply
#3

I've ran a few examples and these are the results, but what you must remember is that I didn't set out to compete with the GPS Plugin as it's virtually impossible to go against a threaded c++ plugin in terms of speed. These results compare to the first GPS Plugin Version but since the version stopped using invoke and started using threads, the speed reduced considerably, something which PAWN cannot compete against.

Note: CalculateRoute is the actual calculation of the route and OnGPSRouteCalculated is where the arrows tangent angle etc is calculated.

Santa Maria Pier to Grove Street

CalculateRoute took 48 ms to execute.
OnGPSRouteCalculated took 1 ms to execute.

LSPD to Grove Street

CalculateRoute took 81 ms to execute.
OnGPSRouteCalculated took 1 ms to execute.

Pickle Pine to Rockshore West

CalculateRoute took 23 ms to execute.
OnGPSRouteCalculated took 1 ms to execute.

Fort Carson to Pickle Pine

CalculateRoute took 62 ms to execute.
OnGPSRouteCalculated took 1 ms to execute.

Bayside to LS Docks - Longest possible route

CalculateRoute took 300 ms to execute.
OnGPSRouteCalculated took 1 ms to execute.
Reply
#4

Interested to see the code!

Quote:
Originally Posted by KyleSmith
View Post
I've ran a few examples and these are the results, but what you must remember is that I didn't set out to compete with the GPS Plugin as it's virtually impossible to go against a threaded c++ plugin in terms of speed. These results compare to the first GPS Plugin Version but since the version stopped using invoke and started using threads, the speed reduced considerably, something which PAWN cannot compete against.

Note: CalculateRoute is the actual calculation of the route and OnGPSRouteCalculated is where the arrows tangent angle etc is calculated.

Santa Maria Pier to Grove Street

CalculateRoute took 48 ms to execute.
OnGPSRouteCalculated took 1 ms to execute.
[..]
Wait... what exactly did you benchmark here? CalculateRoute is the PAWN function which generates the route whereas OnGPSRouteCalculated is the callback called after the plugin finishes calculating the route in a secondary thread?
If so, then you're not actually comparing the route calculation algorithms?
Reply
#5

Quote:
Originally Posted by AndreT
View Post
Interested to see the code!


Wait... what exactly did you benchmark here? CalculateRoute is the PAWN function which generates the route whereas OnGPSRouteCalculated is the callback called after the plugin finishes calculating the route in a secondary thread?
If so, then you're not actually comparing the route calculation algorithms?
Yes, you're right. Although I never said I was benchmarking against the plugin; but I will be soon.
Reply
#6

Using times as 'benchmark' is completely useless without some reference material, as it depends on so many variables you could say it depends on the way te stars are aligned.

I'd like to see comparisons between other functions, and maybe (preferably) the time complexity in O.
Reply
#7

seems nice good job
Reply
#8

Quote:
Originally Posted by Infinity
View Post
Using times as 'benchmark' is completely useless without some reference material, as it depends on so many variables you could say it depends on the way te stars are aligned.

I'd like to see comparisons between other functions, and maybe (preferably) the time complexity in O.
"and maybe (preferably) the time complexity in O."

What is O?
Reply
#9

http://en.wikipedia.org/wiki/Big_O_notation

I'd like to see the comparison of those algorithms - why would I use a plugin version if pure pawn performs as well? (maybe except that threading advantage)
Reply
#10

PAWN Version:

High roller to Montgomery Took 135ms to execute.
Angel Pine to LS Docks Took 135ms to execute.
Angel Pine to Dillimore Took 251ms to execute.
Dillimore to LS Docks Took 43ms to execute.

GPS Plugin

High roller to Montgomery Took 0ms to execute.
Angel Pine to LS Docks Took 0ms to execute.
Angel Pine to Dillimore Took 0ms to execute.
Dillimore to LS Docks Took 0ms to execute.

Conclusion of the results

As you can see, the GPS Plugin is evidently quicker. But I'd like to re-iterate I didn't set out to create a faster process. If you think that PAWN will win in a PAWN vs C++ race you must be delusional.

I set out to create what it says on the tin, a PAWN GPS route calculator. I wanted to do this as the GPS Plugin is heavily broken for linux, it doesn't play nice with crashdetect, causing crashing, hanging etc.

I'm not here to take away credibility of the GPS Plugin, but by two people, I've been told it's bad in other terms, but you can't take away the credibility of the super speed for the Plugin version.

Pros:

Plugin:

- Currently has more features.
- Speed

PAWN:

- Direct array access
- No loading of plugins and using of additional RAM.
- Easy to edit

Currently it only has the basic fundamentals of a GPS Calculator, but I'll be adding additional features just like the plugin has.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)