Skip to content
mpgePublic

About

Expressive, batteries-included Rust game engine for Laravel Rust

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Realm

A Rust game engine for building and testing multiplayer worlds with Laravel Rust.

Quick start  ·  Architecture  ·  Play Clearing  ·  Packages

Clearing’s starting meadow, with ribbonwillows to the west, amber seams to the east and a player on the path.

What is Realm?

Realm is a Rust game engine that brings fixed-tick multiplayer simulation, typed actions, character persistence, and headless feature tests to Laravel Rust applications. In Clearing, clicking a willow sends an action to the server. The server checks reach and skill, awards a log and replicates the pack count back to the HUD. Clearing source and play guide

Route a player action

Register a name and a typed handler on GameRouter. Actions run against the server’s world, with guards for requirements such as a living player or a per-player cooldown. Action router

client action → guard
typed handler → ECS world

POST /realm/token
↓ encrypted token
game:serve ↔ client

Sign in, then join the simulation

RealmServiceProvider adds the token route, the game command and the character store integration. The Laravel Rust app authenticates the player over HTTP. A separate WebSocket connection carries game messages. Server integration

Test a fixed number of ticks

TestGame runs the same actions and systems with an in-memory player store. Use its two-client localhost fixture when a test needs to observe what another player actually receives. Multiplayer tests

spawn → move → step
inspect world or client replica

Move a player in a headless test

Enable the testing feature to use this example. Five ticks at the default 20 Hz move the player one world unit toward the target. Runnable crate doctest

use realm::prelude::*;

let mut game = TestGame::new();
let player = game.player().spawn();
player.action("player.move", Position([1.0, 0.0])).unwrap();
game.advance_ticks(5);
game.with_game(|game| {
    assert_eq!(game.world.get::<Position>(player.entity()), Some(&Position([1.0, 0.0])));
});

Features

Simulation

  • Fixed ticks and staged plugins
  • World setup, join and leave hooks

Actions

  • Serde payloads and route guards
  • Movement, interaction and chat

Gameplay

  • Inventory, skills and gathering
  • Melee and NPC respawn

Replication

  • Named components on positioned entities
  • Interest-filtered snapshots and interpolated positions

Server integration

  • Encrypted expiring login tokens
  • Position, inventory and XP checkpoints

Clients and tests

  • Native 2D views and input
  • Manual ticks or two real socket clients

Built with

Rust

Realm combines the five standalone libraries below. Laravel Rust supplies the application, authentication and database services for the default server feature.

Quick start

With Rust 1.99 or newer and Cargo, create a game and run its generated tests.

cargo install --git https://github.com/mpge/realm-installer
realm new mossbank
cd mossbank
realm test

To play, follow mossbank/README.md to migrate the database, create an account and start the two listeners. The installer guide walks through client sign-in.

Choose a Cargo feature

The Cargo package is realm-engine. Import it as realm in Rust.

Feature What it enables
server (default) Authoritative simulation, Laravel Rust service provider, token route and database player store.
client Native renderer, ClientApp and the game connection. Set default-features = false for a client-only build.
testing TestGame, in-memory checkpoints and the localhost network fixture. Can run with the defaults disabled.

Packages

Repository Use it for
realm-runtime Fixed clock, scheduler and plugins
realm-ecs Entities, sparse-set queries and change detection
realm-network Standalone multiplayer for any game loop or engine
realm-render Windowing, 2D drawing, input and PNG output
realm-gameplay Inventory, skills, combat and trading
realm-installer The realm CLI and project templates
realm-examples Clearing, a playable multiplayer meadow

Learn more

Topic Reference
Design decisions Library choices · Laravel Rust integration · Package boundaries
Working examples Headless gameplay · Token and persistence tests · Client callbacks

License

MIT License, copyright © 2026 Matthew Gros.

Realm is an independent project and is not affiliated with or endorsed by Laravel Holdings Inc.

About

Expressive, batteries-included Rust game engine for Laravel Rust

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages