logo

Babylon.js Market

PokerAICali

tabletop-casino · poker-ai

PokerAICali

Listens toPokerBetting
Talks toPokerBetting
1
Gold-Circuit CaliBonus figureGold-Circuit Cali
Unlock

Install with the CLI:

bjs download PokerAICali

PokerAICali

Cali, the calling station: a poker NPC who pays to see cards, folds late, and rarely raises.

What it does

PokerAICali is one poker personality, dropped onto a seat as a strategy the PokerBetting director can call. Cali is the table's calling station — she climbs no equity ladder toward aggression; she just keeps paying to see the next card.

The decision is stateless: the same NpcContext and the same rng draw return the same action.

  • Pre-flop she reads the starting-hand tier from PokerAI's classifyStartingHand. Premium and strong hands take a 90/10 call-over-raise weighting. A moderate hand flat-calls. Weak and trash hands check for free when nothing's owed, and otherwise lean on a call-heavy weighting that folds only at the tail of the draw.
  • Post-flop she weighs made-hand equity from PokerAI's estimateEquity and stays sticky at every rung. Two pair or better mostly calls and occasionally raises; one pair just calls down; ace-high still usually calls and lets go only when the price is steep and the draw lands at the fold bucket.

The post-flop equity-to-action map is the pure decidePostFlop(available, equity, rng) helper, split out so each rung is reachable from a test by feeding equity directly. estimateEquity floors at HighCard's 0.10, so the sub-0.10 rung never fires through the live evaluator — cali still carries it, calling about half the time, for any future equity model that dips below the floor.

cali's one source of randomness is weightedPick, whose generator it takes as the fourth rng parameter (and uses for the no-context fallback too). Pin it in a test; seed it from a host. It defaults to Math.random only when a caller omits it.

PokerAICaliSystem is the event-driven glue. It listens for the director's poker.actionRequired menu, runs cali over the offered actions and the table snapshot, writes cali's reasoning back onto the context for a HUD, and emits poker.turnAction.

Use it in a scene

A scene is just data — a list of entities, each with its components. At startup the SceneLoader turns this JSON into a live world; edit the file and reload to rebuild it.

Fastest path

bjs download scene PokerAICali

Pulls this exact scene into your project and runs it — no copy-paste. Add --all to grab the components and assets it needs too.

Or build it from scratch with the bjs CLI:

  1. 1Scaffold a project
    npm create @babylonjsmarket/arcade@latest my-game

    World, renderer, and dev server — ready to run.

  2. 2Install dependencies
    cd my-game && npm install
  3. 3Add PokerAICali
    bjs download PokerAICali

    Copies its source into src/ so the scene resolves.

    First time? Run bjs login once.

  4. 4Paste the scene into src/scenes/arcade-room.ts and run
    npm run dev

    SceneLoader builds the world from the JSON; reload to rebuild.

JSON
{
  "Cali": {
    "components": {
      "PokerAICali": {
        "seatIds": ["npc0", "npc1"]
      }
    }
  }
}

The example scene pairs it with PokerHandEval and PokerBetting: the director offers a menu on poker.actionRequired, cali answers with poker.turnAction, the director applies the chip effect. Or call the strategy directly to register it on a seat:

TypeScript
import { cali } from './PokerAICali'

const strategies = new Map([['npc0', cali], ['npc1', cali]])
pokerBettingSystem.setStrategies(strategies)

Props

PropTypeDefaultMeaning
seatIdsstring[][]Seats cali plays. Empty means she answers for every NPC seat offered a menu.

Events

DirectionNameConstPayload
inpoker.actionRequiredPokerAICaliInputEvents.ACTION_REQUIRED{ playerId, actions, context? }
outpoker.turnActionPokerAICaliEvents.TURN_ACTION{ playerId, action }

poker.turnAction is the same name PokerBetting accepts as a human's raw action, so the director applies cali's pick exactly as it would a HUD click. With no context on the menu, cali falls back to a uniform pick over the offered actions; with one, she runs the full tier/equity read.

Dependencies

  • PokerAI — supplies classifyStartingHand, estimateEquity, pickAction, weightedPick, and shortHand, the substrate cali reasons over.
  • PokerBetting — supplies ActionType, NpcStrategy, and NpcContext, and is the director that offers the menu and applies the pick.
  • PokerHandEval — the evaluator estimateEquity reads through PokerAI for the post-flop rung.

Notes

  • One seat owner per scene: the System routes a menu into the first entity carrying a PokerAICali instance, then filters by seatIds.
  • The reasoning cali writes ({ hand, tier | equity, notes }) mutates the context passed in; pass a fresh context per turn if a HUD reads it back.
  • decidePostFlop is exported for a host that wants the equity-to-action map without the menu plumbing — it returns { action, note } and never touches the bus.
  • Swap system.strategy to drop a different personality onto the same plumbing; it defaults to the pure cali.

More like this

PokerAI
PokerBetting
PokerHandEval
AIGoalSeek
AIKick
AIZone
AiPilot
BallPossession
BallPursuit
CardFan
DeckDealer
Enemy
EnemySpawner
FreighterChain
LineOfSight
PokerAIBill
PokerAIRandy
PokerAIShark
PokerAISurge
PokerAITilt
PokerHUD
PokerInput
PokerMultiplayer
PokerSeating
PokerTableCards
PokerTableDirector
TurnPacer
WaveDirector

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search