---
title: "onegame"
url: https://recursiveai.org/onegame/
description: "A C#-native game engine with no editor. A game is plain C# plus text assets, checked at build time by source generators and analyzers, with sync between clients and servers built in. Build, run, test, capture and replay games from a terminal. Windows, Linux, macOS, Android, iOS and the web. MIT or Apache-2.0."
---

# onegame

A C#-native game engine with no editor: a game is plain C# plus text assets. Build, run, test, capture and replay it from a terminal.

```sh
dotnet tool install -g RecursiveAI.OneGame.Cli
```

- [Getting started](https://recursiveai.org/onegame/docs/getting-started/)
- [Docs](https://recursiveai.org/onegame/docs/)
- [Cookbook](https://recursiveai.org/onegame/cookbook/)
- [Articles](https://recursiveai.org/onegame/articles/)
- [GitHub](https://github.com/recursive-ai-oss/onegame)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneGame.Cli)

## A quick look

One class holds an entity’s synced state, its commands, its deterministic simulation and its view. The generator writes the change tracking, codecs, deltas and snapshots; the analyzers turn the rules into compile errors.

[Your first game, line by line](https://recursiveai.org/onegame/docs/first-game/)

*Counter.cs · C#*

```
[Entity]
public partial class Counter : Entity
{
    [Synced] public partial int Count { get; private set; }
    [Synced] public partial int Ticks { get; private set; }
 
    [Command]
    public void Increment(int by) => Count += by;
 
    protected override void OnTick() => Ticks++;
 
    // View code reads state and never writes it.
    [View]
    public string Label() => $"Count: {Count}";
}
```

### Rules enforced at build time

Entities, sync, rendering and UI are generated or checked by Roslyn source generators and analyzers. Warnings are errors, and every shipping project is AOT- and trim-checked.

### Sync built in

Clients and servers run the same stack, so state syncs between processes, with prediction, authority transfer and drift detection.

### Driven from a terminal

A command line, a C# test API and a live-control protocol (MCP) build, run, inspect, capture and replay games, with scenarios as tests.

### Runs where players are

Windows, Linux (X11, Wayland and the Steam Deck), macOS, Android, iOS and the web through WebGPU. Everything is NativeAOT- and trim-clean.

## New, run, test, export

You need the .NET 10 SDK and nothing else. `onegame new` writes a project on the `RecursiveAI.OneGame.Sdk` MSBuild SDK, which brings the engine from nuget.org at the same version as the tool.

[Scenarios, replays and live control](https://recursiveai.org/onegame/docs/driving-a-game/)

*Terminal · sh*

```
dotnet tool install -g RecursiveAI.OneGame.Cli
onegame new mygame
cd mygame
onegame run --headless --frames 60 --json
onegame test --json
onegame export --target linux
```

## The packages

- **The command**: `RecursiveAI.OneGame.Cli` is the `onegame` command, a dotnet tool: create, build, run, test, capture and replay games.
- **The SDK**: `RecursiveAI.OneGame.Sdk` is an MSBuild SDK for games. It brings the engine libraries, the analyzers, the development tools of Debug builds and the export targets.
- **The engine**: 28 packages in all, one per area: entities and sync, networking and dedicated servers, graphics on Vulkan, Metal and WebGPU, 2D and physically based 3D rendering, glTF import, UI and text, platform and audio output, in-app purchases and Steam, and testing and live control.
- **2D and input**: Views draw sprites, sprite sheets, shapes and text through `Draw2D`, from pictures that hot-reload while the game runs. Input is declared as actions that answer the keyboard, gamepads and tests alike.
- **Built on**: Shaders are compiled during the build by [oneshader](https://recursiveai.org/oneshader/), and audio decoding and mixing come from [oneaudio](https://recursiveai.org/oneaudio/).
- **Exports**: Windows, Linux and macOS builds from the packages alone. Web, Android and iOS exports and plugin servers build from an engine checkout.
- **Samples**: Sample games in the repository, each with scenarios and a README.
- **Version**: 1.2.0, the same for every package.
- **.NET**: .NET 10. NativeAOT and trimming are supported. MIT or Apache-2.0.

## Go further

- [GitHub](https://github.com/recursive-ai-oss/onegame)
- [NuGet](https://www.nuget.org/packages/RecursiveAI.OneGame.Cli)
- [Your first game](https://recursiveai.org/onegame/docs/first-game/)
- [Driving a game](https://recursiveai.org/onegame/docs/driving-a-game/)
- [UI guide](https://recursiveai.org/onegame/docs/ui-guide/)
- [Exporting](https://recursiveai.org/onegame/docs/exporting/)
- [Devices](https://recursiveai.org/onegame/docs/devices/)
- [Changelog](https://recursiveai.org/onegame/docs/changelog/)
