Skretzo / shortest-path

Pathfinding for Old School RuneScape
BSD 2-Clause "Simplified" License
14 stars 27 forks source link

Suggestion: Add spirit trees and or gnome gliders #29

Closed Fjara-h closed 1 year ago

Fjara-h commented 1 year ago

Would be nice to include these if the performance hit isn't too much - I am currently on early-ish game ironman effectively just questing and my primary transport is fairy rings (already included), spirit trees, and gliders as I mainly use the Ardy cloak 1. I don't know how much use the gliders would get but the tree is pretty essential for me.

Thanks Skretzo!

Skretzo commented 1 year ago

I am actually working on adding gnome gliders, so it will be in the next release. If you want to help out I need the number of ticks it takes to travel to each destination

Fjara-h commented 1 year ago

https://www.youtube.com/watch?v=TSSr9Kn8MBg

is this sufficient? i do not have access to ape atoll

Skretzo commented 1 year ago

I can work with that, sure, but a tick counter on the report button instead of login time would be easier. The var inspector tick counter might be enough actually And thank you!

Fjara-h commented 1 year ago

Here is a 2nd with the tick counter https://www.youtube.com/watch?v=yDRAWOJX_AE

Oliver-Saer commented 1 year ago

Any updates on this, is it still planned for future release?

Skretzo commented 1 year ago

This is definitely still a planned feature, but I sadly do not have an ETA. Here's why:

Spirit trees are big objects that allow you to interact with the tree at different locations and teleport you from there: gnome_stronghold_spirit_tree The Tree Gnome Stronghold spirit tree in red, with the blue pins indicating possible transport starting locations

When you have several possible transport end locations, this actually adds up to quite a lot of possible transport combinations for each spirit tree:

Spirit tree Possible transport start locations Possible combinations of transports (*)
Tree Gnome Village 15 15 * 5 = 75
Tree Gnome Stronghold 14 14 * 5 = 70
Battlefield of Khazard 8 8 * 5 = 40
Grand Exchange 8 8 * 5 = 40
Feldip hills 8 8 * 5 = 40
Prifddinas 7 7 * 5 = 35

(*) This is only for the 5 permanent spirit trees, and will be bigger if the PoH and self-grown spirit trees are included

A conservative total number of transport combinations for spirit trees is therefore 300. The plugin already has around 6000 transports.

Why am I even bringing this up?

It turns out that for every single transport I add to the plugin, the plugin gets a little bit slower... I guess you could call it a bug, but it is sadly not easy to fix. It has to do with having standard pathfinding where each movement is connected tile-by-tile and combining this with the option to jump big distances (e.g. spirit tree) in the transportation network. Long story short is that I have to rewrite the entire plugin, and even then I am not sure if it is even possible to design a system that can support this properly (e.g. I don't have a server like Google Maps and cannot precompute likely good/frequently used paths).

In addition I have not really had the time to work on this. Maybe during the summer?

Oliver-Saer commented 1 year ago

Thanks for the really detailed explanation, it's a privilege to get some insight into your process.

Just two off-the-cuff suggestions for you (from a position of ignorance, so take them with a pinch of salt):

Skretzo commented 1 year ago

as an opt-in beta feature

They will be opt-in, and I will reorganize the already available transports into more opt-in options. Opting out will retain previous performance.

Would it be possible to set the navigation endpoint to a tile occupied by the Spirit Tree

The endpoint is not the problem as it is usually only a single tile, it is the starting point that is the problem. Yes, it is possible to set the centre of the spirit tree as the starting point and from the object on that tile determine where the edge of the spirit tree is. However, this does not really help us because we are searching for starting points differently. When we are pathfinding we pick a single tile at a time and ask "Are any of the nearby 8 tiles walkable or a transport starting point?" What we need is a better way to figure out if a specific tile has a transport other than going through every roughly 6000 transports and checking if there is a match.

Skretzo commented 1 year ago

Thanks to major performance improvements by @jocopa3, this plugin is now much faster and uses less memory. This is very good news for adding more transports, such as spirit trees and gnome gliders!

Gnome gliders have now been added to the plugin in version 1.10 as a separate option Use gnome gliders, and is already live in the client.

Spirit trees will hopefully be added to the plugin in the next version.

Skretzo commented 1 year ago

Spirit trees were added to the plugin in version 1.11 and is now live in the client.