[Plugin] Modern GPS plugin
#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


Messages In This Thread
Modern GPS plugin - by kristo - 23.12.2018, 23:27
Re: Modern GPS plugin - by Alexis17 - 23.12.2018, 23:37
Re: Modern GPS plugin - by RogueDrifter - 24.12.2018, 00:49
Re: Modern GPS plugin - by Crayder - 24.12.2018, 02:40
Re: Modern GPS plugin - by SyS - 24.12.2018, 10:36
Re: Modern GPS plugin - by PT - 24.12.2018, 10:40
Re: Modern GPS plugin - by Logic_ - 24.12.2018, 13:10
Re: Modern GPS plugin - by Marshall32 - 24.12.2018, 15:01
Re: Modern GPS plugin - by cuber - 24.12.2018, 16:05
Re: Modern GPS plugin - by Awide - 24.12.2018, 19:07
Re: Modern GPS plugin - by NaS - 25.12.2018, 18:54
Re: Modern GPS plugin - by iorp - 26.12.2018, 08:40
Re: Modern GPS plugin - by kristo - 01.01.2019, 14:27
Re: Modern GPS plugin - by NaS - 31.03.2019, 13:59
Re: Modern GPS plugin - by kristo - 31.03.2019, 14:26
Re: Modern GPS plugin - by darkHero - 08.04.2019, 10:15
Re: Modern GPS plugin - by TommyB - 09.04.2019, 07:11
Re: Modern GPS plugin - by darkHero - 09.04.2019, 07:15
Re: Modern GPS plugin - by kristo - 12.04.2019, 21:10
Re: Modern GPS plugin - by Crayder - 13.04.2019, 04:30

Forum Jump:


Users browsing this thread: 1 Guest(s)