Ludii Forum
Please explain how noRepeat works - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13)
+--- Forum: About the Ludii Grammar (https://ludii.games/forums/forumdisplay.php?fid=15)
+--- Thread: Please explain how noRepeat works (/showthread.php?tid=201)



Please explain how noRepeat works - dale walton - 10-09-2020

I am trying to implement a game in which, if a player is forced (priority move) to move into a situational repeat, they are given an extra turn.
In this game, situational repeats are not allowed at all for a non-priority move.

I would like to know how and when the situational noRepeat is tested and functions, and whether there is a boolean that can test for a situational repeat position instead of relying on the mode.

For example if in a situational NoRepeat, I test for (no Moves Mover) and then supply a move, in theory this branch will never be selected, because it supplies a move (self-referentially, then the condition is always false)

Perhaps the game could be modified to use a noRepeat Infinite rule, if this prevents the player setting up the forced move, as opposed to merely preventing the moving player from fulfilling the priority, and instead dropping back to the non-priority.  Which way does it currently work?

That is I would need (priority...<moves>) to take precedence over infinite Repete mode, not infinite repeate mode to take precedence over (priority...<moves>)

However, a boolean (is Situational Repeat) would give more versatile control for this...


RE: Please explain how noRepeat works - Eric Piette - 10-09-2020

Hi Dale,

The current meta rule for (no Repeat) is a kind of filter removing from the legal moves all the moves which can enter in a state already meet before. So that's really a meta rule and you have no way to use it differently.

But yes we plan to add another booleanFunction to check if the current state is already meet before with some parameters such as looking only a specific number of turns before and if we want to check a Situational or Positional repetition.

I will notify you when I will add that to our dev version (and consequently to our next release).

Regards,
Eric


RE: Please explain how noRepeat works - dale walton - 10-11-2020

I could probably find a work-around if I knew the exact meaning of "state already met before" eg
Does it include the value of proposed/vote?
Does it include counts and states at sites, or for values or counts assigned to players? Does it act at 1) the beginning or 2) end of a) a move or b) a turn?
If Situational, does it care about anything in the last turn other than who moved last?
Is the end condition immediately invoked, or are actions taken in between?


RE: Please explain how noRepeat works - Eric Piette - 10-12-2020

The state of a game is the set of all the values instantiated to all the variables modelling the game currently (the positions of all the pieces, the data about players, etc...).

So yes it includes the value of proposed/vote. And any other variables you can think of.
However when we detect the repeating state, we can parameterize it with option such as Positional or Situational.
Positional considers only the state variables of the positions of the pieces contrary to Situational which considers all the variables such as proposed and vote.
We have also some parameters to look only the states meet during this turn.

But currently as a meta rule, but in a future release in the BooleanFunction (is Repeat ...) too.

Regards,
Eric


RE: Please explain how noRepeat works - dale walton - 10-14-2020

In another game, I have a rule that a move is not legal if it allows the other player to create a repeat position on the next turn (this rule is ignored for the hypothetical mover so as not to be self-referential)

I thought I could save the state and test the few moves opponent that could reverse the situation, both with and without avoiding the stored state and do a count to see if it came out differently. But even this workaround didn't work, presumably because (do... is only for non-decision moves ... And maybe because there could be limitations on how/where remember state can be used.

Do you see any way forward?


RE: Please explain how noRepeat works - Eric Piette - 10-14-2020

With the new ludeme (is Repeat ...) and a (do ... ifAfterwards:(is Repeat ...)) you should be able to do what you want.

Regards,
Eric