Have more questions? Join our

Framework v3 (admin-only preview)

Framework v3 is an admin-only preview. Only Boardweaver admins can create a v3 game, commit one or expose one to players. Everything on this page can change before v3 opens to the professional plan. Build games that players depend on with framework v2.

What v3 is

A v3 game's rules are written in Rust against the boardweaver-sdk crate and compiled to a WebAssembly module. The module never runs on Boardweaver's application servers: the game runner, an isolated service, keeps one live instance of it per match. The server stores every move, and filters what each viewer sees with Boardweaver's own platform module, so a game cannot leak another player's hidden pieces, offers or private points.

A game implements one trait and exports it:

use boardweaver_sdk::*;

pub struct MyGame;

impl Game for MyGame {
    fn score_labels(players: &[PlayerId]) -> Vec<String> { /* what each score column means */ }
    fn setup(table: &mut Table, players: &[PlayerId], rng: &mut Rng) { /* build the opening table */ }
    fn available_actions(table: &Table, player_id: PlayerId) -> Vec<AvailableAction> { /* ... */ }
    fn apply_action(table: &mut Table, player_id: PlayerId, action: &Action, rng: &mut Rng)
        -> Result<(), String> { /* ... */ }
    fn scores(table: &Table) -> Scores { /* ... */ }
    fn is_game_over(table: &Table, scores: &Scores) -> bool { /* ... */ }
}

export_game!(MyGame);

The state is pieces in spaces, named by their space and position, each with a public part every viewer sees and a private part only its owner sees. A game changes it only through Table, randomness comes only from the seeded Rng, and each step may give itself one public caption for the game log. A caption is shown to everyone, so it must never name hidden information.

Intents: the most important rule

Every action a game offers carries an intent, and bots and search key off it:

Intent Meaning
choice Adds new information to the open decision and moves it forward. It never returns the decision to a state it already had.
confirm Ends the decision.
cancel Changes or takes back something already chosen. Bots ignore cancel actions.

Worked example, a draft of 12 cards: with nothing staged, each card is a choice. Once a card is staged, the other 11 are still offered so the player can switch, but tagged cancel, and the command that takes the staged card is confirm. Tagging those 11 as choice is the common mistake: a bot switches between cards forever. Every game's tests run checks::walk_intents, which finds that mistake and also fails a game whose results depend on a HashMap's iteration order.

What the preview has, and what it does not have yet

  • A v3 game cannot be committed yet. Boardweaver does not build Rust yet, and it takes no module built elsewhere. Until its build service exists, a v3 game is the tic-tac-toe seed it was created from (see v3-build-game-instructions).
  • A new v3 game starts as tic-tac-toe, the tic-tac-toe-rust example, already built.
  • Each click is one decision. Drafts, undo and replay of a live match come later.
  • There is no v3 board yet. The React client for v3 comes later, so a v3 match cannot be played in the browser yet.
  • The game's rules pages, marketing page and theme work as they do in v2 (see v3-pages).