Ludii Forum
Confused about state - 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: Confused about state (/showthread.php?tid=301)

Pages: 1 2


Confused about state - slimy_asparagus - 11-28-2020

If you do the following:

1. set a certain state S at a particular site that happens to contain a piece P.
2. Move the piece P

which site has the state S? Is it the old site or the new one? From the language in the documents I would say it was the old site. However if it was the new site, a lot of stuff about Ludii that seems odd to me would suddenly make sense.


RE: Confused about state - Eric Piette - 11-28-2020

Hi,

Like all the data of a site when a piece is on it and the piece is moved to another site, all the data of that site move with it (what, who, state, rotation, hidden info, count, etc...).

So the that will be the new site for your question.

Regards,
Eric


RE: Confused about state - slimy_asparagus - 11-28-2020

(11-28-2020, 05:16 PM)EricĀ Piette Wrote: Hi,

Like all the data of a site when a piece is on it and the piece is moved to another site, all the data of that site move with it (what, who, state, rotation, hidden info, count, etc...).

So the that will be the new site for your question.

Regards,
Eric
Thanks Eric. That is a revelation. Is this in the documentation anywhere? I don't recall it.


RE: Confused about state - Eric Piette - 11-28-2020

Hi,

That's probably implicit in the documentation when these data are described because they are all related to the piece placed on that site.
I will clarify that point in the documentation next week.

Regards,
Eric


RE: Confused about state - cambolbro - 11-28-2020

Hi,

In other words, the state information (what, who, state, rotation, hidden, count, etc...) is conceptually associated with the piece (not the site!) and moves with the piece.

The fact that this info is actually stored at the site is just an implementation detail; the pieces themselves are just ids stored at each site, and this extra piece state info just uses that same mechanism.

Regards,
Cameron


RE: Confused about state - slimy_asparagus - 11-28-2020

(11-28-2020, 05:27 PM)cambolbro Wrote: In other words, the state information (what, who, state, rotation, hidden, count, etc...) is conceptually associated with the piece (not the site!) and moves with the piece.
On page 222 of the language reference it literally says:


Quote:Thisludeme is used for games with local state values associated with sites.
How is someone supposed to know it is associated with the piece, when you say it is associated with the site?


RE: Confused about state - Eric Piette - 11-28-2020

Hi,

They are associated with the sites, so that's technically correct. But are related to the pieces on them which explained that these data follow the pieces movements.

Like I said before in my last message, I will clarify that next week. I understand your confusion there.

Regards,
Eric


RE: Confused about state - slimy_asparagus - 11-30-2020

It's looking to me as if the state is not conserved if a piece is moved after all. I include a test file. Whichever piece you move the piece on the board ends up being "Diagonal".


RE: Confused about state - Eric Piette - 12-01-2020

Hi,

That's the same issue of (place Stack .... state:...) I fixed yesterday in your previous post but this time for the movement of pieces in a stack.
The local state and the rotation were not implemented for stacks, consequently they are not taking in account in the code, I am going to fix that for that case.

Regards,
Eric


RE: Confused about state - slimy_asparagus - 12-01-2020

(12-01-2020, 07:29 AM)EricĀ Piette Wrote: Hi,

That's the same issue of (place Stack .... state:...) I fixed yesterday in your previous post but this time for the movement of pieces in a stack.
The local state and the rotation were not implemented for stacks, consequently they are not taking in account in the code, I am going to fix that for that case.

Regards,
Eric


I don't think this is to do with Stacks. It turns out I missed a few bits that that could be removed whilst still leaving buggy behaviour. Stacking is one of them. My guess would be that it has something to do with moving from one container to another. I include the simplified test file I hinted at.