Ludii Forum
Would like a native way to make LineOfSight Groups - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Ludii Features / Services (https://ludii.games/forums/forumdisplay.php?fid=11)
+--- Thread: Would like a native way to make LineOfSight Groups (/showthread.php?tid=1563)



Would like a native way to make LineOfSight Groups - dale walton - 05-07-2023

I recently have been working on implementing another inventor's game based on LOS groups, and found a way to do this procedurally with (while) and marking processed pieces with states. but Ludii is both slow and difficult to script correctly using procedural approaches.

I would suggest having a way to find LOS groups, - or of counting Hops which is more generalized than counting steps perhaps. Or adding a new kind of (step LoS <siteType> (to) toPiece:<True = LoS Piece; False=LoS Farthest>) because hops are not normally variable distance.

eg does some think like the below work

...
  Group
  if:(and
       (is In (to) (sites LineOfSight Piece at:(from)))
   (= (who at:(to)) (who at:(from)))
  )
would this work recursively???

----------------------------------
Or Distance measured in Hops instead of steps 
  Group
  if:(and
       (is In (to)
    (sites Distance Hop // new parameter
     (hop
      (between (min 0))

      (to
       if:(and
        (is In (to) (sites LineOfSight Piece)
        (= (who at:(to)) (who at:(from)))
      ))
     )
     (min 0)
  )))

 (count Hops ... new parameter
---------------------------

 (sites  // or count, etc...
  Group
  at:<int> | from:<region>

  if:(and
   (is In (to)
    (sites Distance Step
     (step LoS (to if:(= (who at:(to)) (who at:(from))) toPiece:True)  // new LoS keyword and toPiece parameter
     (min 0)
 ))))
 
I think the new (step) method may be the best.


RE: Would like a native way to make LineOfSight Groups - dale walton - 05-07-2023

BTW I am attaching here a progress version of the LOS game I was working on that inspired this request. I spent about 30 hours of doging bugs untill I found a feasible way of defining life for this and got it to work correctly procedurally.  A LoS group definition to efficiently select a LoS group at a given location would have made this trivially easy to implement.