1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Constant Teleporting on the default web

Discussion in 'Client & Site Support' started by Exia, Aug 5, 2015.

  1. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    No matter what I do, whenever I use the default web, it always just continuously teleports via the closest loadstone. And since teleports can't be disabled in the default web, the entire thing has been rendered completely useless.

    @Cloud @Arbiter

     
  2. Best Answer:
    Post #18 by Cloud, Aug 24, 2015
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Show me your code.
     
  4. muttaclien

    Joined:
    Jul 18, 2015
    Messages:
    6
    Likes Received:
    0
    Data:

    teleport edge: (3323, 3222)
    destination: (3238, 3209)
    origin: (3241, 3210) -----> teleports
    origin: (3237, 3210) -----> teleports
    origin: (3238, 3210) -----> walks

    Black box conclusions(liable to be bullshit!):

    Proposed solution: Given the cheapest teleport, find minimum cost of [walking to destination, teleporting then walking to destination]. Right now it appears more like your checking if |teleport_x - dest_x|+|teleport_y - dest_y|>25 then teleporting.

    Edit: Removed edit,
     
    #3 muttaclien, Aug 6, 2015
    Last edited: Aug 6, 2015
  5. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    Building the path:
    Code (Text):
    1. public Path buildTo(Locatable dest){
    2.         Path path = RegionPath.buildTo(dest);
    3.    
    4.         if(path == null || path.getNext() == null)
    5.             path = web.getPathBuilder().buildTo(dest);
    6.         if(path == null || path.getNext() == null)
    7.             path = BresenhamPath.buildTo(dest);
    8.        
    9.         return path;
    10.     }
    I call this function repeatedly so it takes steps:
    Code (Text):
    1. public void walkToBank() {
    2.         if(bankPath == null) bankPath = pathBuilder.buildTo(bank.getArea());
    3.         else if(!bank.contains(Traversal.getDestination())){
    4.             /*Path tempPath = bankPath;
    5.             if(Random.nextInt(100) <= PlayerSense.getAsInteger(CustomPlayerSense.Key.VIEW_PORT_WALKING.playerSenseKey)){
    6.                 tempPath = ViewportPath.convert(tempPath);
    7.             }*/
    8.  
    9.             System.out.println(bankPath.getNext() + ": " + bankPath.step());
    10.            
    11.             if(bankPath instanceof BresenhamPath){
    12.                 bankPath = pathBuilder.buildTo(bank.getArea());
    13.             }
    14.             Execution.delay(400,600);
    15.         }else{
    16.             Execution.delay(400,600);
    17.         }
    18.     }
     
  6. muttaclien

    Joined:
    Jul 18, 2015
    Messages:
    6
    Likes Received:
    0
    The primary issue here is that path's are being generated with teleports that actually result in a *larger* traversal cost than those without teleports. This is demonstrated in my first post where instead of stepping 3 tiles west & 1 south, a teleport is instead performed. This will almost certainly result in closed traversal loops for certain sets of {origin, destination}.


    TheBat: Although your code should work in most cases*[and is very efficient!], I can see a potential pitfall... Consider: If your at location A, build path to B, then move to a new location C that is far away, the original path will not retain information relevant to location C.

    *Given path's are generated correctly.
     
  7. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    If I've generated a path from location A -> B, why would it ever go to C unless C is on the path between A->B? And if C is on the path, then it is moving from C -> B anyway.

    Additional note: If C is a teleported to location, then the path should have built from the teleported location to B.

    The problem is that loadstones just do not cost enough in the web. if walking from A -> B is 40. and walking from C -> B is only 20, then the cost of A -> B could also be: cost of the tele + C -> B, but the tele needs to cost like 40 since it takes 30 seconds to cast.
     
    #6 Exia, Aug 7, 2015
    Last edited: Aug 7, 2015
  8. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    I'll investigate why it's happening further, but @TheBat lodestones currently have a cost of 25.
     
  9. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    Try from the West Varrock mine to the West Varrock bank. I know @mjmfighter was having the same problem in that location with his own script bot.
     
  10. mjmfighter

    Joined:
    Apr 22, 2015
    Messages:
    21
    Likes Received:
    5
    Yup. I was going from the Varrock West Mine to the Varrock West Bank. The path works sometimes but when it doesnt it gets sucks in an endless lodestone teleport to Varrock, which makes no sense as its no where near the shortest path or even along the way

    @Cloud
     
  11. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    @Cloud
    It keeps happening when I generate a path from:
    bank = new Area.Rectangular(new Coordinate(3267,3169), new Coordinate(3273,3165));
    mine = new Area.Rectangular(new Coordinate(3290,3319), new Coordinate(3305,3285));
    --- Double Post Merged, Aug 16, 2015, Original Post Date: Aug 10, 2015 ---
    @Cloud
    So, a bit more info, if you stand right next to the Falador lodestone and try to walk to the dwarven mine north-east of there, it has two problems:
    1. It uses the teleport right off the bat, instead of just walking there.
    2. After it teleports, it clicks the next step just north east of the lodestone before the animation has completed. That step disappears, so it teleports to the lodestone again for whatever reason.

    I know that calling step on a path will return false and not take the step if the current traversal destination is far enough away or it's not on the mini map, which means #2 can be easily fixed by simply adjusting the time that it waits for the animation to finish be a bit longer.
     
  12. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    I've gone ahead and revised the Lodestone#teleport method to wait until completion of the teleport (aka, until you're off the lodestone and no longer moving) before it returns.
     
  13. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    It no longer spam click when it's waiting, which is something. I did some debugging, and I think I found something interesting. I don't know exactly what the problem is, but it is VERY easy to replicate.

    To replicate:
    1. Home teleport to lumbridge
    2. Build a path to new Coordinate(3018, 3450)
    3. Let it teleport and a loop will start.
    4. Stop it after a loop or two.
    5. Build a path from the current location to new Coordinate(3018, 3450)
    6. It will loop again.

    (Actually, I just realized the following is because my path generator switches to a region path once I get it to load the region)
    7. Manually walk to destination.
    8. Build a path to new Coordinate(3018, 3450)
    9. Manually walk back to lodestone.
    10. Paths will build normally now.

    Here's some data I collected, I don't know if it will help, but let me know if you can't replicate it, or you need anything else from me.
    http://pastebin.com/raw.php?i=pw2nK8iw

    The code I ran looks like this:
    Code (Text):
    1. if(path == null){
    2.     path = web.getPathBuilder().buildTo(new Coordinate(3018, 3450));
    3.     System.out.println("New Path created: " + Players.getLocal().getPosition() + " -> " + new Coordinate(3018, 3450));
    4. }else{
    5.     System.out.println("Current Location: " + Players.getLocal().getPosition() + " Vertex: " + path.getNext());
    6.     path.step();
    7. }
    8. Execution.delay(Random.nextInt(600,800));
    And that is simply continuously looped until the player is at the proper destination.
     
    #12 Exia, Aug 17, 2015
    Last edited: Aug 18, 2015
  14. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    So what parts of that are actually valid if part of it was because of your code?
     
  15. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    It's not just my code. I was using Alpha Divination(@SlashnHax), and started it away from the location it was meant to be run at, and it went to walk there and got stuck in a loop on the Varrock lodestone.

    Here is the full testing script bot that I used: http://pastebin.com/JguMDNwC
    Code (Text):
    1. import com.runemate.game.api.hybrid.location.Coordinate;
    2. import com.runemate.game.api.hybrid.location.navigation.Path;
    3. import com.runemate.game.api.hybrid.location.navigation.Traversal;
    4. import com.runemate.game.api.hybrid.location.navigation.web.Web;
    5. import com.runemate.game.api.hybrid.region.Players;
    6. import com.runemate.game.api.hybrid.util.calculations.Random;
    7. import com.runemate.game.api.script.Execution;
    8. import com.runemate.game.api.script.framework.LoopingScript;
    9.  
    10. public class WebTest extends LoopingScript{
    11.     Path path = null;
    12.     Web web = Traversal.getDefaultWeb();
    13.  
    14.     @Override
    15.     public void onLoop() {
    16.         if(Players.getLocal().getPosition().distanceTo(new Coordinate(3018, 3450)) > 5)walk();
    17.         else stop();
    18.     }
    19.  
    20.     public void walk(){
    21.         if(path == null){
    22.            path = web.getPathBuilder().buildTo(new Coordinate(3018, 3450));
    23.            System.out.println("New Path created: " + Players.getLocal().getPosition() + " -> " + new Coordinate(3018, 3450));
    24.         }else{
    25.            System.out.println("Current Location: " + Players.getLocal().getPosition() + " Vertex: " + path.getNext());
    26.            path.step();
    27.         }
    28.         Execution.delay(Random.nextInt(600,800));
    29.     }
    30. }
    It's a very simplified version of what my actual script bot is doing, but it still demonstrates the issue. I don't see anything wrong with that code, but maybe I'm doing something really stupid.

    I started it running when I started writing this message and it looped the entire time:
    Code (Text):
    1. (01:21:20) New Path created: Coordinate(2735, 3416, 0) -> Coordinate(3018, 3450, 0)
    2. (01:21:21) Current Location: Coordinate(2735, 3416, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    3. (01:21:37) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    4. (01:21:38) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    5. (01:21:40) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    6. (01:21:55) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    7. (01:21:56) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    8. (01:21:58) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    9. (01:22:12) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    10. (01:22:14) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    11. (01:22:16) Current Location: Coordinate(2966, 3404, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    12. (01:22:17) Current Location: Coordinate(2967, 3406, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    13. (01:22:18) Current Location: Coordinate(2970, 3409, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    14. (01:22:19) Current Location: Coordinate(2973, 3410, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    15. (01:22:20) Current Location: Coordinate(2975, 3413, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    16. (01:22:21) Current Location: Coordinate(2977, 3414, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    17. (01:22:22) Current Location: Coordinate(2981, 3417, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    18. (01:22:36) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    19. (01:22:38) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    20. (01:22:39) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    21. (01:22:53) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    22. (01:22:55) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    23. (01:22:57) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    24. (01:23:11) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    25. (01:23:13) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    26. (01:23:14) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    27. (01:23:15) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    28. (01:23:30) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    29. (01:23:31) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    30. (01:23:33) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    31. (01:23:47) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    32. (01:23:49) Current Location: Coordinate(2967, 3404, 0) Vertex: CoordinateVertex(2983, 3420, 0)
    33. (01:23:50) Current Location: Coordinate(2967, 3403, 0) Vertex: LodestoneVertex(2967, 3404, 0)
    --- Double Post Merged, Aug 18, 2015, Original Post Date: Aug 18, 2015 ---
    Also, you can see people on this page of this thread: https://www.runemate.com/community/threads/celestial-wine-grabber.988/page-5 complaining about the exact same issue.
    --- Double Post Merged, Aug 18, 2015 ---
    Here is a copy of my script bot that generated a new path on every step. At first I thought it was working, and it did once, however after multiple tests, it also shows the bug:
    http://pastebin.com/Uz13MX6e
    --- Double Post Merged, Aug 18, 2015 ---
    @Cloud
    I didn't know if RM caches classes between runs or not, so I though that my path just might not be null when the script bot was started. With this in mind, I added an onStart to the script bot to be absolutely sure the path is null at start up. This is my new testing script bot:
    Code (Text):
    1. public class WebTest extends LoopingScript{
    2.     Path path = null;
    3.     Web web = Traversal.getDefaultWeb();
    4.    
    5.     @Override
    6.     public void onStart(String... args){
    7.         path = null;
    8.     }
    9.    
    10.     @Override
    11.     public void onLoop() {
    12.         if(Players.getLocal().getPosition().distanceTo(new Coordinate(3018, 3450)) > 5)walk();
    13.         else stop();
    14.     }
    15.    
    16.     public void walk(){      
    17.         path = web.getPathBuilder().buildTo(new Coordinate(3018, 3450));
    18.        System.out.println("New Path created: " + Players.getLocal().getPosition() + " -> " + new Coordinate(3018, 3450));
    19.        path.step();
    20.  
    21.         Execution.delay(Random.nextInt(600,800));
    22.     }
    23. }
    Despite what I said in the chat, this version still loops continuously 80% of the time. Interestingly enough, I can start it directly on the lodestone and it still exhibits this behavior. It is however more likely in this version that it preforms the the first step after the teleport (about 10 tiles away), get's there, then teleports back.

    I think you're going to need to implement a step taken flag, even if it's just on lodestone vertices.
     
  16. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,937
    Likes Received:
    1,266
    Verified as a client issue and a top priority for @Cloud and I to fix.
     
    Exia likes this.
  17. Baddest Man on Earth

    Joined:
    Nov 26, 2014
    Messages:
    616
    Likes Received:
    246
    This happened to me a few times on the default web, but never on my own web.

    Edit: Happened mostly when using the Varrock lodestone.
     
  18. Runebot2

    Joined:
    Jul 27, 2015
    Messages:
    75
    Likes Received:
    8
    Continuous lodestone teleporting still happens on Exia Miner.
     
  19. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    V1.1.15 was aimed at fixing this, can you confirm that it was resolved properly?
     
    Exia likes this.
  20. mjmfighter

    Joined:
    Apr 22, 2015
    Messages:
    21
    Likes Received:
    5
    Confirmed working now. Lodestones no longer have a teleport loop, however they are still generated in the path when not really necessary. For example if I am at the varrock east mine and am walking to the varrock east bank, it uses the varrock lodestone to get there even though there is a shorter route in the web
     
  21. Exia

    Joined:
    Nov 3, 2013
    Messages:
    609
    Likes Received:
    259
    I can confirm that it is no longer looping.

    Thanks a bunch!
     

Share This Page

Loading...