New (?) feature -- shuffling a 2D array
Posted: 11 Feb 2008, 14:18
I don't know whether ZunTzu can already do this or not, but I haven't been able to figure it out yet so I'm assuming it can't -- please let me know if I'm wrong!
In some games (especially Euros), the board is made up with a grid of tiles (the most famous example is Settlers of Catan, but others include Lowenherz/Domaine, Tempus, and Attika). These are randomly placed at the start of the game, and therefore, the arrangement of tiles is different each time the game is played. To achieve this effect in Zun Tzu as it currently exists, you would have to place the tiles into a stack, shuffle them, and then manually place them into a grid arrangement. This is of course more or less how this is done in real life, and is not terribly tedious.
But, it would be really neat if you could instead place all the tiles in the arrangement you want them to have, and then "shuffle them in place", so that the tiles are rearranged but the overall pattern of tiles remains the same. (Probably, this would go hand-in-hand with "shift-clicking" to be able to select multiple objects simultaneously, which would also be a neat feature, by the way).
This might also be useful for a wargame in which the different territories have some property that is given by a randomly placed counter or chit.
I have no idea whether this would be easy or hard to implement, but I imagine it might work something like this:
-- Having selected the group of tiles, ZunTzu would know (a) which tiles are included in the arrangement and (b) a list of the all coordinates at which a tile should be placed.
-- Treat the selected tiles as a "virtual" stack, and shuffle them using the ordinary shuffling algorithm
-- Go down the list of coordinates and at each, place a tile from the "virtual" tile stack
This would give a nice way to expedite setup of games that include some sort of spatially randomized element.
-Jeff
In some games (especially Euros), the board is made up with a grid of tiles (the most famous example is Settlers of Catan, but others include Lowenherz/Domaine, Tempus, and Attika). These are randomly placed at the start of the game, and therefore, the arrangement of tiles is different each time the game is played. To achieve this effect in Zun Tzu as it currently exists, you would have to place the tiles into a stack, shuffle them, and then manually place them into a grid arrangement. This is of course more or less how this is done in real life, and is not terribly tedious.
But, it would be really neat if you could instead place all the tiles in the arrangement you want them to have, and then "shuffle them in place", so that the tiles are rearranged but the overall pattern of tiles remains the same. (Probably, this would go hand-in-hand with "shift-clicking" to be able to select multiple objects simultaneously, which would also be a neat feature, by the way).
This might also be useful for a wargame in which the different territories have some property that is given by a randomly placed counter or chit.
I have no idea whether this would be easy or hard to implement, but I imagine it might work something like this:
-- Having selected the group of tiles, ZunTzu would know (a) which tiles are included in the arrangement and (b) a list of the all coordinates at which a tile should be placed.
-- Treat the selected tiles as a "virtual" stack, and shuffle them using the ordinary shuffling algorithm
-- Go down the list of coordinates and at each, place a tile from the "virtual" tile stack
This would give a nice way to expedite setup of games that include some sort of spatially randomized element.
-Jeff