Results 1 to 16 of 16

Thread: Tunnel finding help?

  1. #1
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default Tunnel finding help?

    Hey, I'm wondering what a good way of finding one of these tunnels would be. It doesn't matter which one, any of them will work. The problem is that the tunnel color is the same color as the large nothingspace that surrounds the cave. Tunnel entrances are circled in blue.

    E: The second tunnel from the left isn't actually accessible, so ignore that one.



    Thanks

  2. #2
    Join Date
    Nov 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Quoted
    43 Post(s)

    Default

    I would try searching for the "nothingness" color, and make sure the cream color is within a certain distance of that. If needed, you could look for the pillar color as well.
    RemoveDistTPointArray should do it (removing all points that are not withing 30 pixels for example). FindTPACluster may do the trick as well (I haven't tried it yet though).
    Last edited by Neodymium; 02-14-2013 at 09:07 PM.

  3. #3
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Neodymium View Post
    I would try searching for the "nothingness" color, and make sure the cream color is within a certain distance of that. If needed, you could look for the pillar color as well.
    RemoveDistTPointArray should do it (removing all points that are not withing 30 pixels for example). FindTPACluster may do the trick as well (I haven't tried it yet though).
    I think I'm going to try MMToMS first, but thanks for the suggestions

  4. #4
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    you guys way overthink things



    ?

  5. #5
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    I have to say Olly, that is easier. I still need think of a way to avoid the pink one though.

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

    Default

    Quote Originally Posted by Ollybest View Post
    you guys way overthink things


    ?
    another tip, tunnel/black shifts between 0 and 1 in RS, tolerance wont do alone on 0, so CTS2 it 100 sat mod

    Simba Code:
    Function FindObj: Boolean;
    Var
      tmpCTS, i, l, r, counter:integer;
      ObjTPA:TPointArray;
      ObjATPA:T2DPointArray;
      x,y:integer;
    Begin
      tmpCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.00, 100.0);
      FindColorsTolerance(ObjTPA, 0, MSX1, MSY1, MSX2, MSY2, 5);

      SplitTPAWrap(ObjTPA, XV, ObjATPA);
      SortATPASize(ObjATPA,True);
    End;

    Quote Originally Posted by BMWxi View Post
    I have to say Olly, that is easier. I still need think of a way to avoid the pink one though.

    Something like olly's +

    Simba Code:
    SortATPAFrom(ObjATPA, Point(MSX1, MSY1+20));
    DeleteValueInATPA(ObjATPA, 1);
    Last edited by DannyRS; 02-14-2013 at 09:51 PM.


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

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    TPA
    ATPA
    Pixel Counts
    Box Size Limits etc
    Get me?

    As for color

    http://i.imgur.com/pg0rSbs.png

    LikeABoss!

  8. #8
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    I have to say Olly, that is easier. I still need think of a way to avoid the pink one though.
    easy enough to add a check for the green colour in it

  9. #9
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    easy enough to add a check for the green colour in it
    Just saw yours too, damn nice!
    Care to explain the code please?

  10. #10
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    easy enough to add a check for the green colour in it
    Yeah, that's basically what I had in mind. Thanks for the help Olly, YoHoJo, and Danny

  11. #11
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default



    Simba Code:
    procedure oo;
    var
      tpa: TPointArray;
      atpa: T2DPointArray;
      i: Integer;
      tb: TBox;
    begin
      findColorsTolerance(tpa, 0, 1, 1, w-1, h-1, 10);

      splitTPAexWrap(tpa, 10, 5, atpa);
      sortATPASize(atpa, true);

      if (length(atpa) < 1) then
        exit;
     
    // atpa is obviously sorted to biggest first, and the biggest will obviously be the black empty  
    // space so lets remove it.    
      deleteValueInATPA(atpa, 0);

      if (length(atpa) < 1) then
        exit;

      // removing the tpa from the atpa if we find the brown sign colour in it
      for i := high(atpa) downto 0 do
        begin
          tb := getTPABounds(atpa[i]);
          if (countColorTolerance(1190186, tb.x1, tb.y1, tb.x2, tb.y2, 5) > 5) then
            deleteValueInATPA(atpa, i);
        end;

      DebugATPA(atpa, '');

    end;
    Last edited by Olly; 02-14-2013 at 10:39 PM.

  12. #12
    Join Date
    Dec 2011
    Location
    U.S.A.
    Posts
    635
    Mentioned
    5 Post(s)
    Quoted
    249 Post(s)

    Default

    Ehh... What? I know TPA's are collections of tpoints, and tpoints are x,y coordinates, but It's still mumbo-jumbo to me. It confuses me.

  13. #13
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Sawyer View Post
    Ehh... What? I know TPA's are collections of tpoints, and tpoints are x,y coordinates, but It's still mumbo-jumbo to me. It confuses me.
    learn the basics first, young jedi!

    EDIT:

    http://villavu.com/forum/showthread.php?t=33111 I love this tut, very well explained!
    And after u know that, read the Wizzyplugin tutorial.

    Creds to DannyRS for this wonderful sig!

  14. #14
    Join Date
    Dec 2011
    Location
    U.S.A.
    Posts
    635
    Mentioned
    5 Post(s)
    Quoted
    249 Post(s)

    Default

    Thanks. I guess I'm no jedi master yet

  15. #15
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Sawyer View Post
    Thanks. I guess I'm no jedi master yet
    And remember smart_debugatpa(), then u know what's going on with the searchings

    Creds to DannyRS for this wonderful sig!

  16. #16
    Join Date
    Dec 2011
    Location
    U.S.A.
    Posts
    635
    Mentioned
    5 Post(s)
    Quoted
    249 Post(s)

    Default

    Okay Time to paint a bunch of points different colors

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
  •