Signup Now
Results 1 to 6 of 6
  1. #1
    Free User shAdOwArt's Avatar
    Join Date
    Apr 2015
    Location
    Kharos
    Posts
    189
    Reputation
    151
    Rep Power
    19

    Waypoint skipping is bad

    When no path can be found to the next waypoint, Windbot will skip this waypoint. This happens regardless of waypoint type (the docs disagree, so this might be a bug). I think this is a bad idea and that you cannot make reliable scripts in this way. There are some circumstances when you'd wish to skip the waypoint, but these are rare exceptions, and not the rule. Instead I think that the best way to deal with a blocked path is to just stand still and set a flag that let's any running lua persistents know that the path is blocked.

    Every script have some actions that simply cannot be skipped, such as buying supplies before leaving the town. This means that you must have at least some position checkers that force you to redo certain waypoints if you didn't reach them. However, this means that script never will be able to loop all the way through all waypoints and get back a reachable waypoint once it starts skipping. Instead you need to split the script into sections such that if you fail to reach the end of a given section it will go back to its beginning. Note that these sections don't have to correspond to actual waypoint tabs, but that is one way to do it.

    However, this also means that when your path is genuinely blocked you'll end up going back to the first waypoint in the section, walking the same path again until you get to the blocked waypoint again at which point you'll loop back to the beginning again... In short, we end up in a loop, but since we're not standing still $standtime doesn't go up so any running lua persistents won't know that we're stuck. This is a major problem when the path is blocked by furniture as a persistent furniture destroyer is the only way to get unstuck.

    There are two workarounds for this:
    • Add a position checker after every waypoint so that you're in fact forced to stand still when your path gets blocked. These can automatically be inserted by a good context menu or waypoint button script, but makes things unnecessarily complicated, in particular if we later want to move waypoints around. Essentially this is just forcing the walker to not skip waypoints, which is how it ought to be behave in the first place.
    • Try to detect that you're stuck in some other way. Beyond being complicated and not always reliable, this also has the problem that the walker will try to take us away from the position where our blocking furniture is, which makes our job of destroying it a lot harder. You might argue walking away backwards is the correct behavior when your path is blocked by a player instead of furniture, but this only applies if you're deadlocked and furthermore it's an action that's easy to carry out in lua so it remains available even if you don't skip waypoints.


    All in all waypoint skipping is not unmanageable, but makes it a hell of a lot more difficult to make reliable scripts. It also introduces a lot of situations where you not only risk getting stuck, but risk getting banned, if you don't have checkers before certain lua actions. The latter problem is made even worse by the standard library containing possibly infinite loops in functions like depositerbank. This makes waypoint skipping unsuitable both for experienced scripters wanting to make something that works 100% of the time, and for beginners wanting to make something that works most of the time but without any risk of getting stuck in an infinite lua loop that likely will get them banned.

    My suggestion is that nodes should be skipped if you're within the set node range, stands should never be skipped (not even if you're standing next to the waypoint -- you'd have to actually be inside it) and walks should always be skipped. However, this might break some scripts that have abused the fact that waypoints are skippable in order to do cute things so an alternative would be to simply introduce two new waypoint types: unskippable variants of node and stand.

    Finally, there are some circumstance when skipping a waypoint of any type is fine. This is when the waypoint is either located on a different floor or inside a wall as these are situations that neither will resolve themselves given time, nor can be resolved by persistents.

  2. #2
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,578
    Reputation
    149
    Rep Power
    27
    AFAIK this is the way it works, and you should deal with it. It was annoying at beggining, yes, but i got used to it and now i dont see any problem with making few additional checks. You have alot of ways to solve blocked minimap path, and easiest is placing waypoints on screen range. I don't know how it worked on xeno, but neobot, ibot, and probably redbot were working like this.



    ps this is my personal opision as scripter.

  3. #3
    Free User shAdOwArt's Avatar
    Join Date
    Apr 2015
    Location
    Kharos
    Posts
    189
    Reputation
    151
    Rep Power
    19
    Quote Originally Posted by Imba View Post
    AFAIK this is the way it works, and you should deal with it. It was annoying at beggining, yes, but i got used to it and now i dont see any problem with making few additional checks. You have alot of ways to solve blocked minimap path, and easiest is placing waypoints on screen range. I don't know how it worked on xeno, but neobot, ibot, and probably redbot were working like this.



    ps this is my personal opision as scripter.
    Keeping waypoints within screen range is a semi-unreliable way to workaround this bug/feature but it is completely orthogonal to what I'm discussing here.

    I'm going to make a bold claim now and state that no one, including you, has ever made a script for Windbot that reliably deals with both blocking furniture, retro players and actions that can fail -- such as levitating. The only way to archive all those things is to have position checkers after every single node and I've never seen a script like that. If you disagree with this, then I challenge you to post any waypoint section that you think accomplishes this and I will tell you how it can fail.
    Last edited by shAdOwArt; 11-25-2016 at 02:11 PM.

  4. #4
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,578
    Reputation
    149
    Rep Power
    27
    I had once got paid to change garkstal glooth bandits east to make it secure. I can asure you that it was unstuckable and unkillable in any known to me way, except luring enought bandits to clean combo, but that wasnt problem cosindering lvl of botted char. I cannot send it to you tho. I would love to race for most secure script, as i think i am quite good with it, but i have no time and will to prove anything at all. Write example where you are getting trapped and how they are doing it, and i am sure we will find fix, without placing action after every waypoint.

  5. #5
    Moderator Josh's Avatar
    Join Date
    Dec 2013
    Posts
    1,395
    Reputation
    183
    Rep Power
    24
    Quote Originally Posted by shAdOwArt View Post
    Keeping waypoints within screen range is a semi-unreliable way to workaround this bug/feature but it is completely orthogonal to what I'm discussing here.

    I'm going to make a bold claim now and state that no one, including you, has ever made a script for Windbot that reliably deals with both blocking furniture, retro players and actions that can fail -- such as levitating. The only way to archive all those things is to have position checkers after every single node and I've never seen a script like that. If you disagree with this, then I challenge you to post any waypoint section that you think accomplishes this and I will tell you how it can fail.
    I get what you're saying, but that's not really a problem with the bot. Making these changes would break backwards compatibility and be an absolute nightmare. People are happy enough with the bot as it works right now (for the most part). People are also happy enough with the scripts on the market at the minute. Whether or not those scripts are actually entirely crap is an issue that I've been debating for years. I'm pretty sure the real issue is that the money just isn't good enough that people are willing to work hard enough to make good quality scripts. It might change one day, but I don't think so.
    Interested in software development and/or programming for Tibia?
    Check out the new Tibia Programming Forums (TibiaPF) by clicking the image below.

    Looking for a bot for the MMORPG, Medivia?
    Check out MediviaBotter, a powerful, injected bot by clicking the link below.


  6. #6
    Free User MenelZThais's Avatar
    Join Date
    Aug 2016
    Location
    Poland
    Posts
    253
    Reputation
    10
    Rep Power
    16
    When you're using Stand waypoints bot won't skip them

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •