Results 1 to 4 of 4

Thread: FFlag used in SPS_WalkPath

  1. #1
    Join Date
    Jul 2012
    Posts
    279
    Mentioned
    5 Post(s)
    Quoted
    46 Post(s)

    Default FFlag used in SPS_WalkPath

    Long story short, I'm at the middle of customising SPS_WalkPath and SPS_WalkToPos for a script so it isn't completely useless when moving and to customize when it returns true or move to a new point. The changes by themselves are quite simple, but I stumbled upon a line which I don't fully understand. Well, I don't understand its use at all.

    From my understanding, FFlag is a boolean function that returns true when you're within a decided distance of a flag. The way it is used in SPS_WalkPath surprises me:

    Simba Code:
    FFlag(5 + (Integer(I <> H) * 15));

    I should precise at this point that "I" represents the current point in the path and "H" represents high(Path). Is there any practical reason why the distance before FFlag returns true is based on these integers, is there is something that I'm missing/misunderstanding or is the usage of these integers is merely to add a custom randomization to paths?

    Thank you for your time.

  2. #2
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    I don't understand it either, but I know FFlag will exit and return true when the flag is no longer on the MM, because the flag disapears 3-4 tiles before you reach your point, SPS will continue to the next point early, theres also the time it takes to calculate position and then move the mouse there for a click, so if you want pinpoint accuracy, then you need to be completely still before moving to the next point (I find 1500ms wait after FFlag is about as good as it gets), theres also the 5x5 randomness of the point click in SPS and multimouse within it, if you look at my airorb charger, I edited all these to get it more accurate, but you still have to stand still for that split second to ensure accuracy

    Theres also the fact Sps will exit if you are within 2ish tiles of your point, because it's not 110% accurate and position can vary by a few tiles,

    Sps walking to a point, then waiting 1.5+randomness seconds, then using a DTM, is probably the only easy way to walk to an exact point, tho my air charger walkpathing got to be accurate within 1 tile around my chosen tile, which can be worked with most of the time,

    Theres also the fact you can have your point 1 space into a wall ( say for in a bank like castlewars or etc, then Sps will click into the wall, making your flag/position exact to the bank tile, meaning you can more or less get 100% accurate results when a wall/sizeable object is at a direction of your position,

    Accuracy of your custom map is also really inportant because the more accurate your position calculation, the better the walking results,

    /soz for wall of text
    Last edited by DannyRS; 02-07-2013 at 09:18 AM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  3. #3
    Join Date
    Jul 2012
    Posts
    279
    Mentioned
    5 Post(s)
    Quoted
    46 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    I don't understand it either, but I know FFlag will exit and return true when the flag is no longer on the MM, because the flag disapears 3-4 tiles before you reach your point, SPS will continue to the next point early, theres also the time it takes to calculate position and then move the mouse there for a click, so if you want pinpoint accuracy, then you need to be completely still before moving to the next point (I find 1500ms wait after FFlag is about as good as it gets), theres also the 5x5 randomness of the point click in SPS and multimouse within it, if you look at my airorb charger, I edited all these to get it more accurate, but you still have to stand still for that split second to ensure accuracy

    Theres also the fact Sps will exit if you are within 2ish tiles of your point, because it's not 110% accurate and position can vary by a few tiles,

    Sps walking to a point, then waiting 1.5+randomness seconds, then using a DTM, is probably the only easy way to walk to an exact point, tho my air charger walkpathing got to be accurate within 1 tile around my chosen tile, which can be worked with most of the time,

    Theres also the fact you can have your point 1 space into a wall ( say for in a bank like castlewars or etc, then Sps will click into the wall, making your flag/position exact to the bank tile, meaning you can more or less get 100% accurate results when a wall/sizeable object is at a direction of your position,

    Accuracy of your custom map is also really inportant because the more accurate your position calculation, the better the walking results,

    /soz for wall of text
    I've been playing a lot with SPS last few days and know pretty much all you said. For accuracy though, I like to make TPA that only gives the correct result so if it isn't found on MS, I make it walk to a position (and since it's standing still at that point, it's flawless). Therefore, what I'm looking for is speed rather than accuracy as my failsafes can correct any issue. I believe that you confuse Flag with FFlag though with this explanation.

    The point of this thread was merely to ask if there is a reasoning behind the variables chosen for FFlag and you went on a tangent (certainly interesting for many though). My question remains the same.

    Hint: For shorter walking time, use smaller maps whenever possible as the processing time goes up exponentially the bigger the map is. Since a recent fix, it's possible to use multiple maps within the same script and I certainly encourage to do so whenever possible. Chopping down excess of black also speeds things up.

  4. #4
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Isn't that just autoboxing the integer calculation? ex. that replaces having do declare an integer variable and assign the calculation to it?
    iirc then it looks for that amount of calculated degrees around the MM (probably some overkill for longer paths?)

    idk, probs just piecing together a load of bologna

    soz for the rant
    -Lj

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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