Blockland Forums > Modification Help

WIP inefficient pathfinding algorithm

(1/3) > >>

Robot:
Sorry to disappoint if you were one of the people in BCC following along with this but I don't think I have the capacity to finish this project. Pathfinding algorithms are over my head and I just haven't had the time to do the research, and with the future of Blockland becoming more and more uncertain I haven't had much motivation to work on it either. That may change, but nonetheless it feels wrong to just sit on it indefinitely so here you go.

I did my best to write comments to kinda explain what's going on in here. You are free to use this code however you want.
https://cdn.discordapp.com/attachments/609001398087974943/621229227395645451/System_WRathfinder.zip

Basic usage:
- Type wrath_generateNodeMap(); in console. This will create nodes for your entire build. If your build is too big it might explode and crash your game.
- Type wrath_newPath("start coordinates", "end coordinates"); in console. The system will now increment through nodes to try and 'find' the goal node from the start node and will dump a bunch of information into your console during the process. The example wrathfinder_newPath("-54.75 -56.25 0.5", "73.75 91.25 13.3"); will look between one corner of Afghan DM to a roof of a building at the opposite corner.

This wont produce any useful information, the shortest path isn't actually cached, it just stops once it finds its way through the nodes. The framework is there though. I think what I'd try to do would be to add a heuristic to every node visited in the path based on what time/order it was visited, and then increment through the path again, but always going to the neighbor with the highest heuristic. That should give you the shortest path through the visited nodes but not necessarily the actually shortest path.

Also features a tool that can place and delete nodes, the intent was to try and make it so you could create your own, way more efficient node graphs manually. You can equip it with /nodeGun. It seems to do a pretty stuffty job of finding nodes when deleting/linking though so careful if you intend to use it with generated maps with thousands of nodes.

Tendon:
This is pretty cool.  I can't get it to generate a nodemap without it hanging forever.  But the node Gun looks useful for things.

PhantOS:
how is it different from port's node gun

Robot:

--- Quote from: PhantOS on September 11, 2019, 08:41:57 PM ---how is it different from port's node gun

--- End quote ---

Can you post a link? Haven't heard of this before

PhantOS:
For some reason I can't find it on their github, mb. But this exists https://github.com/qoh/ts-pathing-new/blob/master/lib.cs

Navigation

[0] Message Index

[#] Next page

Go to full version