Ludii Forum
Cannot Complete Drop Move - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Game Problems (https://ludii.games/forums/forumdisplay.php?fid=17)
+--- Thread: Cannot Complete Drop Move (/showthread.php?tid=1583)



Cannot Complete Drop Move - AlexanderBrady - 05-27-2023

This game involves a drop move followed by a custodian "capture" (of empty spaces) that changes the state variable of that space.



All of it seems to work, except situation in the attached game trial. If black attempts to move (Move77-D6) (that is, move a base from hand to the space D6) Ludii simply won't process the move. The visual of the base remains stuck in place, but Ludii does not move on to the next move and clicking anywhere on the screen cancels the move.



I think it has to do with the custodial capture after dropping logic, but I can't figure out why it happens in this case but not other cases.


RE: Cannot Complete Drop Move - dale walton - 05-27-2023

I have found this kind of behavior can happen if a consequence of a condition affects a boolean that creates the condition. You are not allowed to do that in ludii, but the compiler doesn't enforce it. This is my off-hand experience - I didn't look at your code, but I was wrestling with the same issue today, and it took a while to hunt down the bit of code that was causing it. Could also be going into an infinite loop or not able to find any valid move,say dueto an ifAfterwards clause or a (to) that moves to the (from) i.e. a zero distance move is among the moves it is considering to make.


RE: Cannot Complete Drop Move - AlexanderBrady - 06-02-2023

The space where the player drops their piece on to is marked with a state to allow them to drop there, and that state is removed when the piece is dropped. However, this rule works in most cases. I will list the cases which do and don't work in plain English to see if you can understand where things go wrong.

1) Freely place a piece on a space with a certain state, which causes the state in the target space to change to 0 (no-placement) and the state in adjacent spaces to change to states (1-6) depending on what placements end up being allowed. This works when the state in all adjacent spaces is also 0.
2) Drop a piece from hand to a space with a certain state, changing the state of that space to 0. Then change the states in adjacent spaces to one of the non-zero states (1-6). This works when the state in all adjacent spaces is 0.
3) Freely place a piece on a space with a certain state, which causes the state in the target space to change to 0 (no-placement) and the state in adjacent spaces to change to states (1-6) depending on what placements end up being allowed. This still works when the state of any of the adjacent spaces was non-zero to begin with.
4) Freely place a piece on a space with a certain state, which causes the state in the target space to change to 0 (no-placement) and the state in adjacent spaces to change to states (1-6) depending on what placements end up being allowed. This DOESN'T work when the state of any of the adjacent spaces was non-zero to begin with AND the drop move causes the state in an adjacent space to change.

I'm not sure if Ludii realizes this, but the state changes never take away moves, only add to them. But because it is a different state, maybe Ludii regards it as a different move even if the end effect is the same.


RE: Cannot Complete Drop Move - kerios66 - 02-10-2024

(05-27-2023, 02:32 AM)AlexanderBrady Wrote: This game involves a drop move followed by a custodian "capture" (of empty spaces) that changes the state variable of that space.



All of it seems to work, except situation in the attached game trial. If black attempts to move (Move77-D6) (that is, move a base from hand to the space D6) Ludii simply won't process the move. The visual of the base remains stuck in place, but Ludii does not move on to the next move and clicking anywhere on the screen cancels the move.



I think it has to do with the custodial capture after dropping logic, but I can't figure out why it happens in this case but not other cases.

It seems there might be a glitch in the drop move followed by custodian capture logic.                         palworld


RE: Cannot Complete Drop Move - firmsheep - 03-04-2024

(06-02-2023, 02:19 PM)AlexanderBrady Wrote: The space where the player drops their piece on to is marked with a state to allow them to drop there, and that state is removed when the piece is dropped. However, this rule works in most cases. I will list the cases which do and don't work in plain English to see if you can understand where things go wrong.
happy wheels
1) Freely place a piece on a space with a certain state, which causes the state in the target space to change to 0 (no-placement) and the state in adjacent spaces to change to states (1-6) depending on what placements end up being allowed. This works when the state in all adjacent spaces is also 0.
2) Drop a piece from hand to a space with a certain state, changing the state of that space to 0. Then change the states in adjacent spaces to one of the non-zero states (1-6). This works when the state in all adjacent spaces is 0.
3) Freely place a piece on a space with a certain state, which causes the state in the target space to change to 0 (no-placement) and the state in adjacent spaces to change to states (1-6) depending on what placements end up being allowed. This still works when the state of any of the adjacent spaces was non-zero to begin with.
4) Freely place a piece on a space with a certain state, which causes the state in the target space to change to 0 (no-placement) and the state in adjacent spaces to change to states (1-6) depending on what placements end up being allowed. This DOESN'T work when the state of any of the adjacent spaces was non-zero to begin with AND the drop move causes the state in an adjacent space to change.

I'm not sure if Ludii realizes this, but the state changes never take away moves, only add to them. But because it is a different state, maybe Ludii regards it as a different move even if the end effect is the same.

I was having the same problem and found the code that was causing the error. Thank you for your reply with a lot of useful information for me.