Results 1 to 15 of 15

Thread: Best way to Find a Fairy ring EOC

  1. #1
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default Best way to Find a Fairy ring EOC

    Ive tried TPA ect, and Im not getting it accurate enough, also tried DTMS and rotating them ?: Ideas, I need to find this

    accurately and reliably

    @Ashaman88
    @Sin
    @Flight

    Any ideas?

  2. #2
    Join Date
    Jul 2012
    Posts
    437
    Mentioned
    10 Post(s)
    Quoted
    165 Post(s)

    Default

    ATPA's with a decent amount of math/filtering

    edit: try messing with these functions http://villavu.com/forum/showthread.php?t=49067
    Last edited by tealc; 04-03-2013 at 03:45 AM.

  3. #3
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by tealc View Post
    ATPA's with a decent amount of math/filtering
    I was thinking that I could maybe search for the top of the Fairy ring buds, filter it from the mainscreen and make that a ATPA and the search that ATPA for a certain amount of the color in the very middle of the ring..

  4. #4
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Dtms would be a no no here... I would try different tpas/atpas functions and such. Can you get the ring on ms reliably?

  5. #5
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    Dtms would be a no no here... I would try different tpas/atpas functions and such. Can you get the ring on ms reliably?
    I can get the ring on the MS almost everytime, if not, then a simple camera rotation will make sure it is always visible, Im going to try playing with ATPAS/TPAS more, Ill post results and possibly a function to find them!

  6. #6
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I've a question: where in this ring do you click to interact with it? Will any one of the rings work? Or can you also click in the middle, not on a ring at all, and still interact with it?

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  7. #7
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I've a question: where in this ring do you click to interact with it? Will any one of the rings work? Or can you also click in the middle, not on a ring at all, and still interact with it?
    You have to click on or inside the very middle ring to interact with it, all the other areas are just for show :P

  8. #8
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by SRLKing View Post
    You have to click on or inside the very middle ring to interact with it, all the other areas are just for show :P
    Good good. If that's the case I'll use my newest object-finding functions from Herb-Farmer to find rings. It's quite intelligent how it works. Give me a little while and I'll play around with it.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  9. #9
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Good good. If that's the case I'll use my newest object-finding functions from Herb-Farmer to find rings. It's quite intelligent how it works. Give me a little while and I'll play around with it.
    Okay, Im off to bed :P

    midnight here, I would love to see how it works/learn from it (I cant use it as Im applying with this script and want to write it all myself :P) However I can always benefit from reading your work

  10. #10
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Ok here it is. It's shaved down from the original version used to find patches in my Herb-Farmer but I tested it at all angles, the middle of the fairy rings was found every time.

    Simba Code:
    {$I SRL/SRL.Simba}

    //By Flight for shape-related finding routines.  Useful for dynamic box/circle objects
    Function FoundBoxfromTPA(Pnt: TPoint; Pnts: TPointArray; Tol,Offset: Integer; var Box: TBox): Boolean;
    var
      i: Integer;
      lPnts: TPointArray;
      pV1,pV2,pV3,pV4: Boolean;
    begin
      Result := False;

    //Check low X axis
      lPnts := TPABetweenPoints(Point(Pnt.X-Tol,Pnt.Y), Point(Pnt.X-Offset,Pnt.Y), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV1 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV1 then
        begin
          Box.X1 := lPnts[i].X;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

    //Check high X axis
      lPnts := TPABetweenPoints(Point(Pnt.X+Tol,Pnt.Y), Point(Pnt.X+Offset,Pnt.Y), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV2 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV2 then
        begin
          Box.X2 := lPnts[i].X;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

    //Check low Y axis
      lPnts := TPABetweenPoints(Point(Pnt.X,Pnt.Y-Tol), Point(Pnt.X,Pnt.Y-Offset), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV3 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV3 then
        begin
          Box.Y1 := lPnts[i].Y;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

    //Check high Y axis
      lPnts := TPABetweenPoints(Point(Pnt.X,Pnt.Y+Tol), Point(Pnt.X,Pnt.Y+Offset), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV4 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV4 then
        begin
          Box.Y2 := lPnts[i].Y;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

      Result := ((Box.X2 > 0) and (Box.Y2 > 0));
    end;

    Function FoundRing(var Pnt: TPoint): Boolean;
    var
      RingBox,pBox: TBox;
      CTS,i: Integer;
      rPntsB: T2DPointArray;
      rPnts1,mPnts: TPointArray;
    begin
      if not LoggedIn then
        Exit;

      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);

      SetColorSpeed2Modifiers(0.11, 4.59);
      FindColorsSpiralTolerance(MSCX, MSCY, rPnts1, 14408945, MSX1, MSY1, MSX2, MSY2, 7);
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (Length(rPnts1) < 30) then
        Exit;

      SortTPAFrom(rPnts1, Point(MSCX,MSCY));
      ClearDoubleTPA(rPnts1);

      //TPAtoATPAExWrap(rPnts1, 74, 70, rPntsB);
      SplitTPAExWrap(rPnts1, 74, 70, rPntsB);
      SortATPAFromFirstPoint(rPntsB, Point(MSX1,MSCY));
      SortATPASize(rPntsB, True);

      for i:=0 to High(rPntsB) do
      begin
        pBox := GetTPABounds(rPntsB[i]);
        SetArrayLength(mPnts, Length(mPnts)+1);
        mPnts[High(mPnts)] := MiddleTPA(rPntsB[i]);
      end;

      for i:=0 to High(mPnts) do
      begin
        Result := FoundBoxfromTPA(mPnts[i], rPnts1, 70, 10, RingBox);
        if Result then
        begin
           Pnt := MiddleBox(RingBox);
           Break;
        end;
      end;
    end;

    Var
      thePnt: TPoint;

    begin
      SetupSRL;
      if FoundRing(thePnt) then
        MMouse(thePnt.X, thePnt.Y, 3, 3);
    end.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  11. #11
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Ok here it is. It's shaved down from the original version used to find patches in my Herb-Farmer but I tested it at all angles, the middle of the fairy rings was found every time.

    Simba Code:
    {$I SRL/SRL.Simba}

    //By Flight for shape-related finding routines.  Useful for dynamic box/circle objects
    Function FoundBoxfromTPA(Pnt: TPoint; Pnts: TPointArray; Tol,Offset: Integer; var Box: TBox): Boolean;
    var
      i: Integer;
      lPnts: TPointArray;
      pV1,pV2,pV3,pV4: Boolean;
    begin
      Result := False;

    //Check low X axis
      lPnts := TPABetweenPoints(Point(Pnt.X-Tol,Pnt.Y), Point(Pnt.X-Offset,Pnt.Y), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV1 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV1 then
        begin
          Box.X1 := lPnts[i].X;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

    //Check high X axis
      lPnts := TPABetweenPoints(Point(Pnt.X+Tol,Pnt.Y), Point(Pnt.X+Offset,Pnt.Y), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV2 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV2 then
        begin
          Box.X2 := lPnts[i].X;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

    //Check low Y axis
      lPnts := TPABetweenPoints(Point(Pnt.X,Pnt.Y-Tol), Point(Pnt.X,Pnt.Y-Offset), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV3 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV3 then
        begin
          Box.Y1 := lPnts[i].Y;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

    //Check high Y axis
      lPnts := TPABetweenPoints(Point(Pnt.X,Pnt.Y+Tol), Point(Pnt.X,Pnt.Y+Offset), 5, 0);
      SortTPAFrom(lPnts, Pnt);
      for i:=0 to High(lPnts) do
      begin
        pV4 := NearbyPointInArray(lPnts[i], 5, Pnts);
        if pV4 then
        begin
          Box.Y2 := lPnts[i].Y;
          break;
        end;
        if (i=High(lPnts)) then
          Exit;
      end;

      Result := ((Box.X2 > 0) and (Box.Y2 > 0));
    end;

    Function FoundRing(var Pnt: TPoint): Boolean;
    var
      RingBox,pBox: TBox;
      CTS,i: Integer;
      rPntsB: T2DPointArray;
      rPnts1,mPnts: TPointArray;
    begin
      if not LoggedIn then
        Exit;

      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);

      SetColorSpeed2Modifiers(0.11, 4.59);
      FindColorsSpiralTolerance(MSCX, MSCY, rPnts1, 14408945, MSX1, MSY1, MSX2, MSY2, 7);
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (Length(rPnts1) < 30) then
        Exit;

      SortTPAFrom(rPnts1, Point(MSCX,MSCY));
      ClearDoubleTPA(rPnts1);

      //TPAtoATPAExWrap(rPnts1, 74, 70, rPntsB);
      SplitTPAExWrap(rPnts1, 74, 70, rPntsB);
      SortATPAFromFirstPoint(rPntsB, Point(MSX1,MSCY));
      SortATPASize(rPntsB, True);

      for i:=0 to High(rPntsB) do
      begin
        pBox := GetTPABounds(rPntsB[i]);
        SetArrayLength(mPnts, Length(mPnts)+1);
        mPnts[High(mPnts)] := MiddleTPA(rPntsB[i]);
      end;

      for i:=0 to High(mPnts) do
      begin
        Result := FoundBoxfromTPA(mPnts[i], rPnts1, 70, 10, RingBox);
        if Result then
        begin
           Pnt := MiddleBox(RingBox);
           Break;
        end;
      end;
    end;

    Var
      thePnt: TPoint;

    begin
      SetupSRL;
      if FoundRing(thePnt) then
        MMouse(thePnt.X, thePnt.Y, 3, 3);
    end.
    o.0 That is a beautiful function, I am definitely going to read over this some more and hopefully use something like this in my script, I love how it checks the highs and lows, I think I might be able to modify my current one to check the area bit more like yours and have it be good(: Thanks flight! Can't rep, need to spread it around ;(

  12. #12
    Join Date
    May 2007
    Posts
    527
    Mentioned
    12 Post(s)
    Quoted
    109 Post(s)

    Default

    You can also use my surfaces system to accurately find the ring from any angle.

    Here's the script (you can download the include from the link):

    Simba Code:
    program surfaces_fairyring;

    {$DEFINE SMART}

    {$i srl\srl.simba}
    {$i srl\srl\misc\SmartGraphics.simba}

    {$i su_surfaces.simba}

    var
        obj_fairyring: TSurfaceObject;

    procedure Init();
    begin
        SetupSRL();
        SMART_ClearMS();

        CreateSurfaceParts(obj_fairyring, 2);

        with obj_fairyring do begin
            parts[0].c            := 4817795;
            parts[0].hm           := 0.03;
            parts[0].sm           := 0.09;
            parts[0].t            := 12;
            parts[0].minw         := 50;
            parts[0].maxw         := 160;
            parts[0].minh         := 50;
            parts[0].maxh         := 160;
            parts[0].step         := 32;
            parts[0].max_distance := 999;

            parts[1].c            := 14213871;
            parts[1].hm           := 0.91
            parts[1].sm           := 3.94;
            parts[1].t            := 8;
            parts[1].filter       := @SurfaceFilterClosest; // We want to have the closest fairy ring next to us.
            parts[1].minw         := 10;
            parts[1].maxw         := parts[0].maxw;
            parts[1].minh         := 10;
            parts[1].maxh         := parts[0].maxh;
            parts[1].step         := 32;
            parts[1].max_distance := parts[0].max_distance;

            name := 'Fairy ring';
            uptext := 'Fairy';
            filter := @SurfaceFilterClosest;
        end;
    end;

    begin
        Init();

        if FindSurfaceObject(obj_fairyring, MSX1, MSY1, MSX2, MSY2) then begin
            WriteLn('Found fairy ring at ' + IntToStr(obj_fairyring.p.x) + ', ' + IntToStr(obj_fairyring.p.y));
        end;
    end.

    Here's a few screenshots of it at action:



    Attached Images Attached Images

  13. #13
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by superuser View Post
    You can also use my surfaces system to accurately find the ring from any angle.

    Here's the script (you can download the include from the link):

    Simba Code:
    program surfaces_fairyring;

    {$DEFINE SMART}

    {$i srl\srl.simba}
    {$i srl\srl\misc\SmartGraphics.simba}

    {$i su_surfaces.simba}

    var
        obj_fairyring: TSurfaceObject;

    procedure Init();
    begin
        SetupSRL();
        SMART_ClearMS();

        CreateSurfaceParts(obj_fairyring, 2);

        with obj_fairyring do begin
            parts[0].c            := 4817795;
            parts[0].hm           := 0.03;
            parts[0].sm           := 0.09;
            parts[0].t            := 12;
            parts[0].minw         := 50;
            parts[0].maxw         := 160;
            parts[0].minh         := 50;
            parts[0].maxh         := 160;
            parts[0].step         := 32;
            parts[0].max_distance := 999;

            parts[1].c            := 14213871;
            parts[1].hm           := 0.91
            parts[1].sm           := 3.94;
            parts[1].t            := 8;
            parts[1].filter       := @SurfaceFilterClosest; // We want to have the closest fairy ring next to us.
            parts[1].minw         := 10;
            parts[1].maxw         := parts[0].maxw;
            parts[1].minh         := 10;
            parts[1].maxh         := parts[0].maxh;
            parts[1].step         := 32;
            parts[1].max_distance := parts[0].max_distance;

            name := 'Fairy ring';
            uptext := 'Fairy';
            filter := @SurfaceFilterClosest;
        end;
    end;

    begin
        Init();

        if FindSurfaceObject(obj_fairyring, MSX1, MSY1, MSX2, MSY2) then begin
            WriteLn('Found fairy ring at ' + IntToStr(obj_fairyring.p.x) + ', ' + IntToStr(obj_fairyring.p.y));
        end;
    end.

    Here's a few screenshots of it at action:




    I think I will be using this, all credit to you of course(:

  14. #14
    Join Date
    May 2007
    Posts
    527
    Mentioned
    12 Post(s)
    Quoted
    109 Post(s)

    Default

    Quote Originally Posted by SRLKing View Post
    I think I will be using this, all credit to you of course(:
    Please, be my guest

  15. #15
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Quote Originally Posted by superuser View Post
    Please, be my guest
    I really hope you can get this put in the offical SRL includes, it is absolutely amazing how accurate I was able to get it, works with people in the ring, fairies and the other creatures over it as well. I really think you should talk to a admin/someone who can get this pulled in the official SRL include as it is extremely useful and provides almost a reflection like way of identifying objects. So a huge thanks to you<3

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
  •