diff options
Diffstat (limited to '')
| -rw-r--r-- | docs/GAMES.md | 63 |
1 files changed, 43 insertions, 20 deletions
diff --git a/docs/GAMES.md b/docs/GAMES.md index cbe355e..52ab1bf 100644 --- a/docs/GAMES.md +++ b/docs/GAMES.md | |||
| @@ -5,18 +5,40 @@ | |||
| 5 | | Game | Status | Notes | | 5 | | Game | Status | Notes | |
| 6 | | --- | --- | --- | | 6 | | --- | --- | --- | |
| 7 | | Slots | Done | 5 reels x 3 rows, 5 paylines, 98.6% RTP | | 7 | | Slots | Done | 5 reels x 3 rows, 5 paylines, 98.6% RTP | |
| 8 | | Roulette | Done | European wheel, split bets, 97.3% RTP | | ||
| 8 | 9 | ||
| 9 | ## Planned | 10 | ## Planned |
| 10 | 11 | ||
| 11 | | Game | Shape | Main open decisions | | 12 | | Game | Shape | Main open decisions | |
| 12 | | --- | --- | --- | | 13 | | --- | --- | --- | |
| 13 | | Roulette | One spin, many bets | European/French/American wheel; which bet types; 35:1 straight and other payouts | | ||
| 14 | | Blackjack | Multi-step hand | Dealer hits/stands soft 17; double/split/insurance; blackjack payout; shoe persistence | | 14 | | Blackjack | Multi-step hand | Dealer hits/stands soft 17; double/split/insurance; blackjack payout; shoe persistence | |
| 15 | | Crash | Real-time round | Crash-point distribution; cashout latency; provable fairness | | 15 | | Crash | Real-time round | Crash-point distribution; cashout latency; provable fairness | |
| 16 | 16 | ||
| 17 | Roulette fits the current one-request-settle model most easily. Blackjack needs | 17 | Blackjack needs server-side hand state and player actions. Crash needs a timed |
| 18 | server-side hand state and player actions. Crash needs a timed round loop and a | 18 | round loop and a cashout action, so it should come after blackjack unless we |
| 19 | cashout action, so it should come last unless we redesign the loop first. | 19 | redesign the loop first. |
| 20 | |||
| 21 | ## Roulette | ||
| 22 | |||
| 23 | - European wheel: 0-36, one green zero. | ||
| 24 | - Bets: red, black, even, odd, and straight numbers. | ||
| 25 | - Bets can be split across all of those; every winning bet is added together. | ||
| 26 | - Straight pays 35:1 (36x returned), outside bets pay 1:1 (2x returned). | ||
| 27 | - 0 loses all outside bets. RTP is 36/37 = 97.30%. | ||
| 28 | |||
| 29 | Client controls inside roulette: | ||
| 30 | |||
| 31 | ``` | ||
| 32 | R / B / E / O add the current chip to red/black/even/odd | ||
| 33 | digits + Enter add the current chip to that number | ||
| 34 | C clear all bets | ||
| 35 | + or = / - change the chip size | ||
| 36 | SPACE spin | ||
| 37 | Q leave the table | ||
| 38 | ``` | ||
| 39 | |||
| 40 | The result is shown as a CS:GO-style horizontal strip: the ball marker stays | ||
| 41 | fixed and the wheel numbers scroll beneath it, ending on the winning number. | ||
| 20 | 42 | ||
| 21 | ## Audit schema | 43 | ## Audit schema |
| 22 | 44 | ||
| @@ -35,35 +57,36 @@ plays ( | |||
| 35 | ) | 57 | ) |
| 36 | ``` | 58 | ``` |
| 37 | 59 | ||
| 38 | `game_type` is the game that was played. `details` is a JSON object whose shape | 60 | `details` is game-specific JSON: |
| 39 | depends on the game: | ||
| 40 | 61 | ||
| 41 | ```json | 62 | ```json |
| 42 | // slots | 63 | // slots |
| 43 | {"reels":"CCCCLLCLODGSDGS","win_type":"win","win_lines":"1","win_cells":"0,3,6"} | 64 | {"reels":"CCCCLLCLODGSDGS","win_type":"win","win_lines":"1","win_cells":"0,3,6"} |
| 44 | 65 | ||
| 45 | // rumoured future examples | 66 | // roulette |
| 46 | {"player":["AS","10H"],"dealer":["9D","7C"],"outcome":"blackjack"} | 67 | {"number":"17","color":"black","bets":"{\"red\":10,\"black\":10,\"even\":10,\"odd\":10,\"numbers\":[{\"number\":17,\"amount\":5}]}"} |
| 47 | {"bets":[{"kind":"straight","number":17,"amount":10}],"winning":17} | ||
| 48 | {"crash_point":2.41,"cashout":1.80} | ||
| 49 | ``` | 68 | ``` |
| 50 | 69 | ||
| 51 | The balance updates and the `plays` insert happen in one transaction | 70 | The balance update and the `plays` insert happen in one transaction |
| 52 | (`database::apply_play`). The slots-specific wire fields (`reels`, `win_lines`, | 71 | (`database::apply_play`). |
| 53 | `win_cells`) are still in `GAME_RESULT`, but the database no longer assumes | ||
| 54 | them. | ||
| 55 | 72 | ||
| 56 | ## Protocol gap | 73 | ## Wire protocol |
| 57 | 74 | ||
| 58 | The current exchange is slots-shaped: | 75 | Slots keeps its original exchange: |
| 59 | 76 | ||
| 60 | ``` | 77 | ``` |
| 61 | PLAY_START <game> <bet> | 78 | PLAY_START slots <bet> |
| 62 | GAME_RESULT <session> <winnings> <bet> <balance> <reels> <win_type> <win_lines> <win_cells> | 79 | GAME_RESULT <session> <winnings> <bet> <balance> <reels> <win_type> <win_lines> <win_cells> |
| 63 | ``` | 80 | ``` |
| 64 | 81 | ||
| 65 | Before blackjack, roulette, or crash can be added, the game session needs a | 82 | Roulette adds a compact bets payload and a roulette-specific result: |
| 66 | generic state/action protocol. A possible shape: | 83 | |
| 84 | ``` | ||
| 85 | PLAY_START roulette <total> <bets-json> | ||
| 86 | ROULETTE_RESULT <session> <winnings> <bet> <balance> <number> <color> <bets-json> | ||
| 87 | ``` | ||
| 88 | |||
| 89 | Blackjack and crash still need a generic state/action exchange, for example: | ||
| 67 | 90 | ||
| 68 | ``` | 91 | ``` |
| 69 | GAME_START <game> <bet> | 92 | GAME_START <game> <bet> |
| @@ -71,4 +94,4 @@ GAME_ACTION <action> [json] | |||
| 71 | GAME_STATE <json> # cards, bets, multiplier, legal actions, result | 94 | GAME_STATE <json> # cards, bets, multiplier, legal actions, result |
| 72 | ``` | 95 | ``` |
| 73 | 96 | ||
| 74 | That is a wire-protocol change and will be its own major version. | 97 | That will be its own protocol change. |
