Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 mover bug #6

Closed
chris0804 opened this issue Aug 5, 2014 · 8 comments
Closed

1 mover bug #6

chris0804 opened this issue Aug 5, 2014 · 8 comments

Comments

@chris0804
Copy link

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
Copy link
Owner

smack42 commented Aug 5, 2014

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

@smack42 smack42 closed this as completed Aug 5, 2014
@chris0804
Copy link
Author

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
Copy link
Owner

smack42 commented Aug 5, 2014

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

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

@smack42 smack42 reopened this Aug 5, 2014
@smack42
Copy link
Owner

smack42 commented Aug 5, 2014

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 added a commit that referenced this issue Aug 5, 2014
("fast" code path could sometimes do an unnecessary extra move)
@smack42
Copy link
Owner

smack42 commented Aug 5, 2014

Fixed a bug in the solver. 70c199d

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

@smack42
Copy link
Owner

smack42 commented Aug 5, 2014

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 added a commit that referenced this issue Aug 5, 2014
(for some custom boards the special case "solution in 0 or 1 move" was not detected)
@smack42
Copy link
Owner

smack42 commented Aug 5, 2014

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

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants