
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.
Sample game
A real-time multiplayer strategy game whose web and Unity clients connect to the same server and share the same C# game logic.
Megaton is a real-time free-for-all on a 3D globe, in which nations launch missiles at each other's cities. CPU nations take the seats that no player fills.
It's worth exploring if you're building a real-time multiplayer game, or one game for more than one engine. A Blazor WebAssembly client in the browser and a Unity client connect to the same server and share the same game logic code, and the server keeps full authority over every match.
// the_same_match_in_the_web_client_and_the_Unity_client
Clients on different engines
The same moment of one match in the web client, in a browser, and in the Unity client, in the Unity editor. Both connect to the same server and share the same game logic code.
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.
A Blazor WebAssembly client in the browser and a Unity client connect to the same server and share the same game logic code. They also share the client code that decides what each screen shows. Only the presentation is engine-specific: each client has its own UI, input handling and globe rendering.
Blazor Starter Project(Metaplay docs, opens in a new tab)Players fight live matches of four nations. Each match is a multiplayer entity on the server, which the server and every client in the match run in step. A player who loses the connection rejoins the same match.
Multiplayer entities(Metaplay docs, opens in a new tab)The match rules and CPU nations are C# code that runs identically on the server and every client. The server has full authority: it validates every launch before it runs for anyone, so a modified client cannot cheat.
Game logic execution model(Metaplay docs, opens in a new tab)A matchmaker entity on the server holds the queue, forms a match when enough players are waiting or when a player chooses to start, and fills the empty seats with CPU nations.
Custom entities(Metaplay docs, opens in a new tab)The match rules and the shared client code run in headless tests, with no engine or browser. The end-to-end tests are written once and play each scenario on every client against a real server, including a match with both clients in it.
Automated testing(Metaplay docs, opens in a new tab)The full source code is public on GitHub. The README explains how the game is built and how to run it on your own machine.
Read the Megaton sample at https://github.com/metaplay-shared/samples/tree/main/Samples/Megaton and explain how it is built on Metaplay.

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

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

Autorunner
A one-button ninja autorunner that runs in the browser at 60 Hz, with the server validating every run to decide the time that counts.