Rust for Game Development: Engines, Libraries and Real Games
Rust gives game developers memory safety without a garbage collector, plus engines and libraries for games. Here are the parts that matter.
On this page
Short answer
Rust is a systems language used for game development because it catches memory errors at compile time, runs without a garbage collector, and ships a package manager, Cargo, with thousands of reusable libraries. Teams use engines such as Bevy and Fyrox, add libraries for rendering, physics and audio, and point to finished games such as Veloren and Zemeroth as proof the stack works.
What is Rust for game development?
Rust for game development is the use of the Rust programming language to build games, from small 2D prototypes to large 3D worlds. Rust is a systems language: it runs fast, uses memory carefully, and catches many errors at compile time, before the game ever runs. That matters in games, where a crash in the middle of a session is the worst kind of bug.
The language is only half the story. Rust ships with Cargo, a package manager that fetches reusable libraries, called crates, from a public registry. A team that needs rendering, physics or audio does not write those parts from scratch; it adds a crate, pins a version, and builds on top of it.
| Part | What it is | Examples |
|---|---|---|
| Language | Compiled, memory-safe, no garbage collector | Rust itself |
| Package manager | Fetches and builds reusable libraries | Cargo, crates.io |
| Engines | Full frameworks for building games | Bevy, Fyrox, macroquad, ggez |
| Libraries | Single-purpose crates for one job | wgpu, rapier, rodio, gilrs |
| Finished games | Proof the stack works in practice | Veloren, Zemeroth |
The rest of this guide works through the three parts in order: the engines to compare, the libraries that fill the gaps, and the real games that show what the stack can do.
Which Rust game engines should you compare?
Rust game engines fall into two groups: full engines with an editor and scene system, and light frameworks that give you a window, input and drawing, and leave the rest to you. The right choice depends on the size of the game and how much structure you want the engine to provide.
Bevy is the fullest option: an entity-component engine with a growing editor, used for both 2D and 3D games. Fyrox adds a scene editor and is a good fit for teams that want to lay out levels by hand. Macroquad and ggez are the light end: small, fast to start, and best for 2D prototypes and small games. Godot with godot-rust pairs a mature editor with Rust code for the game logic.
The table below gives a short view of the five; the full comparison, with strengths, weaknesses and a choosing guide, is in the Rust game engines guide, so this article does not repeat it.
| Engine | Shape | Best for |
|---|---|---|
| Bevy | Full engine, entity-component | Bigger 2D and 3D games |
| Fyrox | Full engine with scene editor | Editor-driven development |
| macroquad | Light framework | Fast 2D prototypes |
| ggez | Light framework | Simple structured 2D games |
| Godot + godot-rust | Mature editor, Rust logic | Teams that want an editor |
Which Rust libraries fill the gaps?
Engines do not cover everything, and that is where Rust libraries, called crates, come in. A team that picks a light framework, or that builds its own engine, adds one crate per job: rendering, physics, audio, input and networking. Each crate is small, focused and versioned, so the team can swap one out without rewriting the game.
For rendering, wgpu is the standard choice: it is a Rust implementation of the WebGPU standard that targets modern graphics APIs, with a fallback for older hardware. For physics, rapier handles 2D and 3D collision and rigid bodies, and it is the physics engine inside several Rust games and engines. For game structure, hecs and bevy_ecs provide the entity-component storage that many engines are built on.
Audio and input have their own crates too. Rodio plays sounds and music from files with a small API, and gilrs reads gamepads across platforms so a game works with a controller as well as a keyboard. The table below lists the crates most Rust game teams reach for first.
| Job | Crate | What it does |
|---|---|---|
| Rendering | wgpu | Draws 3D scenes on modern graphics APIs |
| Physics | rapier | Collision, rigid bodies, 2D and 3D |
| Game structure | hecs, bevy_ecs | Entity-component storage for game objects |
| Audio | rodio | Plays sounds and music from files |
| Gamepad input | gilrs | Reads controllers across platforms |
| 2D drawing | macroquad, ggez | Window, input and drawing for 2D games |
What do real Rust games show?
Real games are the best test of a language stack, and Rust has two well-known open-source games that show what it can do. Both are free to play, both publish their source code, and both have been built in public for years, so a team can read the code and see how the pieces fit together.
Veloren is a multiplayer voxel role-playing game written in Rust, inspired by Cube World and Minecraft. It is a large 3D world with towns, dungeons and wildlife, built on a custom engine that uses wgpu for rendering. The project is open source under the GPL-3.0 licence, with weekly builds and a community of volunteers, and it shows that Rust can carry a big 3D game with networking, procedural worlds and many players.
Zemeroth is the opposite end of the scale: a small turn-based hexagonal tactics game written in Rust, with a handful of fighters per battle and short sessions. It started on the ggez engine, later moved to macroquad, and ships a web version that runs in the browser.
Zemeroth shows the small-game path: one developer, a light framework, and a finished game that players can open and play. Together the two games cover the range a new team should expect, from a weekend prototype to a multi-year project.
How do you start a Rust game in 6 steps?
Starting a Rust game is a small project, not a rewrite of an engine. The pattern below works for a first game: pick the smallest version that is fun, build it with an existing engine or framework, and add libraries only when the game needs them.
- Learn enough Rust first. Finish a small command-line program before touching a game, so the borrow checker stops being a surprise.
- Pick the engine for the game you have. A 2D prototype fits macroquad or ggez; a bigger 3D game fits Bevy or Fyrox. The best game development software guide covers the wider choice, including engines outside Rust.
- Build the core loop in one week. One mechanic, one screen, no menus, no save system. If the loop is not fun, no amount of art will fix it.
- Add one library at a time. Rendering first, then physics, then audio, then input. Each addition is one crate and one small test.
- Playtest with real players. Watch someone play without explaining anything, and write down where they get stuck.
- Ship a small version. Put a playable build on itch.io, then decide what to add next from what players actually ask for.
Keep the scope tight for the first version: one loop, one level and one way to lose. More modes, items and levels come after the loop works, because each extra feature is a new system to build and a new place for bugs to hide.
Example (hypothetical): a two-person team builds a 2D game
Example (hypothetical): two developers decide to build a small 2D game in Rust, with 10 weeks and 20 hours each per week. That is 2 people times 10 weeks times 20 hours, or 400 hours in total, and they split it into four blocks before they write any code.
The split is 120 hours for the prototype, 160 hours for the full game, 80 hours for polish and 40 hours for release. The four blocks add up: 120 plus 160 plus 80 plus 40 is 400 hours, which matches the budget exactly.
The prototype takes 6 weeks at 20 hours each, which is 120 hours, and ends with a playable loop: move, shoot, score. The full game takes 8 weeks at 20 hours each, which is 160 hours, and adds levels, enemies and sound. Polish takes 4 weeks at 20 hours each, which is 80 hours, and release takes 2 weeks at 20 hours each, which is 40 hours.
The team finishes on time because the budget was set first and the game was cut to fit it: the second enemy type and the online leaderboard were dropped from the first release. The numbers, not the wish list, decided what shipped.
What are the common mistakes?
The most common Rust game mistakes are building an engine instead of a game, fighting the borrow checker on the wrong problem, and adding libraries before the loop works. Each one is avoidable with a small scope and a playable build early.
- Building an engine first. Writing a custom engine before a game is a second project. Use Bevy, Fyrox or a light framework, and build the game.
- Learning Rust on a game. A game is a hard first Rust project. Write a small command-line tool first, so the language stops slowing you down.
- Adding crates too early. Physics, networking and save systems can wait. A game with no loop gains nothing from a physics engine.
- Ignoring compile times. Large dependency trees slow the edit-test cycle, so pin versions and keep the crate list short.
- Skipping playtests. A game that only its makers have played is untested. Watch a stranger play, and fix what confuses them.
- Chasing a halted project. Some Rust engines stop being maintained, so check the last release date before building on one.
For the wider picture of building with Rust outside games, see how to build a blockchain with Rust, which covers the same language strengths in a different setting.
When is Rust the wrong choice for a game?
Rust is the wrong choice when the team needs a mature editor, a large hiring pool, or a console release on a tight deadline. Rust engines are younger than Unity or Unreal, their editors are thinner, and fewer developers know the language, so hiring and training take longer.
Console support is another gap. Most Rust games target PC, Mac, Linux and the web, where the tooling is open and the build process is simple. Consoles need licensed development kits and platform-specific work, and the Rust tooling for those targets is less mature than the C++ tooling the console makers support directly.
A team that needs to ship fast with artists who expect a full editor, or that must hire five developers this month, will usually move faster with Unity or Unreal.
Rust fits best when the team already knows the language, the game is small to medium in size, and the team values compile-time safety over a big editor. Rust in blockchain development shows the same trade-off in another field, where safety matters more than tooling breadth.
Key takeaways
- Rust catches memory errors at compile time, with no garbage collector
- Bevy and Fyrox are the full engines; macroquad and ggez are the light frameworks
- wgpu, rapier, rodio and gilrs are the crates most teams add first
- Veloren and Zemeroth prove Rust works, from big 3D worlds to small tactics games
- Rust fits best when the team knows the language; Unity or Unreal move faster otherwise
Frequently asked questions
Is Rust good for game development?
Yes, for teams that know the language. Rust catches memory errors at compile time, runs fast without a garbage collector, and has engines such as Bevy and Fyrox plus libraries for rendering, physics and audio. The trade-off is a smaller hiring pool and younger editors than Unity or Unreal.
Which Rust game engine should a beginner pick?
Start with macroquad or ggez for a first 2D game, since both are small, quick to learn and need little setup. Move to Bevy or Fyrox when the game grows past a prototype and needs an entity-component structure or a scene editor.
Can Rust games run on consoles?
Most Rust games target PC, Mac, Linux and the web, where the tooling is open and the build process is simple. Console targets need licensed development kits and platform-specific work, and the Rust tooling there is less mature than the C++ tooling the console makers support.
Do I need to learn Rust before making a game?
Yes, at least the basics. Write a small command-line program first so the borrow checker and the type system stop being surprises. A game is a hard first Rust project, and learning the language on it slows everything down.
Are there finished games written in Rust?
Yes. Veloren is a multiplayer voxel role-playing game with a custom engine, and Zemeroth is a small turn-based hexagonal tactics game with a web version. Both are open source, so a team can read the code and see how the pieces fit together.
Is Rust faster than C++ for games?
Both are fast, and the difference is not the reason to pick one. Rust’s edge is compile-time safety: it catches memory errors before the game runs, which cuts a whole class of crashes. Speed depends on the code, not on the language name.