Getting Started with Fyrox: Rust Game Engine Development Guide

What is Fyrox?

Fyrox is a feature-rich, production-ready, general-purpose 2D/3D game engine written entirely in Rust. Unlike many Rust game frameworks that provide only low-level building blocks, Fyrox includes a full-featured visual editor called FyroxEd, making it comparable to engines like Godot or Unity in terms of workflow. It is MIT-licensed, free to use, and runs on Windows, macOS, Linux, and WebAssembly.

What sets Fyrox apart from other engines is its foundation in Rust. The engine consists of over 35 specialized crates covering graphics rendering, HRTF spatial audio, skeletal animation with blending, behavior trees for AI, an inventory system, a dialog system, autotiling, and much more. Every component benefits from Rust's memory safety guarantees and zero-cost abstractions.

Why Rust for Game Development?

Rust brings several compelling advantages to game development:

Fyrox uses a pool-based memory model instead of Entity Component System (ECS). Objects are stored in generational pools, which provide cache-friendly access and predictable performance while being more intuitive for developers coming from traditional object-oriented engines. Each node in the scene graph is referenced by a Handle<Node>, which is a generational index into the pool.

Installing Fyrox and Creating Your First Project

Prerequisites

Before installing Fyrox, make sure you have the following:

Installing the Fyrox Template Tool

Fyrox provides a project template tool called fyrox-template that scaffolds new projects with the correct directory structure:

Terminal
cargo install fyrox-template

This installs the fyrox-template command globally. You only need to do this once (or when you want to update it).

Creating a New Project

Generate a new project with the following command:

Terminal
# Create a new Fyrox project
fyrox-template init --name my-game --style 3d

# Navigate into the project
cd my-game

The --style flag accepts 2d or 3d. This generates a workspace with three crates:

CratePurpose
game/Your game logic, scripts, and plugins
editor/Custom editor build that includes your plugins
executor/The final game executable (standalone, without editor)

Running the Editor

Launch the Fyrox editor with:

Terminal
cargo run --package editor --release
Note: First build takes time

The first compilation will take several minutes as Cargo downloads and compiles all dependencies. Subsequent builds are incremental and much faster. Using --release for the editor is recommended for comfortable editing performance.

Understanding the Editor (FyroxEd)

FyroxEd is Fyrox's built-in visual editor. It provides a complete game development environment with panels for scene editing, asset management, and property inspection. Here are the key areas you will work with:

Scene Viewport

The central viewport displays your 3D or 2D scene. You can navigate using:

World Outliner

The World Outliner (left panel) shows the scene tree hierarchy. Every object in your scene is a node in this tree. You can drag nodes to reparent them, right-click for context menus, and double-click to rename. The hierarchy determines transform inheritance: child nodes inherit their parent's position, rotation, and scale.

Inspector Panel

When you select a node, the Inspector (right panel) shows all its properties. This includes transform (position, rotation, scale), node-specific properties (mesh data, light color, camera FOV), and any script properties you have defined. Every property change goes through the editor's command system, so everything is undoable with Ctrl+Z.

Asset Browser

The Asset Browser (bottom panel) displays files in your project directory. You can drag assets like 3D models (.fbx, .gltf, .glb), textures (.png, .jpg), and audio files (.ogg, .wav) directly into the scene viewport or onto node properties in the Inspector.

Console and Log

The Console panel shows engine messages, warnings, and errors. When running your game from the editor, print statements and log output appear here. Keep an eye on this panel during development for early detection of issues.

Scene Structure and Nodes

In Fyrox, everything in a scene is a node. A scene is essentially a tree of nodes, where each node has a type that determines its behavior. Understanding the available node types is fundamental to building games in Fyrox.

Core Node Types

Scene Files

Fyrox scenes are saved as .fyrox files, which use a human-readable text-based serialization format. Unlike binary scene formats in some engines, you can inspect and diff Fyrox scene files in version control, though manual editing is not recommended.

Tip: Scene Composition

Fyrox supports scene instancing, similar to prefabs in Unity or packed scenes in Godot. You can create a scene (e.g., a player character with all its child nodes), save it, and then instance it into other scenes. Changes to the source scene automatically propagate to all instances.

Writing Your First Script

Scripts in Fyrox are written in Rust. They are defined as structs that implement the ScriptTrait. Scripts are attached to nodes and receive lifecycle callbacks similar to _ready() and _process() in Godot or Start() and Update() in Unity.

Creating a Rotation Script

Let us create a simple script that rotates a node around the Y axis. In game/src/lib.rs, add the following:

game/src/lib.rs
use fyrox::{
    core::{
        algebra::UnitQuaternion,
        pool::Handle,
        reflect::prelude::*,
        type_traits::prelude::*,
        visitor::prelude::*,
    },
    event::Event,
    script::{ScriptContext, ScriptTrait},
    scene::node::Node,
};

#[derive(Visit, Reflect, Default, Debug, Clone, TypeUuidProvider, ComponentProvider)]
#[type_uuid(id = "a9fb15d2-5c8a-4b5e-9b6e-d78e14a3f47c")]
pub struct Rotator {
    /// Rotation speed in radians per second
    #[reflect(min_value = 0.0, max_value = 10.0)]
    pub speed: f32,
}

impl ScriptTrait for Rotator {
    fn on_init(&mut self, ctx: &mut ScriptContext) {
        // Called once when the script is initialized
        fyrox::core::log::Log::info("Rotator script initialized!");
    }

