Ludii Forum
Closer - 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: Closer (/showthread.php?tid=66)



Closer - dale walton - 05-30-2020

I have a game in which pieces must move closer to the opponent's pieces when they move.

They move from a position possibly with enemy pieces at various distances away along any/all the different directions, to a new location with various of its own distances to enemy pieces along all the different directions.  The restriction is that the closest distance at the destination must be closer than the closest distance at the origin, or if they are equal, the next closer distances are compared, up to all available distances, and if all are equal that can be matched, then the from location must run out of enemies to compare before the destination does.

I have been trying to figure out how write this, but I can't seen to find a way to do so - any recommendations for an approach to take?

Having a Line-of-sight function, or (targeted < to | from > (piece role) Direction if (between* is Empty)) function, and or a between* with a ((to | from) (site)) context instead of just (to from) context
might be part of the answer?  Or maybe some way to use canmove ?

Or stacking states or dummy players pieces on sites, or ??

Or probably a simple way I am just missing.


RE: Closer - cambolbro - 05-30-2020

Hi,

It might be possible to do this with the current ludemes but I think it would be very laborious.

A better solution would be to have a ludeme that returns the distance of the closest piece of a specified owner or type in each direction, possibly in LoS, then have a function that returns the minimum value.

This sounds useful, we'll look into adding it.

Regards,
Cameron


RE: Closer - dale walton - 05-30-2020

Thanks, I'll look forward to it.
Meanwhile, I'll try working on a simpler game to implement.
Br.
Dale