[Plugin] Modern GPS plugin
#1

https://www.burgershot.gg/showthread.php?tid=66
Reply
#2

I had thought to use Router Connector, but ЎBut a more active plugin !, I congratulate you boy!
Reply
#3

Very modern, much wow.
Reply
#4

Could you make a way to create our own GPS.dat like RouteConnector?
Reply
#5

Nice
Reply
#6

Very very Nice job!

-

Happy Christmas
Reply
#7

Mashallah. Good work.
Reply
#8

Good job
Reply
#9

very std::thread, very wow.

will use it for sure.
Reply
#10

Any pictures plz?
Reply
#11

Quote:
Originally Posted by kvann
View Post
Version 1.1.0 has been released!
  • Fixed GetMapNodeDistanceFromPoint and GetClosestMapNodeToPoint.
  • Some refactoring.
  • New natives:
Code:
native GetAngleBetweenMapNodes(MapNode:first, MapNode:second, &Float:angle);
native GetMapNodeAngleFromPoint(MapNode:nodeid, Float:x, Float:y, &Float:angle);
native GetMapNodeConnectionCount(MapNode:nodeid, &count);
native GetHighestMapNodeID();
native GetRandomMapNode(&MapNode:nodeid);
I will update the readme soon. I did not add any functions for individual connections yet since their internal structure will probably change a lot in the next release. Also, I must have done my initial benchmarks with a debug build since the plugin is actually over ten times faster than I said in the first post, finding a path through the whole map actually takes under 0.1 seconds.





I have these things planned for the next bigger release or the one after. Right now this plugin only contains functions I needed to convert my gamemode from RouteConnector plus some extras. Runtime editing of nodes and loading/saving them will definitely be a thing, not sure when though, since I have a busy period coming in school. I'm not sure about RebuildNet right now, I believe it's a RouteConnector thing since it prebuilds the graph. This plugin doesn't do that, all the nodes and their connections just act as a graph in the pathfinder. Correct me if I'm wrong though.



Yeah, I took a look at the original data format when trying to understand how directions in GPS.dat work. Road widths and lane counts could also be used in the pathfinding algorithm to prioritise highways and main roads. I would also like to make as much data accessible to developers as possible. Also, for now, I've found out that an offset of 2.5 units is the golden mean that works for most roads.



I'm actually using the fixed one, you're even in the credits. Also, can you confirm if Gamer_Z is the creator of the original one or is it someone else?
Sounds good! The RebuildNet was neccessary for Gamer's Plugin but if it's not neccessary for this one even better! It was pretty inconsistent anyway - if you edited, added or deleted nodes while using the Plugin for Path Finding, the graph would still link to deleted nodes which led to crashes and bugs, also wrong distances and more.

2.5 is good, I used 2.2 for my NPC Drivers but that's probably a negligible difference. However in some parts this is either wrong or just uses 1 of 2 lanes, but that is a minor problem.

About the GPS.dat, didn't see that sorry! I also have a GPS.dat for Vice City, since many people use the VC Map for 0.3DL I guess it could be useful (I created that one with my editor without the original path data, so no additional info is available for that unfortunately however the original node files are pretty much the same).
Problem with that is the position of the VC Map. But if you know the offset, you could just use a loop to move all Nodes to the proper position.

From my knowledge Gamer_Z is the original author of the GPS.dat, I remember he was processing the node*.dat files using a Script or Program and generate his own format for it.

Also the speed is awesome!
With Gamer's Plugin it took about a minute or longer for the initial path calculations, with this one it's under 10 seconds, depending how long the paths are.
Thanks for this great release!

Here's the Vice City GPS.dat if anyone is interested: https://pastebin.com/cVQ2cH9P
There are some chaotic nodes in some places because of too many intersections (limit was 5).
Reply
#12

Thanks for update, I have successfully integrated this plugin with my auto drive and race script. working smooth with amazing performance.
Reply
#13

Version 1.2.0 has been released!
  • Fixed the pathfinding algorithm - node comparison was completely broken and it most likely returned the first path it found, not the shortest one. It also improved the performance a lot. Using non-threaded pathfinding, finding a path from the top-leftmost node on the map to the bottom-rightmost node takes just 3 milliseconds on my testing server - that is around 30 times faster than before! Threaded (and asynchronous) pathfinding should be just as fast in real life situations, my test script spammed out so many pathfinding function calls that std::mutex became the "bottleneck".
  • Refactored some more code, node connections are now the only thing that need to be refactored, but this will happen when I implement runtime node management.
  • Updated the GPS.dat distributed with the plugin, thanks NaS!
  • New native (requested by Kar):
    Code:
    native GetPathNodeIndex(Path:pathid, MapNode:nodeid, &index);
This isn't what I promised in my last few posts, but the plugin has gained quite a few users since then and Kar and Graber found a huge flaw in the algorithm that needed fixing and it was also a good opportunity to roll out some smaller updates.
Reply
#14

Just switched from RouteConnector to this plugin for the NPC Drivers and found a small issue with node connections.
If a node points to another node but it doesn't point back, the path sometimes stops there (although it should probably try to find another way). It seems to work in most cases but rarely doesn't.

An example for that would be near the LS Airport highway (I can try to find two node ids that produce this if this helps).

I also get a warning/error in the console sometimes:

"Failed to dispatch thread: resource unavailable try again: resource unavailable try again"

It keeps spamming that and then crashes. So far no idea why it happens, it doesn't seem to be too busy at that point and I made sure the nodes passed to FindPathThreaded are valid etc.
Reply
#15

Quote:
Originally Posted by NaS
View Post
Just switched from RouteConnector to this plugin for the NPC Drivers and found a small issue with node connections.
If a node points to another node but it doesn't point back, the path sometimes stops there (although it should probably try to find another way). It seems to work in most cases but rarely doesn't.

An example for that would be near the LS Airport highway (I can try to find two node ids that produce this if this helps).

I also get a warning/error in the console sometimes:

"Failed to dispatch thread: resource unavailable try again: resource unavailable try again"

It keeps spamming that and then crashes. So far no idea why it happens, it doesn't seem to be too busy at that point and I made sure the nodes passed to FindPathThreaded are valid etc.
Thanks for reporting, it's interesting that these things have happened to nobody else considering that the plugin is used on some large production servers (KCNR, a spanish and an iranian server, soon on RC-RP). I'll do some testing when I find some time and get back to you if I need some more information. I should implement the last missing features soon, I've left the plugin unmaintained for about 3 months already...
Reply
#16

No work in Centos 7
Reply
#17

Quote:
Originally Posted by darkHero
View Post
No work in Centos 7
Here's a static build for you.
https://tommyb.ovh/files/GPS_static.zip
Reply
#18

This sounds silly, but I was trying to copy in CentOS and I can not imagine it was because I needed to combine the C ++ 11 libraries with C ++ 17, thanks for helping.
Reply
#19

I started working on version 2.0.0, which will finally feature runtime node management, you can keep an eye on the GitHub repository to be updated with the progress.
Reply
#20

YESSS! That's exactly what I wanted to hear!

Seriously, that's awesome. I requested this is the third post and this genuinely makes me hard.

Now once that's complete we just gotta make a navigational mesh for the entire map of San Andreas...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)