Skip to main content
The Lines class evaluates the active game board against a set of defined paylines. For each payline, it scans for consecutive matching symbols (including wilds) from reel 0 outward and computes payouts from config.paytable.

Configuration

Line wins require two config fields:
dict
required
Maps (kind, symbol) tuples to payout multipliers.
dict
required
Maps a line index to an array of row positions — one per reel. Each entry defines which row on each reel forms the payline.

Lines.get_lines()

Iterates every defined payline and returns all winning combinations.
list[list[Symbol]]
required
The active game board — a 2D list of Symbol objects indexed as board[reel][row].
Config
required
Game configuration object. Must have config.paytable and config.paylines populated.
str
default:"wild"
The symbol attribute name used to identify wild symbols. Defaults to "wild".
str
default:"W"
The symbol name used to look up wild-only payouts in config.paytable. Defaults to "W".
str
default:"symbol"
Multiplier strategy to apply. One of "symbol", "global", or "combined". See Multiplier strategies.
int
default:"1"
A scalar multiplier applied to every win when using the "global" or "combined" strategies.

Return value

float
Sum of all winning line payouts for this board state, after multipliers.
list
One entry per winning payline.

Wild substitution

On each payline, the evaluation tracks two potential wins simultaneously:
  • Wild-only win — using the (kind, "W") paytable key, counting only the leading wild symbols.
  • Base win — using (kind, symbol) for the first non-wild symbol found, counting wilds + matching symbols.
Both are looked up in config.paytable. The higher payout wins. If the wild-only payout exceeds the substituted symbol payout, only the leading wild positions are included.
In lines games, a payline beginning with wilds is valid. The evaluation handles all-wild paylines as wild-only wins (looking up (wild_matches, wild_sym) in the paytable). To prevent 3/4-kind wilds from outpaying longer non-wild combinations, only define wild payouts at the maximum kind (e.g. 5-kind only).

Multiplier strategies

get_lines() delegates to apply_mult() from src/wins/multiplier_strategy.py.

Additional methods

Lines.emit_linewin_events(gamestate)

Emits win_info, set_win, and set_total events if win_manager.spin_win > 0. Also calls gamestate.evaluate_wincap().

Lines.record_lines_wins(gamestate)

Writes force-file entries for each line win, keyed by kind, symbol, mult, and gametype.

Usage

Use line wins for traditional fixed-payline slots. If your game has a large grid and you want to maximize winning combinations without defining hundreds of paylines, consider Ways Wins instead.