Ludii Forum
Sparseness of Documentation - 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: Sparseness of Documentation (/showthread.php?tid=266)



Sparseness of Documentation - slimy_asparagus - 11-19-2020

Often when I read the language reference I am really left none the wiser. For example:


mapEntry
The most informative information I can find is: "Maps are used to stored mappings from one set of numbers to another." But what are maps? I don't know. Are there a fixed number of maps? Can I create my own maps? Looking at the chess .lud file, I think can use this to find the location of a particular piece, but I am not sure.

value
So I can work out that I can set an initial value for a piece's value when it is defined. I can retrieve the value using the value function. Does the "flips" concept relate to this value or not? Can I set the value mid game? Does the value have any other game effects or is it just  a number? For example does the value effect AI play? Most relevant to me, is there a use of "sites" that would allow me to find the location of any piece of a certain value. (I am guessing "no" for the last one, but it would be neat.)

Okay I found this in the Game Logic Guide: "The value parameter is used to assign each piece a specific value which can be used for different purposes during the game such as the strength or the ranking of the piece." I think this gives the answers: no, yes, just a number, no.

For the last one may be I could do

Code:
(all Sites (sites Occupied by:Mover top:false) if:(= 2 (value Piece at:(site))))

Would this be at least a plausible thing to do? If so how would this handle a stack of pieces with different values and owners?

Pending
I have a vague sense that Pending is used to set a game state for a site that only lasts for until the next move. This is not as far as I can see stated clearly. (I deduce this from its use in definition of En Passant.)


RE: Sparseness of Documentation - Eric Piette - 11-20-2020

Hi,

I advice you to look also the Ludii Game Logic Game (LGLG) available in the download page given more explanation about the logic for designer. The Language Reference (LR) is a document generated automatically from the documentation in the code corresponding to each ludeme in Java contrary to the Lugii Game Logic Game written by us and completed according to the comments of the users and at each release.

Concerning your questions:
- A map is a part of the equipment, the syntax to define some is in the two documents. In mathematics, a mapping is an operation that associates each element of a given set (the domain) with one or more elements of a second set (the range). In Ludii, it is used to associate 2 integers. So yes you can create your own maps in the equipment.

- The flips are also explained in the LGLG document, I leave you looking at it, but they have no link with the value of a piece.
For the value you already find some answers but not the last one.
To find pieces of a specific value, you can iterate all the sites occupied by a certain player with a (forEach ...) ludeme with a condition in it to get only the pieces with a certain value.
Something like
(forEach (sites Occupied by:Mover) if:(= (value Piece of:(what at:(site))) 4))
Will give you all the sites occupied by the mover with a piece value of 4.

If you have a stack, that's more complex and you can not return a specific site (because you have many pieces on it). So just depend what you want to do with it.

For the pending, that's exactly that. But yes I have to add a short explanation in the LGLG, that will be done.

I really advice you to ask one question in each forum message for us to be able to answer to it more easily.

Regards,
Eric