Announcement

Collapse
No announcement yet.

Carpentry Solving

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    well with larger spaces the point is moot. if a hole can be solved with three more more pieces it really does not matter which piece is placed as long as it does not build c's or other bad shapes, ie it squares the hole and that should always happen as long as the bot is programmed to place the piece is a way that the most piece edge is touching hole edge. writing a method to test if a hole can be solved with three or less pieces, should be easy because that is just counting the total number of open spaces if 15 or less it can be solved by three pieces and then smart placing would be required but that is as easy as saying if a piece placed in a position requires two pieces or even one piece that is rare then that placement is not a usable moved. also testing if a mp can be made using existing pieces should be the first test if it can be solved with 3 or less pieces. also a note on threading, unless you have a smart way to prioritize mouse movement and piece placement it will be no faster then if only one thread is used. this is because there is always one focus hole, a hole that has a shaking piece or is flashing red, a bot should always test this hole first as if not filled is 3 turns the hole will cause score loss and may mess with the bot. because holes can be ranked due to the decay timer in the puzzle it would be smarter to just test one hole at a time as regardless of if all the holes are tested one hole needs the focus and should get preferential placement. i hope you understand, and sorry about the grammar its late.

    also finally a last note on all this, if you intend to make this a bot get high ranking you need to include in your code a method that will test best fit. as in regardless of which hole needs a piece which placement in all the holes is best fit. and this needs to be smart as hell because it needs to understand how bonuses work so that it will both not let a hole fill with a bad placement but also allow that if a better placement comes after ie a chain masterpiece should be uninterrupted even at the cost of a botched hole and so on. if you wana talk send me a message with our skype and i can try to explain it better or reply and let me know what you need.

    Comment


      #17
      Originally posted by trickshot17 View Post
      Have you considered using pre-computed tables
      Not sure what you mean but I don't think pre-computation will work well if at all for carpentry.


      @Luriebot
      I get what you mean, I'll try to work that in. I'm not quite at the point where I should be thinking a move or two ahead yet but I'll certainly keep it in mind. I also haven't really been thinking in terms of all 4 boards yet, but I imagine checking to see which board is in danger of losing a piece or getting larger is trivial since I can just keep a count of the last time the board was changed and compare it to the number of moves that have happened since then and from that I can determine the time left for each hole.
      Last edited by savagesun; 10-03-2013, 10:17 PM.

      Comment


        #18
        yea that's all you have to do just keep an array and when a hole is placed the array is updated so that hole is last and so on. what i am saying is not thinking ahead just building ahead. like not building shapes that cant be filled, that should be easy just run a check to determine if the hole left after a piece would be places is fill-able by any of the 3 or 4 most common pieces, if not then rule it out. this i believe is the theory behind knock on wood bot that was sold here. the newer bot has the same methods but they built in a learning part that i think has smart placement built into a comparison so that it knows the best placement given a few variables but the principle behind knock on wood and wood for thought are the same and they should both be able to preform the same provided kow was updated a bit.

        Comment


          #19
          Originally posted by Luriebot View Post
          yea that's all you have to do just keep an array and when a hole is placed the array is updated so that hole is last and so on. what i am saying is not thinking ahead just building ahead.
          Well the bot has to think ahead to build ahead . I was planning to just check to make sure no 1x1 bits were left after a piece placement but I'll go the extra mile to check for the rest of the space left over. Right now I think I'm going the wrong direction with finding the best move. I'm just attempting to keep the pieces placed at the corners of the board and making sure no areas that cannot be filled by a piece are still there. Do you think somehow attempting to divide up the board into pieces using the most common the most would work better? Because that sounds somewhat like what you are suggesting.

          Comment


            #20
            the problem with all carp bots is that the pieces cannot be predicted, building pre filled hole's would not work as you are not guaranteed a specific piece. The closest viable method would be pre building using all the most common and as pieces come filling the holes so that the most common pieces can be used still regardless of which piece was placed and if it was in the pre built hole. The puzzle is a matter of chance, and really good carpers know that and to counter it use other methods that a computer can do but it would be complicated. a scenario would be:

            a hole is able to be completed by a square piece:
            ##
            ###

            it is three moves away from breaking, another hole can be completed by the above piece and a u shaped piece
            #..#
            ###

            do you complete the mp, or complete and wait for the u shaped piece? a computer unless specifically programmed will always complete the mp first. a human will look at many things including the other holes and how far along they are and how close to mp are they (for chaining mp's) what pieces have been showing up can you expect a u or did you get three not too long ago and statistically wont get another one. also can the hole be completed for another bonus if a u is not there say a grain bonus or token if applicable. Building a method to pre build holes would be used only if it was fast and could somehow rank the best move so that the best move and the move needed for a specific hole could be compared.

            Comment


              #21
              Just since I'm interested in this kind of thing, is there a defined or maximum size for any carpentry hole? Or some certain pixel to start reading at?

              Comment


                #22
                Originally posted by TheRigger View Post
                Just since I'm interested in this kind of thing, is there a defined or maximum size for any carpentry hole? Or some certain pixel to start reading at?
                Why not just start at the first 17x17 black square you find on the YPP window?

                Comment


                  #23
                  There might be a black hole to the left of it somewhere down on the board
                  Edit: found an example, uploading.
                  Edit: Here
                  Click image for larger version

Name:	SuchWow.jpg
Views:	1
Size:	9.5 KB
ID:	155327
                  The top left black square is actually to the right of the leftmost black square in the top left hole.
                  Edit: So lucky, this happened first board.
                  Last edited by TheRigger; 01-15-2014, 12:27 AM.

                  Comment


                    #24
                    Originally posted by TheRigger View Post
                    There might be a black hole to the left of it somewhere down on the board
                    Edit: found an example, uploading.
                    Edit: Here
                    [ATTACH=CONFIG]1356[/ATTACH]
                    The top left black square is actually to the right of the leftmost black square in the top left hole.
                    Depending on how you code your detection, you can actually make it search left to right. You're not going to get a perfect square array in carpentry.

                    If you looked from left to right (and by that I mean your detection is going top to bottom). Your array would look like this
                    if (spot is black)
                    array[x,y] = 1;

                    It would look something like this...
                    0011110
                    0011110
                    0011100
                    0111111
                    1111110
                    0111111

                    (This may not be entirely correctly done but it's the general idea)

                    Comment


                      #25
                      Yeah, I know. But where do you START looking for each hole? (That's my problem)
                      I was going to say
                      if(new Color(boardImage.getRGB(pixelLocation)) == Color.BLACK)
                      {
                      .......board[coord1][coord2] = 0;
                      }
                      else
                      {
                      .......board[coord1][coord2] = 1;
                      }
                      //Empty pieces, in my mind, should be zero
                      Last edited by TheRigger; 01-15-2014, 12:40 AM.

                      Comment


                        #26
                        Originally posted by TheRigger View Post
                        Yeah, I know. But where do you START looking for each hole? (That's my problem)
                        I was going to say
                        if(new Color(boardImage.getRGB(pixelLocation)) == Color.BLACK)
                        {
                        .......board[coord1][coord2] = 0;
                        }
                        else
                        {
                        .......board[coord1][coord2] = 1;
                        }
                        //Empty pieces, in my mind, should be zero
                        I'd personally;
                        Split the board into 4 sections, one for each hole.

                        For each section; Find all instances of a 17x17 or 18x18 black square (whatever it is)

                        You should now have a list of all "locations",
                        For startPoint.X find the location from your list with the lowest "x" value.
                        For startPoint.Y find the location from your list with the lowest "y" value.
                        *Make note that X and Y are not always from the same "location"

                        Ta-da you have a starting point for a section.

                        Comment


                          #27
                          That actually seems like it might work .
                          Good for whoever might be working on this right now >, but I guess I should just keep working on detection for my rigging bot. I think I've found the magic pixel that doesn't even vary for splices, but chances are that it gets nixed by the tokens. Ah, well.

                          Comment


                            #28
                            Originally posted by TheRigger View Post
                            That actually seems like it might work .
                            Good for whoever might be working on this right now >, but I guess I should just keep working on detection for my rigging bot. I think I've found the magic pixel that doesn't even vary for splices, but chances are that it gets nixed by the tokens. Ah, well.
                            One pixel? If you're having that trouble... Try two, or just get a second pixel that checks if its a splice.

                            Comment

                            Working...
                            X