Ludii Forum
A bug in Lielow - 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: A bug in Lielow (/showthread.php?tid=725)

Pages: 1 2


A bug in Lielow - Michael - 09-27-2021

I'm having trouble identifying the cause of a bug that Alek and Mihaw found in Lielow. 

The game uses localState to mark the kings. Each player's king is graphically marked by a red outline. In the attached trial, white's king (the white piece with a red ring) has made a capture, black moved, and now it is white's turn again. The problem is this: No matter where white moves their king, the red ring disappears. The tooltip also show that the localState is no longer set to 1. Isn't localState supposed to follow the piece when it moves? What is happening here? I don't know how to fix this.


RE: A bug in Lielow - Eric Piette - 10-04-2021

Hi,

I looked quickly and I can see one problem in the code of the action to move a full stack of pieces about keeping the same state/rotation/value for each piece at each level, that's now fixed in our code and will be available in the next release.

However, I see that when you move a "king" piece to an empty site, you are going to add a piece on top of it with a local state of 0. Consequently, the top piece is not a king and move like a normal piece (same for the GUI, you do not see a red circle around it because the graphics metadata you are using is drawing a red circle only if the top piece has a state of 1, but if you comment the line (stackType Count), you will be able to see that the piece under this new piece has still the local state at 1 (in the new code)). So you will probably want to fix that on your description.

Regards,
Eric


RE: A bug in Lielow - Michael - 10-04-2021

Thank you!

The issue with my description, will it be fixed by changing the consequence in ("MoveToEmpty") to
Code:
(then
            (add (to (last To) level:0) stack:True)
        )
That is: Will adding "level:0" make it so that the piece is added to the bottom, instead of to the top of the stack?


RE: A bug in Lielow - Eric Piette - 10-04-2021

Hi,

Yes great, I am adding that too for the next release.

Regards,
Eric


RE: A bug in Lielow - Michael - 10-06-2021

I haven't checked whether the old bug is fixed, because I immediately encountered a new bug. In this trial, the white 3-stack cannot move. I have no idea why..


RE: A bug in Lielow - Michael - 10-06-2021

It seems all stacks become immovable once they get to size 3..


RE: A bug in Lielow - Eric Piette - 10-07-2021

Hi,

The problem was coming from a wrong update of the owned structure in the ActionInsert class (related to the fact that you are adding the new piece at level 0 and not to the top of the stack now). This structure is used by any (forEach Piece ...) ludeme to speed up things, but of course, if the structure is wrong the result moves are also wrong :)
Anyway, I fixed it, that will be in the next release.

Regards,
Eric


RE: A bug in Lielow - Michael - 11-25-2021

I have found yet another bug in Lielow. This one is mine, though. It comes from a misunderstanding of how (and) works. The consequence of the main ludeme inside (play) currently looks like this:

(and
(remove (sites Outer) count:(size Stack at:(last To)))
("UpdateKing")
)

But it needs to be:

(do
(remove (sites Outer) count:(size Stack at:(last To)))
next:("UpdateKing")
)

I mistakenly thought (remove (sites Outer) count:(size Stack at:(last To))) was called before ("UpdateKing") either way.

Can you make this change? I'm afraid my local file is not up to date.

(The forum's formatting options are gone, so I don't know how to make a code block.)


RE: A bug in Lielow - Eric Piette - 11-26-2021

Hi Michael,

Sure I am going to do that update :)

Regards,
Eric


RE: A bug in Lielow - Eric Piette - 11-26-2021

Hi again Michael,

Matthew just told me that the forum formatting should be back now.

Regards,
Eric