Directional Cascade
Removes the cells a win evaluator paid, slides the survivors toward a gravity direction and refills the gaps from seeded weights. A maths node that also compiles to the RGS.
The node does not find wins. It clears only the cells named in Winning Lines Details: wire Calculate Winnings, Reel Ways Calculate Winnings or Cluster Pays winningLinesDetails. Only each entry's positions is read, as [row, col] pairs; bare pairs work too. Duplicates are merged and out-of-range pairs skipped. Reels is the grid being cascaded, reels[col][row], 1-based symbol ids.
Direction decides where the survivors slide and where the refill enters. down drops the survivors and refills from the top: the classic tumble, and the same grid Cascade The Reels gave for the same inputs and seeds. up refills from the bottom; left and right slide each row and refill from the opposite edge. Refill symbols come from Symbol Weights, the same symbolWeights array Weighted Reels takes, where entry n weights symbol n + 1; left empty, the alphabet is the distinct symbols already on the grid, drawn uniformly.
Seeds is consumed only when something clears, and only the first seed drives the draws of a pass, so wire a fresh ISAAC Random Number Array Generator array before each pass or every cascade refills alike. With nothing to clear the grid passes through, hadRemoval is false and no seed is needed. Unseeded with cells to clear, the node fails closed: it logs the reason, writes it to inspect data, empties every output and still fires Done. An empty or ragged grid fails the same way.
The grid is state. Hold it in a Variable, wire that variable into Reels, write the reels output back to it after every pass and let the win evaluator and the display read the same variable; wiring Weighted Reels reels straight in re-cascades the original spin on every beat. Fire Do once per scored pass and stop when hadRemoval is false. Step Multiplier Ladder step from hadRemoval for a per-tumble multiplier.
The Reel Controller animates a cascade downward only: feed the new grid to its Cascade Grid input so the display shows the symbols the maths chose, keep the drop style for down and switch to the fade style for up, left and right, which the maths computes correctly but the reels cannot animate as a drop.
Inputs
Parameters
| Data | Description |
|---|---|
| Reels (array) | The grid to cascade, reels[col][row]. Read it from the Variable that holds the evolving grid, not straight from Weighted Reels. |
| Winning Lines Details (array) | Entries whose positions ([row, col] pairs) are cleared; from Calculate Winnings, Reel Ways Calculate Winnings or Cluster Pays. Bare pairs also work. |
| Symbol Weights (optional) (array) | Refill weights, entry n for symbol n + 1, the Weighted Reels array. Empty = the grid's own symbols, drawn uniformly. |
| Direction (enum) | Where the survivors slide; the refill enters from the opposite edge. Default down. Options: down, up, left, right. |
| Seeds (array) | Random seeds, wired from ISAAC Random Number Array Generator array. Required; the node refuses to run unseeded. |
Actions
| Signal | Description |
|---|---|
| Do | Runs the node. |
Outputs
Events
| Signal | Description |
|---|---|
| Done | Fires when the node has finished, on success and failure alike. |
Results
| Data | Description |
|---|---|
| Reels (array) | The cascaded grid, same shape as the input. Write it back to the grid Variable. |
| Removed Positions (array) | The cleared cells as [row, col] pairs, deduplicated, out-of-range pairs dropped. |
| Removed Count (number) | Number of cells cleared this pass. |
| Had Removal (boolean) | True when at least one cell was cleared. Wire to Multiplier Ladder step and to the Condition that decides whether to score again. |
| Direction (string) | The direction actually applied; an unknown value falls back to down. |
Usage
- Hold the landed grid in a Variable; wire it into Reels and into the win evaluator.
- Wire the evaluator's
winningLinesDetailsinto Winning Lines Details, the Weighted Reels weights into Symbol Weights and a fresh ISAAC array into Seeds. - Fire Do from the evaluator's Done.
- On Done, write
reelsback to the Variable and update the display. - If
hadRemovalis true, score the Variable again; otherwise end the tumble chain.
Cascade The Reels has no server-side implementation, so a Maths Component that still uses it does not deploy. Directional Cascade with down is the drop-in replacement: the same reels, winningLinesDetails, symbolWeights and Seeds give the same grid. See the Slot Features guide.