Ludii Forum
pass Dialog - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Ludii Player Problems (https://ludii.games/forums/forumdisplay.php?fid=6)
+--- Thread: pass Dialog (/showthread.php?tid=343)



pass Dialog - slimy_asparagus - 12-19-2020

I attach a really boring game that I have developed. I developed it to illustrate something I had observed in games where you can chain hops (like in draughts) but where moves are not forced (unlike in Draughts). In these games as soon as you hop you are offered a pass, which is obviously necessary in at least some cases. However then a dialog comes up and as far as I can tell this is a completely pointless dialog which changes absolutely nothing in the game. Here is an illustration.


RE: pass Dialog - dale walton - 12-20-2020

Your logic could have a problem since "SameTurn" doesn't seem to be defined.

If that means that all cases are considered true, since there is no (last To) on the first move, then maybe each piece is a separate possible move, and there would be a separate pass possible for each of them according to the logic.


RE: pass Dialog - slimy_asparagus - 12-20-2020

(12-20-2020, 03:26 AM)dale walton Wrote: Your logic could have a problem since "SameTurn" doesn't seem to be defined.

If that means that all cases are considered true, since there is no (last To) on the first move, then maybe each piece is a separate possible move, and there would be a separate pass possible for each of them according to the logic.

"SameTurn" has a built in definition as per appendix B in the reference document. I do have some questions about those but I can never quite bring myself to ask them.


RE: pass Dialog - dale walton - 12-21-2020

Maybe the script needs to invoke the built-in definitions? It is short, why not include it in the script file or avoid the substitution entirely?
Just saying, because it looks like the first branch of the "if" is being invoked for every piece, as I previously mentioned.


RE: pass Dialog - slimy_asparagus - 12-21-2020

(12-21-2020, 01:14 AM)dale walton Wrote: Maybe the script needs to invoke the built-in definitions?


I was just following the example of games like "Coyote".

If you're going to focus on these built-in ludemplexes, then I have to ask why so many of them use "step" rather than "move Step"? How do they get away with that. Maybe I should be using "step" rather than "move Step" in my code for decision level moves.

Still all of this of this is distracting from what I came here to do. I wanted to ask the good people at Ludii why is there this annoying pass dialogue and how can I avoid it.


RE: pass Dialog - dale walton - 12-22-2020

(12-21-2020, 08:20 AM)slimy_asparagus Wrote:
(12-21-2020, 01:14 AM)dale walton Wrote: Maybe the script needs to invoke the built-in definitions?


I was just following the example of games like "Coyote".

If you're going to focus on these built-in ludemplexes, then I have to ask why so many of them use "step" rather than "move Step"? How do they get away with that. Maybe I should be using "step" rather than "move Step" in my code for decision level moves.

Still all of this of this is distracting from what I came here to do. I wanted to ask the good people at Ludii why is there this annoying pass dialogue and how can I avoid it.
Sorry to get in the way of the Ludii people answering why Ludii has to do this, and getting sidelined into discussion of defines... My point was that if you put the (move Pass) into the definition of the move for each piece, then the system is generating a pass option for each piece (and not just the one at (last To), since that constraint is only on the hop).  If you move the (move Pass) into the play of the game, then you won't get the choice coming up.  See my attached modification to your file.

The general question you pose of why each piece should ever have its own pass option should still be answered by the Ludii staff...


RE: pass Dialog - slimy_asparagus - 12-22-2020

For what it's worth, that seems to have worked as far as it goes. But it looks to have introduced some bugs into at least one game.

Update: The bugs are not related to Dale Walton's suggestion. I just had not noticed them before.


RE: pass Dialog - Eric Piette - 01-04-2021

Hi,

I looked the original .lud and Dale was right, the reason is because the (move Pass) was in a piece movement.
Consequently when you call (forEach Piece) the move (move Pass) is called for each piece, each time "SameTurn" is true.

The revised version seems fine.

Regards,
Eric


RE: pass Dialog - dale walton - 01-05-2021

Hi Eric.

That makes sense by programmer logic, but by game player logic I can't think of a case where a pass decision would produce an effect specific to a single piece, but the ability to choose a pass might be. Should duplicate passes be automatically reduced to a single user choice option, or would that make debugging too difficult if it were an allowed practice to place the pass move in the piece move definitions?


RE: pass Dialog - Eric Piette - 01-05-2021

Hi,

That's allowed to put the pass or anything you want in the move generator of a piece type. But of course if you have many pieces of that type and you call the (forEach Piece ...) ludeme all the moves in it will be duplicated.
The description of Ludii is the closest possible of a Game logic point of view but that's stay a language interpreted by a compiler. Consequently, that's up to the game designer to be sure of his description to avoid such cases.

Regards,
Eric