Skip to main content

Cluster Pays

Pays clusters of adjacent matching symbols instead of paylines. A maths node that also compiles to the RGS, so the editor preview and the server pay the same for the same grid.

Wire Reels from Weighted Reels reels (columns of rows, reels[col][row], 1-based symbol ids, 0 = blank), Paytable from Get Paytable paytable ({ symbol: { size: multiplier } }) and Bet Amount from the bet in minor units. Fire Do once the spin has landed: the node reads the wires as they stand, evaluates and fires Done. It is stateless and needs no seeds.

A cluster is a group of at least Min Cluster Size cells showing one symbol, connected by Adjacency: orthogonal joins the four edge neighbours, diagonal the eight. A minimum below 2 is raised to 2. Wild Symbol cells (0 = none) join any cluster they touch and may belong to several clusters at once; they count toward the size while Wilds Count Toward Size is on. Blank cells and lone wilds never start a cluster.

Each cluster pays the largest paytable key at or below its size, times the whole bet rather than the bet per line, rounded to minor units. A cluster whose symbol has no key at or below its size is dropped: it is not paid, counted or listed. clusters entries are { symbol, size, cells, wilds, positions, multiplier, payout } with positions as [row, col] pairs sorted row first; winningLinesDetails repeats each cluster in the Calculate Winnings shape { line, symbols, positions, payout }, ready for Directional Cascade to remove the paid cells.

On an empty or ragged grid the node logs the error, writes it to inspect data, empties every output and still fires Done. hasWin is a boolean, not a signal: branch on it with Condition, and add clusterWinnings to the round win before the next pass. The same core runs on the server, so a deployed component pays exactly what the preview showed.

Inputs​

Parameters​

DataDescription
Reels (array)The landed grid, columns of rows (reels[col][row]), 1-based symbol ids, 0 = blank. Wire Weighted Reels reels.
Min Cluster Size (number)Smallest cluster that pays, in cells. Values below 2 are raised to 2. Default 5.
Wild Symbol (number)Symbol id that joins any cluster it touches; 0 = no wild. Default 0.
Paytable (object){ symbol: { size: multiplier } } from Get Paytable paytable; the largest size key at or below the cluster size pays.
Bet Amount (number)Bet in minor units; each cluster pays bet times multiplier. Default 100.
Adjacency (enum)How cells connect: edge neighbours only, or diagonals too. Default orthogonal. Options: orthogonal, diagonal.
Wilds Count Toward Size (boolean)When on, wild cells count toward the cluster size; when off, only the symbol's own cells count. Default on.

Actions​

SignalDescription
DoRuns the node.

Outputs​

Events​

SignalDescription
DoneFires when the node has finished, on success and failure alike.

Results​

DataDescription
Clusters (array)Every paying cluster as { symbol, size, cells, wilds, positions, multiplier, payout }; positions are [row, col] pairs.
Winning Lines Details (array)The same clusters as { line, symbols, positions, payout }, the Calculate Winnings shape; wire to Directional Cascade winningLinesDetails.
Cluster Winnings (number)Total payout of all clusters in minor units.
Cluster Count (number)Number of paying clusters.
Has Win (boolean)True when the total payout is above zero. A boolean, not a signal.
Largest Cluster (number)Size of the biggest paying cluster; 0 when nothing paid.

Usage​

  1. Wire Weighted Reels reels into Reels, Get Paytable paytable into Paytable and the bet into Bet Amount.
  2. Set Min Cluster Size and Adjacency to the game rules; set Wild Symbol if the game has one.
  3. Fire Do from Weighted Reels Done.
  4. On Done, add clusterWinnings to the round win and branch on hasWin.
  5. For tumbles, wire winningLinesDetails into Directional Cascade Winning Lines Details and score the new grid again.
note

Paytable keys are cluster sizes and pay by bracket: with keys 5, 6 and 7, a 12-cell cluster pays the 7 key. Add keys for the larger sizes you want to pay more.