summaryrefslogtreecommitdiffstats
path: root/docs/SLOTS.md
blob: ccc3b600996209e522439ab87b8870c528c9298b (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
# 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:

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

- `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.
- Older servers may still send a 3-character `reels` string; the client
  degrades it to the first row.

The extra `win_lines` field is additive, but the 5x3 `reels` payload is a
breaking change for pre-5x3 clients. That is why the release is `1.0.0`.

## Client board

The board is nine lines:

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

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

`win_lines` is already carried through the client state so the next animation
pass can highlight the winning rows without recomputing the payout.