Results 1 to 11 of 11

Thread: Using reflection coordinate system without the include on osbuddy

  1. #1
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default Using reflection coordinate system without the include on osbuddy

    Alright so one thing I've noticed when scripting is that I reply heavily on the reflection coordinate system. It's one of the main reasons I choose to use the include instead of just using a more native client such as osbuddy.

    But, I have a proposition, and it may be a long shot, but if we can get it to work, it could be a big step up.

    The whole map has a coordinate plain correct? This is how tiles are found and they stay pretty static in the overworld.
    Our minimaps are an exact representation of pieces of the entire map.

    That means...If we can take a picture of the map, and separate it into the tiles that exist in game, then use some type of search function to determine what section of the map we are currently in depending on the current bitmap of our mnimap, we can then plot those relative coordinates on the minimap to use to locate a point and move there.
    I'm all for DDtms, and SPS, but if this can happen, it would make scripting without the use of Reflection much more efficient.

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    take a picture of the map, and separate it into the tiles that exist in game, then use some type of search function to determine what section of the map we are currently in depending on the current bitmap of our mnimap
    Unless I'm horribly mistaken, this is the essence of what SPS already does, for RS3. slacky's RSWalker does much the same for OSRS.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    this already exists, aerolib has a walking system that narrows it down to the pixel(s) you are on. And yes, it will work on osbuddy

  4. #4
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    Unless I'm horribly mistaken, this is the essence of what SPS already does, for RS3. slacky's RSWalker does much the same for OSRS.
    It seems like he's hoping for something that has a sufficiently efficient manner of screenshotting your minimap and then referencing a world map, to get your local position. //Which is pretty much what us humans do.
    Probably something for the end user like
    Simba Code:
    superSPS.setupGlobalMap('global', RUNESCAPE_SURFACE); //sets up the global map
    writeln(superSPS.getLocalPosition); //Function outputting an estimate of your X & Y coordinates on the global map, based on a screenshot of your minimap, and in this example obviously just being written to the debug.
    and would thus let you know where you are in the world, if you're able to feed it a reliable global map. Sounds possible [though I'm clueless af], and could be well worth it even if it needed to take a good number of seconds of maxing out simbas cpu usage to figure out... should it be used sparingly and combined with other things (e.g regular SPS for walking in that specific area, after you've figured out where exactly in the world you are). I believe @Brandon; had a tool for getting a great world map efficiently on rs3 via opengl interception.

    I have a question @everyone
    Let's say you have a couple similar areas (same symbols on the minimap) that you might be in, and you wish to figure out which area it is, what are some of the ways to go about that? Can the current SPS be [easily] used for this, if so how?
    Last edited by acow; 08-20-2016 at 03:37 PM.

  5. #5
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    I think there was some stuff like inPolygon added to SPS some time ago (if not just get your position manually and check it with some other polygon function), that would help you ease scripting. SPS should be accurate enough, so you just make a polygon of an area, or heck even a box will work and you just compare your local position with said polygon/box.
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

  6. #6
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by acow View Post
    It seems like he's hoping for something that has a sufficiently efficient manner of screenshotting your minimap and then referencing a world map, to get your local position. //Which is pretty much what us humans do.
    ...
    and would thus let you know where you are in the world, if you're able to feed it a reliable global map. Sounds possible [though I'm clueless af], and could be well worth it even if it needed to take a good number of seconds of maxing out simbas cpu usage to figure out...
    This is the rough oversimplified core of what RSWalker and SPS does, as the others said...
    Last edited by slacky; 08-21-2016 at 02:59 AM.
    !No priv. messages please

  7. #7
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    This is the rough oversimplified core of what RSWalker and SPS does, as the others said...
    o I didn't even have to say slacky 3x, nice.

    Do you have any [specific]* input to give regarding the "I have a question @everyone"?
    Last edited by acow; 08-21-2016 at 04:00 AM.

  8. #8
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by acow View Post
    Do you have any [specific]* input to give regarding the "I have a question @everyone"?
    SPS is the simple way, just mark the centers of the areas with any SPS tool, store it in your code, check which of the two areas you are closest to by computing the distance from SPS.GetPlayerPos() to all the centers you have, pick the closet one.

    so basically something like this could work:
    Code:
    function GetMySpot(spots:TPointArray; maxDist:Int32; out spotId:Int32): Boolean; //returns the ID of which spot you are in
    var
      i:Int32;
      p:TPoint;
    begin
      p := SPS.GetPlayerPos();
      spotId := 0;
      for i:=1 to High(spots) do
        if Sqr(p.x-spots[i].x) + Sqr(p.y-spots[i].y) < Sqr(p.x-spots[spotId].x) + Sqr(p.y-spots[spotId].y) then
          spotId := i;
    
      Result := Sqr(p.x-spots[spotId].x) + Sqr(p.y-spots[spotId].y) < Sqr(maxDist);
    end;
    
    
    var
      spots:TPointArray = [[400,400], [900,200]]; //The centers of each spot, gather them with any SPS tool
      current:Int32;
    begin
      if GetMySpot(spots, 250, current) then
      begin
        WriteLn('I am in range of ', spots[current] );
      end else
        WriteLn('I am too far away from any of the spots');
    end.
    Alternatively you can use SPS.IsInPolygon(polygon: TPointArray); where you'd have to create a polygon of each spot, still using any SPS path making tool, and then just loop over each polygon and test until one returns True.


    But honestly.. I don't like answering questions like this, anyone can answer this so I prefer not to be bothered with it.
    Tho I have to question why you don't know what spot you are in beforehand, since it's your script, and you should be in control of that already.
    Last edited by slacky; 08-21-2016 at 06:53 AM.
    !No priv. messages please

  9. #9
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    SPS is the simple way, just mark the centers of the areas with any SPS tool, store it in your code, check which of the two areas you are closest to by computing the distance from SPS.GetPlayerPos() to all the centers you have, pick the closet one.

    so basically something like this could work:
    Code:
    function GetMySpot(spots:TPointArray; maxDist:Int32; out spotId:Int32): Boolean; //returns the ID of which spot you are in
    var
      i:Int32;
      p:TPoint;
    begin
      p := SPS.GetPlayerPos();
      spotId := 0;
      for i:=1 to High(spots) do
        if Sqr(p.x-spots[i].x) + Sqr(p.y-spots[i].y) < Sqr(p.x-spots[spotId].x) + Sqr(p.y-spots[spotId].y) then
          spotId := i;
    
      Result := Sqr(p.x-spots[spotId].x) + Sqr(p.y-spots[spotId].y) < Sqr(maxDist);
    end;
    
    
    var
      spots:TPointArray = [[400,400], [900,200]]; //The centers of each spot, gather them with any SPS tool
      current:Int32;
    begin
      if GetMySpot(spots, 250, current) then
      begin
        WriteLn('I am in range of ', spots[current] );
      end else
        WriteLn('I am too far away from any of the spots');
    end.
    Alternatively you can use SPS.IsInPolygon(polygon: TPointArray); where you'd have to create a polygon of each spot, still using any SPS path making tool, and then just loop over each polygon and test until one returns True.
    I think I somewhat get some of what you're saying.. huehue, will mess around with trying to create my own crappy functions for generating an ID, thanks for the input

    Quote Originally Posted by slacky View Post
    But honestly.. I don't like answering questions like this, anyone can answer this so I prefer not to be bothered with it.
    Tho I have to question why you don't know what spot you are in beforehand, since it's your script, and you should be in control of that already.
    pffffffffffft yeah sure, "anyone".

    This could be useful (especially if not requiring a lot of effort on the newbie scripters part to generate an ID) for scripts that train multiple skills / the same skill in different areas. A specific use case might be something like a 1-99 hunter script, if multiple hunter areas were similar and the script just started and it's level say 70 and you have a method for training from 60-70 and 70-80. Which place is it at? One way would be to just force it to use whatever path it uses to go to 70 the area, but being able to efficiently figure out where you're at would be better / more humanlike.
    + I asked because I simply wanted to get better at using SPS and so any input is welcome. //more input plz @everyone =)

  10. #10
    Join Date
    Aug 2016
    Location
    Kentucky
    Posts
    254
    Mentioned
    3 Post(s)
    Quoted
    96 Post(s)

    Default

    To clairify, my reason for this method was so that we could move to an EXACT tile as well as check if an o jet exists on that exact tile without the use of reflection. This would allow us to use functions such as mm to ms mouse position and other very useful functions without the need to use the smart client, which may or may not increase your ban rate. The ability to map out every exact position with would open up so many options other than just player position itself. Of course, the only way it could be done is to write a very accurate function that compares your minimal with a full map with the same coordinate plane, thus allowing you to pull that data and use functions such as get global tile and others.

  11. #11
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Aspect View Post
    To clairify, my reason for this method was so that we could move to an EXACT tile as well as check if an o jet exists on that exact tile without the use of reflection. This would allow us to use functions such as mm to ms mouse position and other very useful functions without the need to use the smart client, which may or may not increase your ban rate. The ability to map out every exact position with would open up so many options other than just player position itself. Of course, the only way it could be done is to write a very accurate function that compares your minimal with a full map with the same coordinate plane, thus allowing you to pull that data and use functions such as get global tile and others.
    1. The minimap rotates, +/- 25 degrees (roughly) off from what the compass says.
    2. The minimap scales from roughly 80% up to 120% (or.. +/- 20%) roughly.
    3. The minimap cycles the colors used randomly.
    4. The minimap is often filled with dots, and symbols.
    5. The minimap is very tiny.
    6. There is no way to know the above information before running cross correlation between the minimap and the full map.
    7. A cross correlation alone, with a naive implementation would do several hundred billion comparisons. That's _A LOT_, and is bound to take a long time.
    8. A cross correlation is no good without knowing the current minimap offset, and scale (at least roughly).
    This is basically the reason RSWalker, nor SPS is THAT accurate, and that both can fail in very icky cases.

    So if you feel like tackeling all those problems, be my guest, I am sure it would be quite a challenge, but for such accuracy regular pixelwise cross correlation is probably not the way to go.
    Building an image pyramide from 1/16th scale (i guess) to solve it all at once with regular cross correlation and some bruteforce could work, but it's a lot of work, and will likely be too slow for general purpose usage, and it would likely still be iffy in some harder cases.

    Also, you would not be able to do anything like "mm to ms" because:
    - As I said, the minimap rotates +/-25 degrees, and scales +/- 20%
    - the mainscreen changes both PoV and viewangle.
    So all in all minimap to mainscreen would be WAY off without knowing all that stuff beforehand, and figuring that out will show to be no easy task.



    It would probably be simpler to locate the player coordinates directly from memory and just borrow/use the multipliers from kyles reflection lib / or find those yourself. Tho that's also a bit of work, and can show to be a problem when attempting to point point the memory address (automatically).
    Last edited by slacky; 08-21-2016 at 05:25 PM.
    !No priv. messages please

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
  •