Ludii Forum
Problem with a move in Throngs - 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: Problem with a move in Throngs (/showthread.php?tid=470)



Problem with a move in Throngs - dale walton - 02-27-2021

I suspect there is a problem with the remote handling moves that don't change board position:

I an getting this error whenever I log in to my current game.  I should not be getting an error if lvsor had left the move incomplete. so I assume the problem is that the move that completes this turn does not alter the board position, and so was rejected.  -- but maybe it is something else....

Also saw this in the terminal a couple times:
Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException: Vector Enumeration,
and this earlier:
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
And this even earlier...
currentTrialLength: 17
received move was not legal: [[Add:type=Vertex,to=45,what=2,decision=true], [SetVar:name=PowerLeft,value=1], [SetScore:player=2,score=8], [SetNextPlayer:player=2]]
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3 >= 1
at java.base/java.util.Vector.elementAt(Vector.java:497)
or the same with 0 >= 0

Game 641

This means that I am unable to take my turn.  Hope you all can find the problem and fix it.

Compiled Throngs successfully.
received move was not legal: [[Add:type=Vertex,to=45,what=2,decision=true], [SetVar:name=PowerLeft,value=1], [SetScore:player=2,score=8], [SetNextPlayer:player=2]]
currentTrialLength: 17
lvsor_ to move.
-------------------------------------------------
Joined game as player number 1
dale walton to move.
dale walton to move.
lvsor_ to move.
lvsor_ to move.
dale walton to move.
dale walton to move.
dale walton to move.
lvsor_ to move.
lvsor_ to move.
dale walton to move.
dale walton to move.
dale walton to move.
dale walton to move.
dale walton to move.
lvsor_ to move.
lvsor_ to move.
lvsor_ to move.
received move was not legal: [[Add:type=Vertex,to=45,what=2,decision=true], [SetVar:name=PowerLeft,value=1], [SetScore:player=2,score=8], [SetNextPlayer:player=2]]
currentTrialLength: 17
Your local game state is out of sync with the server, please re-join this game from the remote dialog.
Compiled Throngs successfully.
received move was not legal: [[Add:type=Vertex,to=45,what=2,decision=true], [SetVar:name=PowerLeft,value=1], [SetScore:player=2,score=8], [SetNextPlayer:player=2]]
currentTrialLength: 17
lvsor_ to move.
received move was not legal: [[Add:type=Vertex,to=45,what=2,decision=true], [SetVar:name=PowerLeft,value=1], [SetScore:player=2,score=8], [SetNextPlayer:player=2]]
currentTrialLength: 17
...
Repeats continuously


RE: Problem with a move in Throngs - MatthewStephenson - 03-01-2021

Hi,

According to our Database, the last two moves that were made in this game were identical:

[Move:mover=2,from=45,to=45,actions=[Add:type=Vertex,to=45,what=2,decision=true],[SetVar:name=PowerLeft,value=1],[SetScore:player=2,score=8],[SetNextPlayer:player=2]]

I am not familiar with the rules of this game, but I assume this is wrong.

It seems that the database received this move twice, which the game should not have allowed.
I just tried replaying the game myself to the same state and experienced no problems.

What was the last move that lvsor_ remembers making, was it adding the ball to site 45, making the (Propose "StopHere") move, or something else?

Were there any other unusual circumstances around this that you think could be relevant?

I've also manually removed this extra move from the database, so you can continue playing.

Cheers,
Matthew


RE: Problem with a move in Throngs - dale walton - 03-01-2021

I still have the problem, but from what you show as the move, it could either be a bug in that script, or somehow he is playing with a different version that does not use "Stop Here" but selects the same location twice. He has not responded to me on the issue on his side, If he tried using a different version he should have had a hashcode error.... I think script bug is more probable. since you are going to update this to my latest version next release, I'll just wait until then.


RE: Problem with a move in Throngs - dale walton - 08-15-2022

I suggest watching the AI play itself some.

The game is straightforward in concept, but hard to explain. - and hard to implement in Ludii. An earlier version stepped out each move, but that made it tedious to play, and the AI  was totally incompetent.

I'll summarize the rule concept here in hopes it can help.

Each move has a series of actions. What actions can be taken depend on where the move starts, and in particular, depends on the count of friends vs enemies in the locations around the starting location for the turn.  That difference in count gives the number of actions that can be made in the turn.

Turns can start at a friendly piece, an empty location or an enemy piece.
1) At a friendly piece: The piece can move or jump in a straight line to an empty site along a grid direction for a distance up to the number of actions allowed. If it stops before the number is reached, it may change direction and continue, but it may not stop or change direction while crossing over other pieces, only when it has landed on an empty space. It may stop any number of times, and does not need to use all the allowed actions. (Note that when a turn starts at a friendly piece, that piece is included in the piece count that determines the number of actions allowed)

2) At an empty site: One action is taken to add the piece to the board, then the piece may continue to move as in 1) for the remaining actions. (Note that the entering piece itself is not included in calculating the count of allowed actions in this case.)

3) At an Enemy site: Two actions are needed - one action to remove the enemy and one action to enter the friendly piece. Capture is not allowed without entry. (Note that the captured enemy piece is included in the action point calculation for that location.)  Afterwards, the friendly piece may continue to move if it has actions still available, but this is not common.

Note that there is an exception to #2 which allows a piece to be entered onto a fully surrounded empty site if the number of each player's pieces around that site are equal.
I hope this helps.