Sure, I can answer all of those questions, and thanks for the quick responses. For our demo, I honestly think it's working fine, but the programmer seems to think there should be a more efficient way to detect matches. Here is a list of rules I put together for him.
Match 3 Technical Mechanics
Our match-3 system will need to be capable of the following features:
The board must be able to differentiate not only between specific tiles, but also between tile types (Ability, Combat, Structure).
Ability Tiles (Strength, Tech, Skill, Power) should be the most common.
Combat Tiles (Melee and Ranged) should be slightly less common.
Structure Tiles should be the least common.
We should be able to easily tweak the percentage chance of each type of tile. The initial chance should be something like 60%-30%-10%
The board must be able to recognize the following match types and be able to initiate specific behaviors based on match type:
Quantum Particle: These function as "wild card" tiles, meaning they may be matched with any Ability Tile (Strength, Skill, Tech, or Power). They also multiply the result of the match, from x2 to x5.
Quantum Particles count as whatever tile type they are matched with. So a single x3 QP matched with two Skill Tiles would result in nine Skill Points being acquired.
Quantum Particles can result in multiple matches. For example, the arrangement Skill-Skill-Quantum(x2)-Strength-Strength would result in 6 Skill points and 6 Strength points being acquired, as well as being considered a Chain of two.
The board must be able to keep track of how many matches occur from a single move, also known as a chain, and be able to initiate specific behaviors based on the number of chains that occur.
Example: Three Power Tiles are matched, causing a Tech Tile to fall into place adjacent to two other Tech Tiles, forming an additional match. This would be a chain of two matches.
When the board is first generated (or anytime it is reset due to a lack of available matches), it needs to meet the following criteria:
No tiles may be arranged in such a way that they will automatically form a match.
At least one match must be possible.
The board needs to recognize when there are no more available matches. It does not take into account Active or Passive Abilities when determining this. If no more matches are possible, the board is reset (all tiles are destroyed) and all characters take 1 unavoidable damage for every Structure Tile destroyed.
When matching tiles, the board needs to be able to read character stats to determine the effect.
The game needs to look at currently active and passive abilities to determine if any additional effects should take place.
When matching Combat Tiles (Melee, Ranged, and Structure) the board needs to determine who the designated attacker and target are, as well as any active or passive effects that may alter the attack in some way.
The board needs to keep track of all status effects, currently active abilities, and passive abilities and apply those effects as needs. Examples include specific characters regenerating HP each turn, or some characters suffering negative status effects for 3 turns before the effect is removed.
Structure Tiles (which may be matched with Combat Tiles) are handled differently than other tiles, and will need their own behaviors:
Structure tiles may not be moved by the player. The only way the player may move a Structure tile is by moving the tiles under it, thus causing it to fall, or by using certain abilities. Some abilities may allow a player to move Structure tiles.
At least 3 tiles must be matched, though they may be any combination of Attack Tiles and Structure Tile, as long as the type of Attack tile remains consistent. i.e. Melee and Ranged attack tiles may not be combined in the same match; the match must include either all Melee and Structure tiles or all Ranged and Structure tiles.
The only exception to this would be if multiple legal matches were formed for each type of Combat Tile. For instance, the match Melee-Melee-Structure-Ranged-Ranged would result in a successful Melee Match-3 and a successful Ranged Match-3, also counting as a chain of two matches.
If three or more Structure tiles are matched without including Attack tiles, the team that caused the match are all deal one damage per Structure tile matched. For example, Team A matches three Power Tiles, which results in four Structure tiles becoming adjacent and matching. Because of this, every character on Team A is dealt four damage. This damage is reduced by armor and other effects that reduce incoming damage, but ignores effects that avoid attacks.
If the team possesses some ability that allows them to purposefully match Structure Tiles and the Structure Tiles are matched using this method, the results of the match are applied to the enemy team rather than the attacking team.
New: Sometimes a single tile can be counted in multiple matches.
Matches are only counted horizontally or vertically. However, the following arrangement would actually count as two matches: . In this arrangement, the blue tiles would form one horizontal arrangement and one vertical arrangement, with the center tile being counted in both arrangements. Each match would only count as a match-3, but the whole thing would count as a chain of 2 matches.
This can also apply to Structure Tiles, as mentioned above. For example: . In this arrangement, the 3 left tiles would make a Melee Match-3 including the center Structure Tile, and the 3 right tiles would make a Ranged Match-3 including the center Structure Tile.