Replies: 2 comments 5 replies
-
|
Thanks for opening this discussion.
You were also by informed @g-mason0 that I was working on this and didn't reach out to me. I tried to coordinate with you to avoid duplicate efforts, but it seems we ended up with parallel implementations anyway. I explained my caching-based approach to you during our discussions. Which lets you implement the caching based approach instead of the plugin based approach |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In short, it would be beneficial to the web walker to support Player-owned-house teleports. PoH teleporation is a game-changer and supporting in the web would open a world of possibilities.
As soon as I found Microbot, I started development on this. I asked around and got help from some people pointing me in the right direction. When I had a working MVP, I created a PR and was curious to hear people's thoughts.
The PR
This quickly let to some discussion on how a feature like this should be implemented without any clear answers. As such, I feel like it is useful to open this discussion in a different format to see if we can all pitch in designing the best approach for this.
My vision of the goals for this feature:
Some requirements for PoH in the pathfinder:
My approach to data is as follows:
The pathfinder's data is stored in TSVs and parsed when the shortestpath plugin is started. This felt like an old-school approach to me and since all the data is already available through Runelite, the only thing I had to do was map functionality to destinations. You can see the result of that here for Mounted Glory. This follows an enum structure where the class determines the type of teleportation and the values represent the possible destinations. I got some backlash on this from @g-mason0 since he claimed that consistency was key for the pathfinder. To meet him half-way I have implemented a converted that transforms the enum to TSV on runtime and which is parsed like any other Transport in the pathfinder.
My approach to caching:
I built an Rs2PohCache that is able to keep track and register new teleportation systems available in a player's PoH. What it essentially does is map the available destinations to the transportation system that enables this teleportation. The Rs2PoHCache also supplies a method that allows the pathfinder to link the Transport to a teleportation functionality.
My approach to handling PoH tranportation:
I have created a new TransportType value 'POH' and implemented that throughout the pathfinder and walking code. It is implemented like any other transport system with the necessary
if transport.getType() == TransportType.POHyadayda. Since the pathfinder can't path within the PoH, I have designed the POH transport to be a simple interaction with gameobjects/widgets inside POH. When handling said interactions failes and you end up inside POH it will find a new path with the same PoH transport step included and continue where it left of. The only way it can potentially break is if the caching is wrong and the found PoH transport is in reality not available. For the actual handling of the transport I went a little bit of different route. Since the pathfinder, shortestpath and rs2walker code is quite large, I felt like it was best to implement the actual gameobject interaction outside of this class. The pathfinder finds the available POH transport by checking whats in Rs2PohCache -> Rs2Walker recognizes the Transport step as a TranportType.POH and teleports to PoH and lets the teleportation functionality obtained from Rs2PohCache do the rest. The actual teleportation (finding and interacting with GameObject and Interface) itself is done by its associated PoH API implementation. See PohPortal for example.This allows us to also have the Teleportation within PoH made available in the PoH and lets any plugin use it as it wishes. In addition to that, it allows us to serve a single TSV file with all the teleports that are possible in PoH.
My approach to the PoH instance/mapping problem:
I went for the simplest route possible: don't even try to walk inside the PoH. The only thing that is done in PoH is interacting with the teleportation object. This means that there is the least amount of effort required on the pathfinder/walker with the added limitation of PoH with closed doors not being supported.
This discussion is not a way for me to claim that I know what is best but a way to lay out all the required steps that I've gone through and the insights I've gained as well as the difficulties and limitations with implementing them into the pathfinder as it currently stands. I invite you all to think critically and raise any concerns you see. If you feel like there are missing features, lets try to see how we can get them added. If you have a different approach that you feel is more reasonable, please do share.
Beta Was this translation helpful? Give feedback.
All reactions