Skip to main content

Generate Reel Strips

This node generates the layout of the reel strips based on symbol weights.

The Generate Reel Strips node creates the virtual "tapes" of symbols used for the slot machine.

The Generate Reel Strips node creates the underlying data structure for the slot reels. Instead of determining the result of a single spin, it generates the long strips of symbols that the reels "spin" through. It uses weighted probabilities to determine how often each symbol appears on the strips.

Inputs

Parameters

DataDescription
Symbol WeightsArray of numbers representing the relative frequency of each symbol.
Random SeedsArray of seeds for the random number generator (one per reel).
Column SizeNumber of reels to generate. Default: 5.

Actions

SignalDescription
DoTriggers the generation.

Outputs

Results

DataDescription
Reel StripsA 2D array representing the generated strips for each reel.

Events

SignalDescription
DoneTriggered when generation is complete.

Usage

Game Initialization

  1. Define Symbol Weights (e.g., [10, 20, 30, 40], where symbol 1 appears least often).
  2. Generate random seeds.
  3. Trigger Do at the start of the game session.
  4. Store Reel Strips in a variable.
  5. Use these strips in Slot Spin to determine results.

Detailed Behavior

  • Algorithm: Uses a Fisher-Yates shuffle with a seeded random number generator to distribute symbols according to their weights.
  • Determinism: Using the same seeds and weights will always produce the same strips.

Troubleshooting

  • Empty Output: Ensure Symbol Weights is a non-empty array of positive numbers.