Metaplay AI
SamplesPricing
Sample game

Turn-based PvP collectible card sample

A two-player PvP collectible card game where the server runs every rule and both browsers replay the same C# actions.

Built by Antti Hätälä · Tech Director
Genre
Collectible card game
Client
Blazor WebAssembly
Core Metaplay features
  • Multiplayer entities
  • Matchmaking
  • Server-only state
  • Game configs
  • Dashboard extensions
01

How this collectible card game sample works

Sticky Paws is a two-player card game that runs in your browser. You build a deck from your collection and take it into a ranked or a practice match. Ranked matches pair you with another visitor, or a bot if nobody else is around. Every card you own has a rank, and ranked matches put those ranks on the line, because the winner takes a rank from one of the cards the loser played. Cards you lock before the match are safe.

The part worth studying is how that rank moves from one player to the other. The server takes it from the loser and gives it to the winner exactly once, and quitting doesn't help, because a bot takes over and finishes the match. Each player's hand stays hidden on the server, so nobody can see the other player's cards. The cards and rules are kept minimal on purpose, because the game is built as a technical foundation to demonstrate the mechanics.

02

Core Metaplay features in the game

A showcase of the core Metaplay features this sample is built around, screen by screen.

03

What it shows about Metaplay

Each system in the game maps to a Metaplay feature. The label under each card names it and links to its page in the Metaplay docs.

Rules that run on the server and in both browsers

Each match is a multiplayer entity on the server. Every rule is an action the server issues, and both players' browsers run the same action on their own copy of the match, with a checksum that catches any difference.

Multiplayer entities(Metaplay docs, opens in a new tab)
Hidden hands

Each player's hand and the deck order are kept in server-only state that the SDK never sends to a client, and each player receives only their own cards. It uses an SDK change coming in a future release, and the sample includes a preview of it.

Server-only state(Metaplay docs, opens in a new tab)
The client only sends requests

A browser only asks to play a card. The server checks the turn, the hand and the rules, then plays it or refuses with a reason the player sees.

Server-authoritative game logic(Metaplay docs, opens in a new tab)
A rank transfer that happens exactly once

When a ranked match ends, the match tells both players' accounts what to apply, server to server and loser first. Each account applies a result once per match, so a retry never moves a rank twice.

Entity messaging(Metaplay docs, opens in a new tab)
Matchmaking with bots

A matchmaker running on the server pairs players by rating and deck strength, and seats a labelled bot when nobody suitable is around.

Service entities(Metaplay docs, opens in a new tab)
Custom LiveOps Dashboard views

The player page on the LiveOps Dashboard is extended with each player's collection and saved decks, and shows card names instead of card ids.

Dashboard extensions(Metaplay docs, opens in a new tab)
04

Explore this sample

Two steps and your coding agent has this sample running locally and can walk you through how it fits together, from the shared game logic to the game configs and the LiveOps Dashboard.

Prefer to run it by hand? The README has the commands.

  1. macOS, with Homebrew
    $ brew tap metaplay/homebrew-tap
    $ brew install metaplay
    Windows, with Scoop
    $ scoop bucket add metaplay https://github.com/metaplay/scoop-bucket
    $ scoop install metaplay
    Linux
    $ bash <(curl -sSfL https://metaplay.github.io/cli/install.sh)
  2. 02Paste this into your coding agentFrom an empty directory. It clones the sample, installs the Metaplay Agent, runs the game locally and walks you through how it works.

    The Sticky Paws sample is at https://github.com/metaplay-shared/samples/tree/main/Samples/CollectibleCardGame. Clone https://github.com/metaplay-shared/samples, go into Samples/CollectibleCardGame and run metaplay skills install there to install the Metaplay Agent. Open a playable version of the game locally in my browser so I can try it, then walk me through how the sample is put together.

05

The people behind it

Every sample is built in-house by a small team or a single person, with the same SDK and tools that ship with Metaplay.

Read the build story→
Antti Hätälä

Antti Hätälä

Tech Director

Sticky Paws is a one-on-one collectible card game modelled on Skyweaver, an NFT-era Hearthstone clone that was one of my favourite games a few years back and sadly no longer exists. I built it on Metaplay so that the match, the matchmaking and the player's card collection all run on one shared C# model in the same game server.

06

More samples

All samples→
Real-time multiplayer card sample gameplay

Card game

Real-time multiplayer card sample

A four-player real-time card game where the server owns every deal, with a full live-service layer around it.

Blazor WebAssemblyExplore→
Async PvP football sample gameplay

Sports management

Async PvP football sample

A head-to-head football manager league for 20 friends, with the meta of a top-grossing casual game around it.

Blazor WebAssemblyExplore→
Config-driven merge-2 story sample key art

Merge puzzle

Config-driven merge-2 story sample

A merge-2, story-driven Unity sample that uses the core Metaplay systems.

UnityExplore→