Every engine
03Engine

Baccarat

Player and Banker hands dealt by the standard rules from an endless shoe; five bets.

Kind
one deal, no decisions
Largest win
12.87x the stake
Name in the files
baccarat
Version
9ab2907e4ec8

Download this engine as one file

What the player sets

  • bet: player, banker, tie, player_pair or banker_pair

Every round also takes the return dial in basis points, 9600 to 9900, and a stake.

The round, in order

  1. each card: rank = int_below(13) (every rank equally likely, as from an endless shoe)
  2. two cards each, Player first; tens and pictures count 0, an ace 1, the hand's value is the last digit of its sum
  3. a natural 8 or 9 on either hand ends the deal
  4. otherwise the Player draws a third card on 0 to 5 and stands on 6 or 7
  5. then the Banker: if the Player stood, the Banker draws on 0 to 5. If the Player drew a card of value v, the Banker draws on 0, 1, 2 always; on 3 unless v is 8; on 4 when v is 2 to 7; on 5 when v is 4 to 7; on 6 when v is 6 or 7; never on 7
  6. cards are drawn in this order: Player, Banker, Player, Banker, the Player's third, the Banker's third
  7. the higher hand wins; equal is a tie

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

Player pays (rtp/10000 - P(tie)) / P(player), Banker (rtp/10000 - P(tie)) / P(banker), Tie (rtp/10000) / P(tie), each x10k and rounded down, from the exact chances; a Player or Banker bet gets its stake back on a tie. A pair bet pays rtp x 13 (x10k) when that hand's first two cards share a rank (1 time in 13). Every bet returns the dial or just under it.

  • P(banker) = 45.842792% (2212744/4826809)
  • P(player) = 44.614651% (2153464/4826809)
  • P(tie) = 9.542557% (460601/4826809)

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 bets
BetPaysExact return
banker1.8859x95.9974% (5792018637/6033511250)
banker pair12.48x96% (24/25)
player1.9378x95.9968% (2895989712/3016755625)
player pair12.48x96% (24/25)
tie10.0601x95.999% (46336921201/48268090000)

Dial at 97.5%

The bets
BetPaysExact return
banker1.9186x97.4965% (2941232274/3016755625)
banker pair12.675x97.5% (39/40)
player1.9714x97.4958% (17403624/17850625)
player pair12.675x97.5% (39/40)
tie10.2173x97.4991% (47060985973/48268090000)

Dial at 99%

The bets
BetPaysExact return
banker1.9513x98.9955% (5972910459/6033511250)
banker pair12.87x99% (99/100)
player2.0051x98.9993% (5973139583/6033511250)
player pair12.87x99% (99/100)
tie10.3745x98.9992% (9557010149/9653618000)

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: fits with a cap (choice). The five bets' pays fit; the dealt cards would not come from the template's draw.

On the templates it would take: the `choice` template for the five bets' pays; the dealt cards would have to come from the same draw. Its params are not published.

Check a build against ours

60 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.

player, dial 9900
seed 0f5ac25300f9a16dceee806b851381ba11ccbe5793ac575cfa1224047064be87
settings {"bet":"player"}
draws int_below(13) = 1, int_below(13) = 7, int_below(13) = 3, int_below(13) = 5
pays 2.0051x (payX10k 20051)
banker, dial 9900
seed 3e9fc1da875a24266f1c592478f50eaf874d2b10b087e3c0331482793c425bc3
settings {"bet":"banker"}
draws int_below(13) = 11, int_below(13) = 0, int_below(13) = 12, int_below(13) = 4
pays 1.9513x (payX10k 19513)

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.