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

[18Chesapeake] Game allows placement of a tile that does not extend a route #4287

Closed
orome opened this issue Mar 3, 2021 · 6 comments · Fixed by #4293
Closed

[18Chesapeake] Game allows placement of a tile that does not extend a route #4287

orome opened this issue Mar 3, 2021 · 6 comments · Fixed by #4293
Labels
rules-permissive Problems where 18xx.games allows things the game rules forbid (fixing these may impact active games)

Comments

@orome
Copy link

orome commented Mar 3, 2021

The game allows placing of a tile that fails to "extend a route of the company", at least from this position, where the C&A is allowed to place tile 4 with rotation 0 in I5.

Screen Shot 2021-03-03 at 5 53 28 PM

@michaeljb michaeljb added rules-permissive Problems where 18xx.games allows things the game rules forbid (fixing these may impact active games) and removed needs triage labels Mar 3, 2021
@ventusignis
Copy link
Collaborator

I just found this looking at the pathing code and I was about to submit a bug with this example
image

@tobymao
Copy link
Owner

tobymao commented Mar 14, 2021

reopening this since i had to revert due to performance issues

@orome
Copy link
Author

orome commented Mar 15, 2021

An illustration of the loop that appears to allow the illegal placement in the OP:

Screen Shot 2021-03-15 at 4 36 16 PM

@roseundy
Copy link
Collaborator

So, I'm pretty sure this can be fixed by using an edge check instead of this:
next if paths[path]
to the central node.walk loop. Of course we will have to store the edges for the path yielded by node.walk

@roseundy
Copy link
Collaborator

And I already found a flaw in my proposal. When tracing from a node, two divergent paths from a token may take you to two different nodes. Both of those sets of paths are fine, but they will have an edge in common. The only time you want to reject a path with a re-used edge is when you are following a chain of nodes.

@michaeljb
Copy link
Collaborator

here's a gist with a hotseat game recreating ventusignis's example, the last action is laying the 25 on F8 - https://gist.github.com/michaeljb/b3ee552eadec0d76edb4d00748f137ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rules-permissive Problems where 18xx.games allows things the game rules forbid (fixing these may impact active games)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants