I have been working on the cascading mechanics for my match 3 game and have settled on a standard linear drop as opposed to a delayed, EASING_INQUAD drop. Anyway, my issue is finding a balanced spawn system that does not generate so many of a single color instance. (Video attached)
My hope is there is a Match 3 pro among us that can assist a lowly dev. Right now I use a standard math.random()call. I googled and got an idea to use a buffered approach.
This would be a linear (or 2D) buffer of randomized tiles that are then run thru a Fisher-Yates shuffle and then each spawner plucks from the list upon request. The issue with this approach is my game has multiple spawners and some will use different spawned object list. I suppose I would have to create multiple list.
for example:
spawners =
{
{
id = 0,
{ spawn = "BLUE", probability = 1, board_max = 0, spawn_max = 0 },
{ spawn = "GREEN", probability = 1, board_max = 0, spawn_max = 0 },
{ spawn = "YELLOW", probability = 1, board_max = 0, spawn_max = 0 },
{ spawn = "RED", probability = 1, board_max = 0, spawn_max = 0 }
},
{
id = 1,
{ spawn = "COIN", probability = 4, board_max = 0, spawn_max = 0 },
{ spawn = "BLUE", probability = 1, board_max = 0, spawn_max = 0 },
{ spawn = "RED", probability = 1, board_max = 0, spawn_max = 0 }
}
}
Thanks for listening. Any advice would be greatly appreciated.