Open source · Apache-2.0
The game engine that fits inside your app.
Sariema is written in Rust on wgpu. Games ship as data packs with sandboxed WebAssembly logic, and step to the same hash on desktop and in the browser.

examples/climbStill frameThe engine in your browser, as WebAssemblyMeasured, not promised
Apple M5, Metal, medium tier, release builds; medians of three repetitions on a shared machine. From the performance notes.
- CPU for one step of examples/climb and its frame at 1920×1080
- 0.88ms
- GPU for that frame: room, actors, HUD and post-processing
- 1.21ms
- actors walking under collision, each looping a clip, in 1.36 ms a step
- 2,000
- render passes for the full look, down from 23; a frame's CPU follows the pass count
- 16
One engine, every module wired
Write the game, then put it anywhere
use sariema_sdk::{Command, Ctx, Entity, Event, Events, Game, Kind, game, id};
const NEAR_FRIEND: u32 = 1;
const MEET: u32 = id("meet");
pub struct Hello {
hero: Entity,
}
impl Game for Hello {
fn new(ctx: &mut Ctx<'_>) -> Hello {
let hero = ctx.spawn(Kind::Actor, id("hero"));
ctx.send(Command::SetHero { entity: hero, speed: 2.0 });
ctx.send(Command::Zone { zone: NEAR_FRIEND, center: [0.0, 0.0, -8.0], radius: 3.0 });
Hello { hero }
}
fn tick(&mut self, ctx: &mut Ctx<'_>, events: Events<'_>) {
for event in events {
if let Event::TriggerEnter { trigger: NEAR_FRIEND, entity } = event {
if entity == self.hero {
ctx.bind(id("hero"), self.hero);
ctx.play_cutscene(MEET);
}
}
}
}
}
game!(Hello);
import { mount } from "@sariema/web";
const canvas = document.querySelector("canvas")!;
const sariema = await mount(canvas, { quality: "medium" });
// A folder written by `sariema web`: the game pack and its manifest.
await sariema.loadGame("/games/climb/");
sariema.on("host", (message) => console.log(message.type, message.step));
sariema.on("error", (error) => console.error(error.code));
import { WebView } from "react-native-webview";
// The page at this address mounts @sariema/web and forwards events with
// window.ReactNativeWebView.postMessage(JSON.stringify(event)).
export function GameScreen() {
return (
<WebView
source={{ uri: "https://example.com/games/climb/" }}
allowsInlineMediaPlayback
mediaPlaybackRequiresUserAction={false}
onMessage={(e) => console.log(JSON.parse(e.nativeEvent.data))}
/>
);
}
Where it runs
Works today
Desktop
The sariema CLI and its window player, natively through wgpu.
Works today
Web
WebGPU, or WebGL2 through the downlevel path, with the native engine_hash.
Works today
App WebViews
WKWebView and Android's System WebView run the same web package.
Planned natively
React Native
Inside react-native-webview now; a native Fabric component is the design's goal.