Announcement

Collapse
No announcement yet.

Second Forage Bot

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

    Second Forage Bot

    I started work on a forage bot around 2 days ago. Funnily the next day someone posted that they also have one in the making. Reading his post, it looks like they are coded very differently. I am obviously no where near the progress he has made however I only started this a few days ago. I made a small video to show what stage I am up to at the moment. It doesn't detected boxes yet as I am still coding the algorithm to work out how to create clears. I'm currently getting near a stage where the bot would be able to continuously play the puzzle if no boxes were to come. I'm really happy with the progress at the moment in such a short period of time and I have some really good idea on how to get this fully functional.

    This video is 100% automatic. I did not touch any keys or the mouse.


    #2
    Not a bad start.

    Just remember the whole focus of this game is to clear the boxes

    Comment


      #3
      Yeah I know :P. Obviously I need to add the part where the bot detected that boxes are present and then find the best possible way to clear it. Might start work on that tonight if I get bored.

      Comment


        #4
        One way of doing it:
        Add weights. Give extra weightage to clears on the outside of the board, and give extra weightage to pieces under chests.
        Basically keep track of the spaces under chests.
        And have an array like this:
        [50][10][5][1][5][10][50]
        Multiply the score of each piece by the column's score by the multiplier (pretty big) if there's a chest in that column.

        No, not perfect.
        But pretty [edit: bad, lol I changed the heuristic].

        The one odd case is when you have a giant crate in the exact middle, in which case you get left with an empty column in the middle. In that case dismiss? Not really that easy to fix compared to things like detection.
        Last edited by TheRigger; 05-19-2014, 10:32 PM.

        Comment


          #5
          Dibs on getting this bot free first again.
          Calm the sig size

          Comment


            #6
            Hey nice haha! Watch out when detecting the crates, the shiny stars it emits do mess with the colors. I'm still not 100% sure it's an issue but it does seem like it might cause some issues with recalculations. If the bot can't find the crate it was acting on previously mine sort of donks out when there are multiple answers on the board.

            Comment


              #7
              I'm actually not detecting crates. They're are defined as a non detection. I just made it so that is the detection didn't match any of the recorded RGB's then it would conclude that it must be a crate.

              Comment


                #8
                That doesn't sound like a good idea.. what happens when there are empty spaces? It would treat them as a crate wouldn't it? Also turns out the recalculation was my algorithm so it's not much of an issue heh

                Edit: unless you recorded every pixel value in the board's background which sounds like more work than it's worth haha

                Comment


                  #9
                  Or you could just find the pixel value for the top left corner of a crate and set all the others corresponding to it that way...
                  lol that's what I'm doing.
                  So yeah I'm working on a forage bot too.
                  But for me it's much easier since I have the Aethyr framework to work with, and some things are/can be the same for many bots.

                  Comment


                    #10
                    I want them to detect empty spaces as crates though. When I say crate, the program is programed to treat them as non moveable objects that are required to get to the bottom of the screen. A space can only form under an existing crate so it has no relevance.

                    Comment


                      #11
                      It will become relevant once you actually start working on your clearing algorithm. You need to differentiate between a chest and an empty space or otherwise unknown piece. What the video shows doesn't appear to simulate the board, when you start working on it you'll need a way to tell whether or not a chest was cleared.

                      Comment


                        #12
                        Originally posted by savagesun View Post
                        It will become relevant once you actually start working on your clearing algorithm. You need to differentiate between a chest and an empty space or otherwise unknown piece. What the video shows doesn't appear to simulate the board, when you start working on it you'll need a way to tell whether or not a chest was cleared.
                        Pssh such lies.
                        Just clear the pieces under chests. And BAM! The chest's gone...
                        Plz sir huristks r boss. Plz no aids jst clrs.
                        Okay... yeah.
                        Anyways there are three ways to solve this problem:
                        1. Tell if a chest was cleared. (useful in Foraging helpers or bots that help only when possible and let you do the rest)
                        2. Use heuristics to clear pieces under chests. (useful in making an automatic bot, but not always successful)
                        3. Get Flashbang, Scarecrow, Notion, and Sageman in a room for 10 years/months/days and have them design an algorithm. (unbeatable)
                        The last one is unlikely to ever happen...
                        Anyways, that's my take on foraging.
                        Last edited by TheRigger; 05-11-2014, 12:47 AM. Reason: fail formatting

                        Comment


                          #13
                          Yeah I think I sort of misspoke when I said you'd need to know for the purposes of knowing whether or not the chest was cleared. But I maintain that you need to know some basic info about the chest to properly simulate. How would you keep 2x2 pieces together without a way of knowing if they are 2x2s?

                          Comment


                            #14
                            Ah. Use a node for the top left corner and a generic chest for all the others.
                            Then proceed using the algorithm I outlined in your post.
                            that is

                            public void simulateFalling()
                            (*) while things are still breakable
                            break things
                            make things fall into spaces except chests
                            move chests down
                            make things fall into spaces except chests
                            end of while loop
                            return



                            The way that you suggest these things has an error (yes, I'm making an assumption here).
                            What if you have 2 2x2s next to each other?
                            Then these in the 2x2s in the center:
                            [x][*][*][x]
                            [x][*][*][x]
                            could fall if they had empty spaces under them, which would be incorrect.
                            instead, you calculate the falling of chests based on the nodes
                            [N][x][N][x] (x = generic chest piece)
                            [x][x] [x][x]
                            where N is a node, therefore you have no weird things like the previously outlined situation.

                            You know, technically someone could write a not-half bad forage thing based on just the stuff I've written on this site lol...
                            Wouldn't be perfect though because I've reserved knowledge of some errors that I don't want to take the effort to fix until I actually put it in my code.

                            Anyways, you can put in the 1x1 nodes, 2x2 nodes, and 3x3 nodes and generic chest pieces while reading in the image, and therefore have less chance of error at runtime.
                            Last edited by TheRigger; 05-11-2014, 03:32 AM.

                            Comment


                              #15
                              Mine simulates correctly, I just don't want to write out exactly how I do it.. You're making me paranoid people will take my shit haha. But you'd still have to have knowledge about the chest. The top left piece could only be gathered if you differentiated between a top left piece and an empty space.

                              Comment

                              Working...
                              X