Scratch card, played-out rounds
A scratch card whose every card was made beforehand: what is under each panel comes with the draw; three alike win, a bonus panel multiplies.
- Kind
- one draw picks a whole round played out beforehand
- Largest win
- 5,000x the stake
- Name in the files
- scratch (books)
- Version
- 39350aa086f0
Download this engine as one file
What the player sets
- feel: small wins often, balanced or rare big wins (the table of weights)
Every round also takes the return dial in basis points, 9600 to 9900, and a stake.
The round, in order
- the cards: 80,000 cards were made once by the rules below and are kept in one file (
books: its name, its sha256, what each field is). A build loads the file and does not make the cards again; card i is the file's i-th entry, counted from 0 - how a card was made: first the prize it wins, or none, by
rules.prizes(how many cards in 10,000 win each prize as made); then nine panels that say so: the winning prize exactly three times, no other prize more than twice, in a shuffled order; then a tenth panel with a multiplier by the weights inrules.bonus - the card pays its prize times its multiplier, cut at 5,000 times the stake
- each card has a weight for the feel. Start: 1000 when the card pays under 200 times the stake, 200 when under 1,000 times, 40 above that (one card among so many must not carry the return). small wins often: the weight x 13 div 10 for a pay above 0 and up to 5 times the stake, x 6 div 10 for 20 times or more. rare big wins: x 7 div 10 for a pay above 0 and up to 2 times, x 16 div 10 for 20 times or more. balanced: unchanged. The weight of each winning card is that number times 1000
- every card that pays nothing has one and the same weight z, set for the dial: z = (S / (rtp / 10000) - W) / L rounded up to a whole number, at least 1, where S is the sum over the winning cards of weight x pay (pay in stakes), W the sum of their weights and L the number of losing cards.
tablesgives z and the total weight at the three dial points - the order is: the winning cards as they come in the file, then the losing cards as they come in the file. r = int_below(total weight); the card picked is the first whose running weight is above r
The rounds: rain-books-scratch-v2.json.gz, 80,000 rounds as one JSON list in a gzip. The JSON text inside is 7,463,277 bytes, sha256 d38c9e186b02b1f82679b47e6652487fb923fb9cf057b1bc7c80c8c65a8801a6. What each field is, and the rules the rounds were made by, are in this engine’s file under books and rules.
int_below(m) is a whole number from 0 to m-1: limit = 2^64 - (2^64 mod m); take values until v < limit; return v mod m. shuffle: Fisher-Yates from the end, j = int_below(i+1). Words: HMAC-SHA256(key = seed, "STORM-DRBG|" || u64be(j)), cut into big-endian u64s.
What it pays
The picked card's pay (in hundredths of the stake), at most 5,000 times the stake. The return is the sum of weight x pay over the total weight. Because z is rounded up it is never above the dial, and it is within one millionth of it: tables gives each one exactly.
Tables
The tables the round uses at three points of the dial, each with its exact return. A multiple is kept in the files as a whole number times 10,000, rounded down (Storm’s multX1e4); here it is written out.
Dial at 96%
The weightslargest win 500x
| Feel | Winning rounds | Losing rounds | Weight of each losing round | Total weight | Chance of a win | Exact return |
|---|---|---|---|---|---|---|
| balanced | 23,447 | 56,553 | 829,418 | 70,344,276,154 | 33.319271% (11719100000/35172138077) | 95.999993% |
| rare big wins | 23,447 | 56,553 | 1,064,121 | 78,418,854,913 | 23.259228% (2605660000/11202693559) | 95.999935% |
| small wins often | 23,447 | 56,553 | 730,427 | 70,919,258,131 | 41.753708% (29611420000/70919258131) | 95.999947% |
Dial at 97.5%
The weightslargest win 500x
| Feel | Winning rounds | Losing rounds | Weight of each losing round | Total weight | Chance of a win | Exact return |
|---|---|---|---|---|---|---|
| balanced | 23,447 | 56,553 | 810,282 | 69,262,077,946 | 33.839874% (11719100000/34631038973) | 97.499962% |
| rare big wins | 23,447 | 56,553 | 1,042,788 | 77,212,409,764 | 23.622653% (651415000/2757586063) | 97.499936% |
| small wins often | 23,447 | 56,553 | 711,134 | 69,828,181,102 | 42.406117% (14805710000/34914090551) | 97.499962% |
Dial at 99%
The weightslargest win 500x
| Feel | Winning rounds | Losing rounds | Weight of each losing round | Total weight | Chance of a win | Exact return |
|---|---|---|---|---|---|---|
| balanced | 23,447 | 56,553 | 791,726 | 68,212,680,478 | 34.360474% (11719100000/34106340239) | 98.999921% |
| rare big wins | 23,447 | 56,553 | 1,022,101 | 76,042,497,853 | 23.986087% (2605660000/10863213979) | 98.99997% |
| small wins often | 23,447 | 56,553 | 692,426 | 68,770,187,578 | 43.058513% (14805710000/34385093789) | 98.999948% |
On Storm
In Storm’s core this engine is built from this page as written, with the settings and the largest win above, and is right when it reproduces the test rounds below. The rest of this part is about the templates Storm has live today, which is the way onto Storm until then.
Our reading against Storm’s templates: does not fit. 80,000 cards in a file, not a table of 64 rows, and the panels come with the draw.
On the templates it would take: a round picked from thousands played out beforehand: far over 64 rows, and the grid has to come with the draw.
Check a build against ours
36 whole rounds, each from a seed given in the file. A build is right when, from the same seed, settings, dial and actions, it makes the same draws in the same order and pays the same amount. The seed of a test round is sha256("rain-engine-vector|<engine>|<case>|<rtp_bps>|<i>"), given in hex in each vector.
The rest are in this engine’s file, with the full result of each round. The reference build plays this engine and reproduces every one of them.