NightFrost
Member
So I've been building generic match three mechanism for some days now, and it got me thinking... does anyone know if someone has done the maths on these? How many different kinds of objects can the field have (jewels, candies, whathaveyou) before it is possible for the game state to devolve into a no-win pattern where there are no valid moves left? Obviously with just two types, there's only one possible initial pattern (a chessboard) and all moves except corners generate a match ad infinitum. I can see the size of the board affecting how quickly a no-win pattern is reached. And if player is allowed to move the object as far as they please instead of just a single grid cell, it should significantly reduce the chances. Basically, I'm wanting to avoid a situation where I have to write code that can verify the board is in unwinnable state... but I may have to.
As an aside, I went with a design decision where player is able to freely drag an element around with mouse, but I've now realized it causes the most work. In a system where player would simply tell the element to switch places, the flow could be broken into discrete phases following each other; issue command - animate move - check matches - either destroy elements and award score, or push elements back to original positions. With free dragging the match checking phase starts as soon as player releases the mouse button, which might happen in the middle of elements animating to their positions. They need to snap to their destinations and get destoyed if there is a match, or reverse their motion back to their origins otherwise. Or to put it in short... if you're doing a match-three system, you may want to avoid having a free drag control.
As an aside, I went with a design decision where player is able to freely drag an element around with mouse, but I've now realized it causes the most work. In a system where player would simply tell the element to switch places, the flow could be broken into discrete phases following each other; issue command - animate move - check matches - either destroy elements and award score, or push elements back to original positions. With free dragging the match checking phase starts as soon as player releases the mouse button, which might happen in the middle of elements animating to their positions. They need to snap to their destinations and get destoyed if there is a match, or reverse their motion back to their origins otherwise. Or to put it in short... if you're doing a match-three system, you may want to avoid having a free drag control.