25.12.2018, 18:54
Quote:
Version 1.1.0 has been released!
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 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? |
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).