Page 1 of 3 123 LastLast
Results 1 to 10 of 22
Like Tree1Likes

Thread: Bot Help

  1. #1
    Member
    Luriebot is offline

    Posts
    85

    Bot Help

    Hey I am looking for someone who is good a java to help look over my bilge bot. I cannot find a problem with it but it is not functioning the way it should. I do not know how it is getting the moves but basically I am stuck so leave a comment and ill hit you up

    - - - Updated - - -

    yea i checked all that its working, it is just click in weird places kinda and idk why because i cant find a pattern to look for like its not clicking predictable, but it is making a decision on were to click so idk whats up.

  2. #2
    Senior Member
    TheRigger is offline

    Posts
    641
    Too much random error in the human mouse movement...?

  3. #3
    Member
    Luriebot is offline

    Posts
    85
    na cus the end point is a move, just not the logical one. Im going through and re writing it i hope that helps

  4. #4
    Senior Member
    TheRigger is offline

    Posts
    641
    Maybe it's logical to the bot and not you... are you using depth 5 lel.
    Ideally for a bilge bot's simple detection of a best move, you would traverse through the array. Then, have 4 ints (although you would have to check that the points you are checking are in bounds of the array). Basically, if the point on the left end is equal to the point on the right and above and below it by 1 and 2 spaces, rightVertNum++ (starts at 1)(of course, the piece 1 above would have to be equal before the point 2 above would be tested for equality); then check for the pieces 2 to the right of and 3 to the right of the left end (of the pieces you're going to switch) and if they're true (again, inside true before checking for further piece), rightHorizNum++; do same thing for the left side. Then, if any are less than two, set them to 1. Mutliply rightVertNum*rightHorizNum*leftVertNum*leftHorizNu m to get the score of the move.

    Again, that's only a simple implementation. Also, check that your method to moveUp() the pieces after a clear works properly, and that you don't count cleared pieces in combos (as in you can't form a combo out of cleared pieces). This personally (moveUp() method) is where I had the most trouble. Still too lazy to finish this bot...

    lel and my Rigging bot recognizes the board but seems to be experiencing infinite depthsearch or something that causes the GUI to freeze (I suspect a huge number of calculations, which shouldn't be happening on depth 2). Which is annoying, because I had hoped it would work the first time through. Anyways, good luck with that...

    Edit: A more complicated implementation would take into account crabs, or at least (total number of pieces cleared at the end minus the number of pieces cleared by clicks)* tiny bonus
    Last edited by TheRigger; 01-19-2014 at 01:57 AM.

  5. #5
    #Return
    Scarecrow is offline

    Posts
    3,443
    Quote Originally Posted by TheRigger View Post
    lel and my Rigging bot recognizes the board but seems to be experiencing infinite depthsearch or something that causes the GUI to freeze (I suspect a huge number of calculations, which shouldn't be happening on depth 2). Which is annoying, because I had hoped it would work the first time through. Anyways, good luck with that...
    Depends if you're using brute-force or not...

    It's most likely just an infinite loop in your code though.

  6. #6
    Member
    Luriebot is offline

    Posts
    85
    Update!

    I rewrote the searching algo and now it always makes basic clears, 3's and 4's not combos now i am working on a board up method as that is the next logical step.

    @TheRigger did you complete the board update method? how did you go about it?

  7. #7
    Senior Member
    TheRigger is offline

    Posts
    641
    On the rigging bot--> f*cking recursive methods no do what I want...
    Code:
     public void moveUp()
        {
        	for (int i = 0; i < 6; i++)
        	{
        		for (int j = 0; j < 11 ; j++ )
        		{
        			stop:{
        			while( boardToSolve[j][i] == -1)
        			{
        				for (int k = j; k <= 10; k++)
        				{
        					if(this.lowerAreEmpty(i,k) && k == j)
        					{
        						break stop;
        					}
        					boardToSolve[k][i] = boardToSolve[k+1][i];
        				}
        				boardToSolve[11][i] = -1;
        				}
        			}
        		}
        	}
        }
    public boolean lowerAreEmpty(int i, int j)
        {
        	for(int k = j; k < 12; k++)
        	{
        		if(boardToSolve[k][i] != -1)
        		{
        			return false;
        		}
        	}
        	return true;
        }
    that's what I used in my bilge bot. which I never finished, so you might want to test it a little first, beyond the testing that I did.
    also -1 was my "empty spot" value, if you're wondering why that appears in the code.
    Last edited by TheRigger; 01-20-2014 at 01:48 AM.

  8. #8
    Member
    Luriebot is offline

    Posts
    85
    seems like what i did, however i implement mine after i test the board for the first move. i just replace all the pieces that are 3+ in a row with -2 my null piece and then loop through and move them down by replacing them with the next non null piece it seems to be working great! only problem i am having now is a bug where it gets confused with doubles. and something else that i have to narrow down. btw its only looking 2 deep atm because that is fast. as i refine it ill add levels of looking

  9. #9
    Senior Member
    TheRigger is offline

    Posts
    641
    I just had an array of pieces TO BE CLEARED. Then, I cycled through the array vertically and horizontally, marking all groups of three to be cleared. So, a 5 like this:
    [] would be seen in an order that takes the first three, sets them to be cleared, takes the next three as you cycle through and mark
    []them to be cleared, and then takes the last three and marks them to be cleared. Then, I cleared all these pieces by setting them to -1
    []and then invoking moveUp();
    []
    []
    it was not a very smart implementation, but it worked great.

    also, just in case you haven't noticed, a recursive depthsearch is way simpler than writing craptons of for loops, in most cases.
    Bilge might be the exception, but this holds for rigs.


    NOOOOOOOOOOOOOOOOOOOOOOO.
    /me goes into hysterics.
    I was misusing STATIC in the code, which screwed everything up.
    FULL CODE REWRITE.
    Last edited by TheRigger; 01-20-2014 at 04:26 AM.

  10. #10
    Member
    Luriebot is offline

    Posts
    85
    hmm this is my calculations class, i know its a bad idea to pastebin it but whatever. it is not working right and sometimes not returning viable moves when they are right there in front of me. so idk what's wrong. excuse the syntax and other nitpicks and feel free to correct my mistakes and/or give input!

    import java.awt.AWTException; import java.awt.MouseInfo; import java.awt.Point - Pastebin.com

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •