Ludii Forum
Compass directions on boards from custom graphs - 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: Compass directions on boards from custom graphs (/showthread.php?tid=318)



Compass directions on boards from custom graphs - xenos1984 - 12-06-2020

This question is related to my attempt on implementing classic board games on boards with non-trivial topologies.

When I define a (board (square ...)) or (board (rectangle ...)), I see that I get faces and compass directions, orthogonal and diagonal directions, opposite directions etc. automatically. So for example, to implement chess, I can easily tell a rook or bishop how to move. So far, so good.

If I implement a custom board, either by building up a graph from scratch, or by adding edges to an existing graph (such as closing a square to form a cylinder), is there any possibility to manually assign a direction to new edges? For example, on a chess board, when I connect the sites H1 and A1 to each other, can I somehow implement that A1 is East of H1 and H1 is West of A1? The same also with diagonals, like H1 to A2 pointing Northeast. In addition, would such a diagonal edge be recognized as continuing straight on B3, C4, etc.?

From as far as I have understood the board construction algorithm (please correct me if I'm getting it wrong), I could not see such a possibility. It seems that Ludii assigns (Euclidean) coordinates to each site and calculates compass directions automatically from the relative coordinate values. So if A1, B1, ..., H1 is walking East, then A1 cannot possibly be East of H1 in Euclidean space.


RE: Compass directions on boards from custom graphs - cambolbro - 12-07-2020

Hi,

Yes the direction for each step between adjacent elements is calculated automatically.

With your A1 => B1 => ... H1 => A1 example, are you trying to achieve a wraparound board such as a cylindrical board? We will support such wraparound boards, as well as projective boards (e.g. Projex) through modifiers in the tiling. 

You'll see them unwrapped (flat) in the interface. Not sure yet how to show the wraparound connections visually :)

I hope to have this done within the next few weeks.

Regards,
Cameron


RE: Compass directions on boards from custom graphs - xenos1984 - 12-07-2020

Thanks, Cameron, that is indeed very helpful.
(12-07-2020, 09:14 AM)cambolbro Wrote: With your A1 => B1 => ... H1 => A1 example, are you trying to achieve a wraparound board such as a cylindrical board?
Yes, that's exactly what I try to achieve.
(12-07-2020, 09:14 AM)cambolbro Wrote: We will support such wraparound boards, as well as projective boards (e.g. Projex) through modifiers in the tiling. 
Oh, great, that's an interesting approach. So if I understand correctly, essentially the board would still be realized as a (possibly infinite) tiling of Euclidean space, but then you "divide out" certain group actions on that space (translations, possibly combined with rotations or reflections?) to identify cells with each other and get the wraparound. That would indeed create the topologies I was thinking about (and even a few more which I have not yet considered).
(12-07-2020, 09:14 AM)cambolbro Wrote: You'll see them unwrapped (flat) in the interface. Not sure yet how to show the wraparound connections visually :)
Actually the visualization is less of a concern for me at this stage, and my main focus is on the game logic, i.e., implementing the game rules on a wraparound board graph. But based on the implementation via tiling, I do have some ideas in mind:
  • On those sides of the board which are wrapped (such as left and right for a cylinder), one could have outgoing / incoming little arrows, possibly colored or indexed somehow, that should convey the meaning "the board continues here from this outgoing arrow towards the incoming arrow with the same color / index". I guess that's the easiest. (That's more or less how I implemented it Zillions, which has 2D flat boards only, but with a custom bitmap background image).
  • One could show more than one copy of the board, and move pieces simultaneously on all copies. So the view would be a bit like standing in a mirror cabinet, where you see yourself multiple times in the mirrors.
  • If one shows just one copy, one could have a "shift view" command, which shifts the whole board by one unit in some direction, and all cells which are shifted out on one side are shifted in on the other. So for example, for a cylindrical chess board, turning by one unit could shift out all H cells, making the G cells the rightmost shown cells, while the H cells appear next to A on the left, with the whole board shifted to the right by one unit.
But as mentioned, these are just random ideas for now.
(12-07-2020, 09:14 AM)cambolbro Wrote: I hope to have this done within the next few weeks.
That would be awesome!


RE: Compass directions on boards from custom graphs - xenos1984 - 01-16-2021

Hi again,

the idea to create wraparound boards from tilings of the plane, by dividing out certain groups acting on the pattern, really caught my interest. I played around a bit, drawing sketches with pen and paper, and figured out that one can very easily put a board on a cube or projected cube this way:

http://manuelhohmann.ddns.net/mhohmann/Download/Pub/schach/vrml/V1/Cube.html

Also some of the three-player variants can be constructed, but only the once which have boundaries:

http://manuelhohmann.ddns.net/mhohmann/Download/Pub/schach/vrml/V1/TriCyl.html

But there is a problem for these ones:

http://manuelhohmann.ddns.net/mhohmann/Download/Pub/schach/vrml/V1/TriTorus.html
http://manuelhohmann.ddns.net/mhohmann/Download/Pub/schach/vrml/V1/TriKlein.html

The reason is that one can obtain only particular orbifolds from this construction, and their genus is fixed:

http://xahlee.info/Wallpaper_dir/c5_17WallpaperGroups.html

Cameron, I also read your slides on general board geometry from the QMUL seminar, which are really instructive and explain very well how boards are implemented. I really like the approach.


RE: Compass directions on boards from custom graphs - cambolbro - 01-19-2021

Hi,

Interesting!


Quote:put a board on a cube or projected cube

Are you literally thinking about games on a cube, like a representation of a physical object, or would that pattern be repeated to create a more complex game board that is more theoretical?

If you can suggest additional graph operators that might be useful for such transformations, please suggest them.

By the way, I tried the subdivided Rhombile board (as shown in the first URL you mention) and got the following: rhombile-2.png 


Code:
(board (subdivide (subdivide (dual (tiling T3636 3)))))

Not quite the same, and not a playable game board, but pretty :)

I haven't got around to implementing the projective boards yet -- other demands of the project have taken precedence -- but they are high on the list of features to add so should be done soon.

Regards,
Cameron


RE: Compass directions on boards from custom graphs - xenos1984 - 01-19-2021

Quote:Are you literally thinking about games on a cube, like a representation of a physical object, or would that pattern be repeated to create a more complex game board that is more theoretical?

The original idea is indeed to have games on a cube (or some other non-Euclidean space). In fact, for the cylinder I even made myself a physical chess board - I already had a small travelers' chess board with magnetic pieces, so I just wrapped a checkered paper around a tin can. It actually worked.

Now looking at the infinitely repeated patterns, from a mathematical point of view the same board game in which, e.g., a pawn is on some particular site on the cube, can equivalently be represented by an infinite pattern of unwrapped cubes on the plane, where an infinite number of pawns is on the plane, with exactly one pawn on each site which corresponds to the original site on the cube, provided that all these pawn move simultaneously.

So in other words, the number of playable sites is in any case finite. The infinite pattern is just a visualization, which shows an infinite number of copies of each site.

Quote:If you can suggest additional graph operators that might be useful for such transformations, please suggest them.

I'll think about it! For the cube / rhombile, something like the quadhex board would probably be useful. It's a bit different, because the hexagon is cut differently into thirds. I'm still struggling with the directions, even with the "ordinary" quadhex board without wrapping, but for that I shall come up with its own thread, as it's an independent problem.

Quote:By the way, I tried the subdivided Rhombile board (as shown in the first URL you mention) and got the following: rhombile-2.png 


Code:
(board (subdivide (subdivide (dual (tiling T3636 3)))))

Not quite the same, and not a playable game board, but pretty :)

Awesome! I wouldn't call it unplayable. I could imagine some variant of Morris or Chinese checkers to be played on the vertices...

Quote:I haven't got around to implementing the projective boards yet -- other demands of the project have taken precedence -- but they are high on the list of features to add so should be done soon.

I had a look at the Projex board. I really like the idea, also because of the topology involved from which follows that exactly one player has a loop that wraps around the doubly connected space. Still I think that the board can be slightly improved, to remove the "irregular" spots where cells appear twice as neighbors (such as the a,f,j,o,s,x). I'll try to come up with a sketch of what I have in mind.

The idea I had does not actually work with hexagonal boards...