    fn on_update(&mut self, ctx: &mut ScriptContext) {
        // Called every frame
        let dt = ctx.dt;
        let transform = ctx.scene.graph[ctx.handle]
            .local_transform_mut();

        // Rotate around the Y axis
        let rotation = UnitQuaternion::from_axis_angle(
            &fyrox::core::algebra::Vector3::y_axis(),
            self.speed * dt,
        );

        let current = *transform.rotation();
        transform.set_rotation(current * rotation);
    }
}

Registering the Script

Scripts must be registered with the engine so the editor can find them. In your game/src/lib.rs, make sure your plugin's register method includes:

game/src/lib.rs (Plugin registration)
impl Plugin for Game {
    fn register(&self, context: PluginRegistrationContext) {
        context
            .serialization_context
            .script_constructors
            .add::<Rotator>("Rotator");
    }

    // ... other methods
}

Attaching the Script in the Editor

After rebuilding the editor (cargo run --package editor --release), you can attach the script to any node:

  1. Select a node in the World Outliner (for example, a Mesh node).
  2. In the Inspector panel, scroll to the Scripts section.
  3. Click Add Script and select Rotator from the dropdown.
  4. Set the speed property to a value like 1.0 (one full radian per second).
  5. Press the Play button or Ctrl+P to run the game and see the node rotating.
Understanding the Reflect and Visit macros

The #[derive(Reflect)] macro exposes your struct fields to the editor Inspector, allowing visual editing. The #[derive(Visit)] macro enables serialization so the editor can save and load your script properties. Together, they provide the bridge between your Rust code and the visual editor.

Accessing Other Nodes

To reference other nodes in the scene, use Handle<Node> fields in your script. The editor will show a node picker widget:

Rust
#[derive(Visit, Reflect, Default, Debug, Clone, TypeUuidProvider, ComponentProvider)]
#[type_uuid(id = "b2c3d4e5-f6a7-8901-2345-6789abcdef01")]
pub struct Follower {
    pub target: Handle<Node>,
    pub follow_speed: f32,
}

impl ScriptTrait for Follower {
    fn on_update(&mut self, ctx: &mut ScriptContext) {
        if self.target.is_some() {
            let target_pos = ctx.scene.graph[self.target]
                .global_position();
            let current_pos = ctx.scene.graph[ctx.handle]
                .global_position();

            let direction = target_pos - current_pos;
            let movement = direction.normalize() * self.follow_speed * ctx.dt;

            ctx.scene.graph[ctx.handle]
                .local_transform_mut()
                .offset(movement);
        }
    }
}

Building and Running Your Game

Fyrox separates the editor and the final game executable:

For distribution, build the executor in release mode:

Terminal
cargo build --package executor --release

The resulting binary will be in target/release/. Ship it alongside your data/ folder containing scenes, textures, and other assets.

Accelerating Development with Fyrox MCP Pro

While the Fyrox editor is powerful on its own, development speed increases dramatically when you combine it with AI assistance. Fyrox MCP Pro is the first and only MCP (Model Context Protocol) integration for Fyrox, connecting Claude Code directly to your running editor.

What Can AI Do with Fyrox MCP Pro?

With 20 specialized tools, Claude Code can control the Fyrox editor in real time:

Every operation goes through the editor's Command pattern, so all AI-made changes are fully undoable with Ctrl+Z. You stay in complete control.

Example Workflow

Imagine you are prototyping a level. Instead of manually placing dozens of objects, you tell Claude:

Claude Code conversation
> Create a new scene called "dungeon_room". Add a directional light
  pointing downward. Then create a 5x5 grid of cube meshes spaced
  2 units apart to serve as floor tiles. Add a point light with
  warm orange color at the center, 3 units above the floor.

Claude uses the MCP tools to execute each step in the editor: creating the scene, adding the light, spawning 25 cube meshes at calculated positions, and placing the point light. What would take 10 minutes of clicking is done in seconds.

Setting Up Fyrox MCP Pro

Setup takes about 5 minutes:

  1. Add the fyrox-mcp-bridge crate to your editor's Cargo.toml and register the McpBridgePlugin.
  2. Build the MCP server: cd fyrox-mcp-server && npm install && npm run build
  3. Add to Claude Code: claude mcp add fyrox -- node /path/to/fyrox-mcp-server/dist/index.js

Once configured, the bridge plugin starts a WebSocket server inside the editor, and Claude Code connects to it automatically when you start a conversation.

Ready to Build Games Faster with AI?

Fyrox MCP Pro gives Claude Code direct access to the Fyrox editor. 20 tools, full undo/redo, $5 one-time purchase.

Get Fyrox MCP Pro — $5

Resources and Community

The Fyrox community is welcoming and active. Here are the essential resources for getting help and learning more:

Recommended Learning Path

  1. Complete the Fyrox Book introduction chapters.
  2. Build a small project (a turntable viewer or simple platformer) to get comfortable with the editor and scripting workflow.
  3. Study the examples/ directory in the Fyrox GitHub repository for patterns and best practices.
  4. Join the Discord community for feedback on your projects.
  5. Set up Fyrox MCP Pro to accelerate iteration with AI assistance.

Fyrox is a rapidly maturing engine with a unique position in the game development landscape: full Rust safety, a comprehensive visual editor, and now AI integration. Whether you are an experienced Rust developer exploring game development or a game developer interested in Rust's advantages, Fyrox is worth your attention.