smack42 / DriftingDroids

DriftingDroids - yet another Ricochet Robots solver program
https://github.com/smack42/DriftingDroids/wiki
GNU General Public License v3.0
41 stars 12 forks source link

1 mover bug #6

Closed chris0804 closed 10 years ago

chris0804 commented 10 years ago

I would like to say that I really like DriftingDroids. Of all the Ricochet Robot solvers I used, it is by far the best for practice.

I would like to report a bug for version 1.3.3. For the game, 679C+52+2E21860FBF+C6 , the best solution is 1 move but your program calculated 4 moves. This bug seems to happen to most games where solution is 1 move. The same bug also happens to games like, 679C+52+2E21860FA6+C6 .

smack42 commented 10 years ago

This is a feature, not a bug. :-) I added it to make the solver compliant to the rules of Ricochet Robots. By the way, I don't know of any other solver program that has this feature!

Quote from the FAQ at http://boardgamegeek.com/boardgame/51/ricochet-robots

An active robot (the robot that currently corresponds to the target space) must ricochet ("turn right or left") off an obstacle at least once before it is even allowed to reach the target space. (In other words, if it could reach the target space without ricocheting, another route must be chosen).

There have been some discussions about these rules: http://boardgamegeek.com/thread/117428/robots-cannot-return-direction-they-came http://boardgamegeek.com/thread/627218/can-another-robot-move-marked-spot-help-main-robot

chris0804 commented 10 years ago

image

I don't understand why the program moves blue to the right. That seems like an unnecessary move. The original board is

image

smack42 commented 10 years ago

Yes, this doesn't look right. Will check it.

The custom board in this screenshot is: !DriftingDroids_game!624E29BC!AAAEM3jaY2BgYBAAYVYgUQLEpUBcDsRlQHyYiZmFkxENMIxswDjC+cM/ggkk+BEY4SAhNWYoyQgAHtADZw==!

smack42 commented 10 years ago

When you switch off the option "allow rebound moves" then it finds some 8-move solutions, with no unnecessary moves it seems.

There must be something strange going on in the "fast" path of the solver. It hasn't been tested well with custom boards like this...

smack42 commented 10 years ago

Fixed a bug in the solver. 70c199d347b75758b744ae74c970a88b0c3a2440

Now the solution doesn't have the unnecessary move anymore: dd_

smack42 commented 10 years ago

Now we can think about the question: is this a valid solution? (the yellow robot has not "ricocheted", i.e. not moved to East or West)

The reason for this is that the solver takes the "fast" path of the algorithm that doesn't handle this special case. It would be easy to change it so that it takes the "regular" path for custom boards like this. Then the 6-moves solution of the previous screenshot would be rejected and a longer one (8-moves I think) would be found.

What do you think?

smack42 commented 10 years ago

Answered my question in the previous comment with another small fix. 2294370b21334d7a9ff493a305164a53a3253512

Now the solver detects this as the special case "solution in 0 or 1 move" and then finds several 8-move solutions: dd__

Thanks for the bug report! The custom boards have not been tested very thoroughly yet, so it's good that we find the bugs in the "dark corners" now. :-)

chris0804 commented 10 years ago

Thanks for the quick fix, I really like your program!