Ludii Forum
Piece that fills cell completely with one color? - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Grammar Problems (https://ludii.games/forums/forumdisplay.php?fid=24)
+--- Thread: Piece that fills cell completely with one color? (/showthread.php?tid=155)



Piece that fills cell completely with one color? - AlekErickson - 09-03-2020

On the Inkblots game, I use Balls/Discs as the pieces but these look ugly when the board is very large.
I want to use instead some pieces that are simply painting the occupied cell that player's color.
I tried using Tiles but it never worked. 
I never found a list of options for pieces in the Language Reference, rather they are spread out through all the examples.

On a similar note, I tried to get a third color for a neutral piece, but it always made the neutral piece the same color as either player 1 or 2. So I instead used a Queen, which also looks ugly on the large board. If somebody could help me define a third, neutral color, for the same piece types, it would be really helpful.

When I ask these questions, I always first go through the language reference manual. But it is not always easy for me to understand it, or find the relevant information. In this case, I don't think the information is present, but I might be wrong.


RE: Piece that fills cell completely with one color? - MatthewStephenson - 09-07-2020

Hi Alek,

Yes you are correct that tiles should be used when you want a piece to fill a cell, the syntax for your situation would be:
(tile "Triangle" Each numSides:3)

For coloring the neutral player you need to use graphics metadata, similar to that used for several other games (Feed the Ducks, Press Ups, etc.)
The syntax would be something like:
(graphics {
        (player Colour Neutral (colour Yellow))
    })
And this would need to be added to the metadata section at the end of the game description.

I have attached an updated version of our own inkBlots description in Ludii, hopefully to match your requests.

The language reference manual can certainly be a bit overwhelming. If you are having trouble finding a specific feature, I would suggest seeing if you can see other games on our ludii library webpage (ludii.games/library) that already include this, and then taking a look at their game descriptions to see how they achieve it. For example, we have several tile games (Andantino, Cram, Trax) that could provide assistance on how to use tiles.

Cheers,
Matthew


RE: Piece that fills cell completely with one color? - AlekErickson - 09-07-2020

Hey Matthew, thanks a lot for the help. It makes a huge difference to have the game played with these tiles rather than the balls - it is easier to comprehend the board state this way.

I tried to change the neutral color from Yellow to Red (I also tried to change it from Yellow to Blue).
Neither worked. Even though when I make the change in the text and save it, load the game into Ludii, and check the editor, it shows the correct metadata (a neutral color defined as Red or Blue), but the neutral stone still appears Yellow. Do you know why this might be?


RE: Piece that fills cell completely with one color? - MatthewStephenson - 09-08-2020

Hi Alek,

You may have to open the Preferences dialog (Ludii > Preferences) and click on the button next to "Reset to Defaults".

I will see if I can find a better automatic solution for this issue to include in the next release, but for now this should solve your problem.

Cheers,
Matthew


RE: Piece that fills cell completely with one color? - AlekErickson - 09-09-2020

Thanks, I also found that the Inkblots .lud file you have given me, when I run it on version 1.0.5, it seems that there is no longer a bug related to the pie rule. In fact this .lud works perfectly.

Would it be possible to use this Inkblots.lud to replace the older version of Inkblots, in the next release?


RE: Piece that fills cell completely with one color? - MatthewStephenson - 09-09-2020

Hi,

Yes the inkblots version I sent before should be the new version that will included in the next Ludii release.

I have attached the latest version we have for you to double check if you like.

If you would like the colours of any of the pieces changed let me know and I will update them as well.

Cheers,
Matthew


RE: Piece that fills cell completely with one color? - AlekErickson - 09-10-2020

(09-09-2020, 03:23 PM)MatthewStephenson Wrote: Hi,

Yes the inkblots version I sent before should be the new version that will included in the next Ludii release.

I have attached the latest version we have for you to double check if you like.

If you would like the colours of any of the pieces changed let me know and I will update them as well.

Cheers,
Matthew


Hi, the file you just sent in your most recent reply is somehow not compiling on my 1.0.5 version of Ludii.
However, I have this Inkblots.lud, which is simply the one you sent before that one, with a single change (the color from yellow to blue). I am uploading this one to you because this one seems to be just perfect.


RE: Piece that fills cell completely with one color? - MatthewStephenson - 09-10-2020

Hi,

Thanks.
Yes I forgot that we updated a small bit of the Tile ludeme code, so that you don't have to specify the number of sides for a tile if this is the same as the board.

so (tile "Triangle" Each numSides:3) in the original description becomes just (tile "Triangle" Each) in the new one.

This should all work in the next version of Ludii, so I will make your requested colour change, and then it should work fine in the next release version.

Cheers,
Matthew