summaryrefslogtreecommitdiffstats
path: root/docs/SLOTS.md
blob: a64bdbfab1bb14c7a57926cd939f929bffa3a45a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Slots: 5 reels x 3 rows

## Grid

- 5 reels (columns) x 3 rows = 15 visible symbols.
- Six symbols, uniform: `C` cherry, `L` lemon, `O` orange, `G` grapes,
  `D` diamond, `S` seven.
- The bet is the **total** bet, not a per-line bet.
- Five paylines: top, middle, bottom, V, inverted V.
- A line pays for 3, 4 or 5 matching symbols starting on reel 1 and reading
  left to right.

```
line 1:  top row across all five reels
line 2:  middle row across all five reels
line 3:  bottom row across all five reels
line 4:  top, middle, bottom, middle, top
line 5:  bottom, middle, top, middle, bottom
```

## Paytable

Multipliers are applied to the total bet.

| Symbol | 3 of a kind | 4 of a kind | 5 of a kind |
| --- | ---: | ---: | ---: |
| C | 2x | 5x | 15x |
| L | 3x | 7x | 20x |
| O | 3x | 8x | 25x |
| G | 4x | 12x | 40x |
| D | 6x | 18x | 70x |
| S | 9x | 30x | 150x |

- Exact RTP: **425/432 = 0.983796...** (1.62% house edge).
- Maximum win: 5 lines x 150x = **750x total bet**.
- Chance of any win on a spin: about **13%**.
- The RTP is checked by `SlotsGame::theoretical_rtp()` and `tests/slots.rs`.

## Wire format

`GAME_RESULT` keeps its existing fields and appends the winning lines and cells:

```
GAME_RESULT <session> <winnings> <bet> <balance> <reels> <win_type> <win_lines> <win_cells>
```

- `reels`: 15 characters, **column-major**: reel 0 top/middle/bottom, then
  reel 1, and so on.
- `win_type`: `none`, `win`, `big` (>= 10x total bet) or `mega` (>= 50x).
- `win_lines`: 1-based comma-separated line numbers, or `-` for no win.
- `win_cells`: 0-based column-major cell indices to highlight, or `-` for no
  win. Example: `0,3,6` is the first three cells of the top row.
- Older servers may still send a 3-character `reels` string; the client
  degrades it to the first row.
- Older 1.0 servers send only `win_lines`; the 1.1 client simply shows no
  highlights against them.

The extra `win_lines`/`win_cells` fields are additive. The 5x3 `reels` payload
is a breaking change for pre-5x3 clients, hence `1.0.0`; highlighting is the
backward-compatible `1.1.0` release. The client never re-derives paylines: the
server sends exactly which cells won.

## Client board

The board is nine lines:

```
=== SLOTS ===
Bet: 10 PLN   Lines: 5   Balance: 1000 PLN
[ C ] [ L ] [ O ] [ G ] [ D ]
[ S ] { C } { C } [ O ] [ G ]
[ D ] [ S ] { C } [ L ] [ O ]

Won 20 PLN
Winning lines: 2
[+/-] Bet   [SPACE] Spin   [Q] Quit
```

Winning cells use braces and are rendered yellow/bold in the terminal. The
line list below the status names the paylines that won. Both come from the
server's `win_lines` and `win_cells`, which are already carried through the
client state for the animation pass.