Ludii Forum
Can't find a way to select the sites I need - 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: Can't find a way to select the sites I need (/showthread.php?tid=147)



Can't find a way to select the sites I need - dale walton - 08-24-2020

After scores of tries I finally found a way to make the "add" move work correctly for Shaka.

Next step, for scoring and board graphics, I need to be able to select the region of unplaceable sites. However the sites do not get selected to match... and all the alternatives I try keep failing in the same ways that most of my tries at piece addition failed: They only return the cells blocked LOS by the last piece placed, rather than cells blocked LOS by all of one player's pieces.

I think there must be something deep inside the Ludii logic preventing my attempts, is it a bug(s) or if not, how is it supposed to be accomplished?

see attached.

I am guessing you all are currently quiet because there is some major work that needs to get done - don't know if this problem is related.  Hope things get straightened out OK.


RE: Can't find a way to select the sites I need - cambolbro - 08-24-2020

Hi,

You can iterate over all pieces of a type using (forEach Piece "PieceName" ...) then you can apply the LOS test to each (to) site. 

When you're doing a (forEach Piece ...) iteration the (to) refers to the current piece being iterated over.

Regards,
Cameron


Not resolved in 1.0.4 RE: Can't find a way to select the sites I need - dale walton - 08-24-2020

I'm not sure why I need Piece name, since I tried that approach using  the player: (forEach Piece <moves> Mover)

At this point I need an example to understand what you mean specific to this case.



For example


(sites To
    (forEach Piece "Ball"
      (move
        (from (sites Occupied by:Mover))
        (to (sites LineOfSight Empty))
      )
    Mover
    )
  )




Is only picking up the sites for the last ball placed, not for all of them.

Update: Still not working in 1.0.4
Also if I change the role to Next it still uses the last ball placed, not the next player's ball(s)


RE: Can't find a way to select the sites I need - Eric Piette - 09-06-2020

Hi,

Can you remind me what you try to do here? I am not sure in reading the previous posts.

Regards,
Eric Piette


RE: Can't find a way to select the sites I need - dale walton - 09-06-2020

This has been resolved in a later thread - thanks.  Your corrections to my earlier program show how to select the unplaceable sites.

How can I shade the areas of the board which are currently unplaceable for the next player, to help inform the choices for the current player?


RE: Can't find a way to select the sites I need - MatthewStephenson - 09-07-2020

Hi Dale,

It is currently not possible to update the graphics of the game board between moves, the closest we have for what you desire is the "Show Legal Moves" option under the "View" menu heading. This will place blue/red dots on the sites that the player can make moves on.

Cheers,
Matthew


RE: Can't find a way to select the sites I need - dale walton - 09-07-2020

Ah well. I won't try any work-around, as it would put an enormous load on the AIs to calculate that many extraneous moves for every iteration.

As a play aid feature it would be good to shade cells in a low key way (eg transparent discs) for the opponent's currently possible moves, as an independent option from show moves. Don't know how much demand there would be for such a thing.

Case closed.