Jump to ratings and reviews
Rate this book

Hands-on Rust: Effective Learning through 2D Game Development and Play

Rate this book
Rust is an exciting programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters. With Rust, you have a shiny new playground where your game ideas can flourish.

Each chapter in this book presents hands-on, practical projects that take you on a journey from “Hello, World” to building a full dungeon crawler game. Start by setting up Rust and getting comfortable with your development environment. Learn the language basics with practical examples as you make your own version of Flappy Bird. Discover what it takes to randomly generate dungeons and populate them with monsters as you build a complete dungeon crawl game. Run game systems concurrently for high-performance and fast game-play, while retaining the ability to debug your program. Unleash your creativity with magical items, tougher monsters, and intricate dungeon design. Add layered graphics and polish your game with style.

325 pages, Paperback

Published January 1, 2021

23 people are currently reading
186 people want to read

About the author

Herbert Wolverson

5 books10 followers
I was born in Surrey, England. My father brought home a BBC Micro, and I've been writing games ever since - first in BBC BASIC, then Pascal, C, C++ and a host of other languages. I've been releasing games and articles since the early 1990s. I also do consulting work and help maintain a Wireless Internet Service Provider in Missouri, USA.

After releasing The Rust Roguelike Tutorial, I started working with Pragmatic Publisher to release Hands-On Rust. It's currently in beta (the beta gets you updated ebooks as they are released, and you can go to devtalk to submit errata), with a final release expected in 2021.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
49 (52%)
4 stars
30 (31%)
3 stars
15 (15%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 27 of 27 reviews
6 reviews3 followers
September 10, 2021
A bit about myself, because I think in programming books it's important to know where the reviewer is starting from: I have been writting code for around 20 years, the last 10 mostly as data scientist. I have never done Rust before, so I was starting Rust from 0 with the book. I have also never done GameDev, beyond a few things here and there as a hobbyist, mostly with Python and Godot, but nothing serious.

So let's so into the book, as the title says "Hands-on Rust" in big, I guess the main idea of the book is to teach you Rust. Then it says "effect learning through 2d Game Dev". Which i think it's interesting to teach someone a programming language using a direct application, and not the usual row of chapters covering the different topics.

But I think it is important to have in mind that the book tries to do 2 things: to teach you Rust from scratch, and to teach you GameDev from scratch. To teach you about GameDev, the author uses his own library, which is called "bracket-lib". This library is also used in a very hands-on way. Not really going into detail. So we can say the book tries to teach you 3 things: Rust, GameDev, and Braketlib.

Chapters 1-2 focus only on teaching you a bit of Rust. I found Rust to be a complex programming language, so a few times I had to check on the on-line Rust book (the official one) to understand stuff.

Chapter 3 uses what you learned, plus a bit of braket lib, to build a flappy bird game.

Chapter 4/5 are similar, but now finally building a roguelike game, or a "dungeon crawler". I thought up to this point the book was really good.

Chapter 6, suddenly the learning curve gets really steep. In order to build a more "professional" game, the author decides to use an ECS pattern (Entity Component System). And this is going to be implemented through the Rust package Legion, which seems to be an ECS. Half of chapter 6 is about rewritting thing you did before, and I really didnt understand what was going on.

if up to this point you were learning about rust, gamedev and braket lib,
now you are learning about rust, gamedev, bracket lib, ECS and legion.

I found it was too much, and I found myself not understanding the code, and copy pasting it. While before I understood every line, now I did not. Specially things related to ECS/legion. I found myself more learning about that, than learning about Rust.

Perhaps it is my fault, but I thought the book suddenly tried to tech you too many different things in different directions. I think perhaps the author should had kept out ECS and focused the book more on rust and simpler gamedev. Or perhaps require a good level of rust and focus more on ECS and gamedev. But as I said, this is more my personal opinion.

As some other reviewer said, I am not sure this is a good book to learn rust from scratch. It think it would be much better if the reader had some knowledge and used this book to complement. As someone with 0 rust knowledge, and I am really struggling and feeling a bit overwhelmed.

The book itself looks really nice, with colour pages, high quality images. And I think the author did an excellent job putting it all together.
Profile Image for Bugzmanov.
231 reviews92 followers
March 1, 2021
DISCLAIMER: this review is based on B5 version of BETA release.

I would put this book in the category of inspirational readings. The main promise is that creating games is fun and not that hard. It proves a point that its easy to create something playable that you can brag about on cocktail parties. (SIDENOTE: i find it funny that flappy bird became the "hello world" of the gamedev, the same way a "to-do" app is a hello-world of web development)

And then the book goes through sketching architectures popular in gamedev, introducing frameworks and detailing the most important aspects of game design. Don't expect to come out as a pro game designer or game developer after reading this book. But the book can and will ignite the interest in gamedev.

Rust is a promising language for gamedev, even though there are no "serious" big game built in it at the moment. (https://arewegameyet.rs/#games)
I don't think this book should be used for learning rust though (rust is a big language and require effort), but can be perfect "second" book on rust, to get more practice and put things in motion.
8 reviews12 followers
February 17, 2022
Really enjoyed working through this book, though as an intro to Rust it is probably not for the faint of heart. Other books are better intros. As an intro to ECS, Entity Component Systems, of which most games are made though, I think it was pretty fantastic.

So, 5 out of 5, for ECS. Docking a point, because even though it was fun to use Rust for that, it was a head scratcher at times and I don't believe I am a slouch at coding or how to work stuff out (or times when code was refactored/removed but it was not so clear.).

I also would have liked if it had used one of the main Rust ECS systems, Amethyst or Bevy, rather than bracket-lib as now I feel I have to learn their quirks before I can just roll my sleeves up and dive in.

That said... Really liked it though. Author did a very good job and I normally hate most coding books. Recommended.

(also, would *love* to see the exact same sort of book written for Go Lang and Ebiten as I am still trying to figure out which would be best for my project(s).).
Profile Image for Charlie Harrington.
206 reviews16 followers
February 28, 2022
You’re in a dungeon for most of the book, but it’s one that you’ve learned how to build — and hopefully escape alive. Very approachable introduction to Rust, leaving me wanting more. I’m looking forward to shipping my dungeon game via WASM as a next step.
Profile Image for Juhamatti.
6 reviews2 followers
July 11, 2021
Inspiring read about core game design concepts and entity component system based software architecture.

Rust was used to showcase how great fit it is for solving these kind of problems.
Profile Image for Jan David.
6 reviews
March 4, 2022
I consider myself an intermediate Rust programmer, and have read both The Rust Programming Language and Programming Rust: Fast, Safe Systems Development in the past. My primary interest when picking up this book was to learn more about game development in Rust, so I am probably not the target audience the author had intended.

The book is structured really well and covers a lot of topics. The content builds on the previous chapters, which doesn't overwhelm the reader and creates a sense of progression. The fact that each chapter ends with a working game is also very motivating. I can't speak how well the book introduces Rust as a programming language, since I was already familiar with the concepts presented in the book.

I feel like I have a much better understanding of some 2D game development concepts now. I tried experimenting with the Bevy engine in the past, and often got stuck on some very fundamental problems. Reading this book has given me a lot of ideas on how to solve these issues, which I consider a great success.

What I didn't like about the book is the example project. The dungeon crawler felt very rough around the edges to me, making it difficult to get excited about it. While I can see how making it turn-based simplifies a lot of things, it just didn't work as a game mechanic for me. And I ended up reorganizing and refactoring a lot of code, because I found the examples in the book overly complex and hard to read.

In summary, this is probably a fun book for someone who wants to learn Rust in a playful way. It is also a nice introduction into game development in Rust for novices like me. But the more you know about either Rust or game development, the more you'll notice that you're not the target audience for this book...
7 reviews
June 18, 2022
All the fun!

No, really!

Learning Rust can feel a bit daunting, it has many concepts that are foreign, especially if you come from a Java or C# background. What Herbert did here is make learning Rust concepts a lot of fun. In fact, by the time you are done with the book, you will have learned a lot of basic and more advanced Rust concepts, without even having realised it.

Writing and playing 2D games is an excellent way of coming to grips with the language, the tools, the ecosystem and the concepts that all make Rust what it is. Herbert also provides some online bonus content, where you take your games and make them run on the web!

I found Hands-on Rust to be such a great starter book and it made a ton of sense right after doing the standard Rust tutorials. The fact that you learn quite a bit about game programming along the way is also a nice bonus!

If you haven't decided whether Rust is for you yet, this is the book that can give you everything you need to make that decision. Work through the book, build the games and see if Rust resonates with you.

After you are done with Hands-on Rust, you will have sufficient know-how to easily pick up more advanced Rust books and make the most of them.

Herbert, you made learning Rust fun, thank you!
3 reviews
December 12, 2022
More of an introduction to game dev than to Rust, but certainly an enjoyable and educational read. Money well spent, though there are aspects that could be improved:

Foremost, some non-obvious aspects of the Legion framework and the use of references. Some queries outright crash without any indication of what you're doing wrong. You might not run into these things if you just copy the code, but if you reconstruct each chapter from memory, you're likely to run into this. The component access macros are similar. Sometimes forgetting one will cause unexplained crashes, sometimes it'll lead to hard-to-debug runtime behavior. Drawing attention to these pitfalls would make for a smoother ride.

Traits are also somewhat underexplained. The book often tells you which traits you need, but doesn't really detail why you need them.

That said, I started out knowing very little Rust and nothing about game dev. Now I'd say I'm an advanced beginner in both. That's good progress and the journey was a lot of fun. I'd recommend absolute newcomers learning Rust for fun to do the first few chapters of The Rust Book, then this book.
70 reviews
January 30, 2023
First, I'm a professional software engineer. I was interested in this book because I've been interested in learning Rust, and what better way to learn than writing a video game! But I'm a little torn on this book. Overall, it did give me a project to work through while learning Rust. It was mostly well written. Where I felt it fell short was that it sometimes didn't go deep enough into the Rust language and there were a few errors in some of the writing that made it very confusing at times. I spent quite a bit of time on the Rust website reading their documentation. While I was able to work my way around the problems and get the games to work, someone with less experience may struggle more or even give up. I was also frustrated with the inconsistent code formatting. I'm kind-of a stickler for consistency in code. In the same code snippet a variable would be defined something like, "variable_name: type", and another like, "variable_name : type". That is just one example.

Overall, I would recommend the book to anyone interested in Rust and video games. I would just suggest some patience when the game doesn't run, even when coded exactly as described in the text.
Profile Image for Frank Deming.
85 reviews5 followers
September 14, 2021
This book is a wonderful book introducing the topic of creating games with the ECS, Entity-Component-Systems, methodology. Each chapter is well focused and laid out. The code examples are downloadable but you are encouraged to type it in. I am quite happy now to proceed with expanding on the code that I have entered

The downside is this is just a survey on Rust the language. Programmers new to Rust , particularly if not familiar with C++ syntax, can be lost. Typos could be difficult to debug. Read "The Rust Progamming Language" by Klabnik & Nichols to help. Programming Rust by Blandy can be nice alternative to help out because it has well laid out references material on iterative functions which is key to the Code in Hands-on Rust. Understanding closures is key to using the iterative functions.
Profile Image for Bruno.
19 reviews1 follower
July 11, 2022
This is a superb book! I had loads of fun following it and the Dungeon Crawler (roguelike) that you end with is actually cute and fun and have tons of ways one can spend more time toying with :)

It was a good overview of many Rust things, but I do believe it'll be better enjoyed by folks with some GameDev knowledge already, as it might get confusing for someone trying to understand at the same time the Rust stuff and the GameDev patterns (like ECS).

There was one thing that I feel like it was missing from this book and I would love to see in a 2nd edition and it is about testing the code written. No need to test everything, but there is plenty of logic that is very easy to break and there is absolutely no pointers even in how to write a unit test in Rust unfortunately (even more on how to write good/proper tests with the ECS system, etc).
Profile Image for Matthew Stagg.
26 reviews1 follower
March 1, 2024
After working through the rust bible (which was excellent), I picked up this book. I was hoping to get more comfortable working with rust while doing some interactive projects like games.

Somewhere along the way I just... stopped enjoying the process. Rust is not really a fun language to work with. It is powerful and solves many of the problems I have with other systems languages. However, the syntax and the complexity means the language is very hard to use as a "hobby" or "toy" language. I see the value professionally, if I was working with it everyday and could internalize all the rust-y quirks.

The book was good, if a bit dry. I think I have just evolved beyond basic tutorial exercises at this point in my career. Abandoned halfway through when I realized I could better spend my time on other projects.
Profile Image for Kurt Schwind.
32 reviews
January 31, 2022
I think it's a solid book. If your goal is to learn a lot about Rust, I'd give it a 2 or 3. If your goal is to learn a lot about Rust with Legion Entity Component System (ECS), I'd give it 4 stars. I was happy to work through all the examples and build the game, but so much of what's in there is very specific to the legion ECS and not really Rust concepts as a whole. Still, I'm glad I went through the book because framing things in terms of ECS made things easier for me because I've had experience with other ECS libraries and engines. I just sort of wish it dug in a bit more into Rust concepts. Lifetimes, for example, are very briefly mentioned but are one of the more unusual aspects of the Rust language.
Profile Image for Nathaniel Inman.
42 reviews2 followers
June 1, 2022
Although not the most performant, the code described within is a practical approach to game development with a leaning towards functional programming. Perhaps it could be better titled as "beginners roguelike development in rust"; though it does have a couple examples of simpler games. Although no additional effort is used to describe sophisticated algorithms for procedural generation, permissive fov, shadow casting, a* pathfinding or even bresenhams line algorithm it somehow finds usage of cellular automata, drunken walk and other common algorithms in a friendly and approachable way to newer devs. Overall this is a great "learn by example" approach particularly helpful for existing game developers or general software engineers of other languages.
1 review
November 30, 2022
I thought this was a very cool way to introduce Rust, an interesting structural paradigm for applications, and game design/implementation. To be fair, this is more about game design and implementation than it is about Rust .. outside of teaching you Rust. Most languages are fairly easy to learn (Rust, Haskell, Clojure, C/C++, Java, etc.) and Rust is not really that different in terms of difficulty. Having a real goal that was fun made it easy to absorb.
Profile Image for Fotis Koutoulakis.
117 reviews13 followers
December 30, 2022
Very solid, if a bit light on the explanations on the Rust side of it.

I very much enjoyed it as a project that produces full working code for a small system in Rust (the end game is about 2k loc of Rust.

Useful as a book for someone who already knows some Rust and wants to understand how it fits together as a cohesive whole inside a project. I wouldn't recommend for a beginner's Rust book though.
Profile Image for PRJ Greenwell.
736 reviews13 followers
May 30, 2022
I don't think I learned any more about Rust after finishing this book, but I certainly learned something about game design - that right there is worth the three stars I've given. As a Rust how-to, it introduces too much too soon and I'd recommend other guides on the language if you're learning it.

But it's definitely engaging material as a game-making guide.
Profile Image for Ricardo Signes.
69 reviews6 followers
November 29, 2023
This book had a bunch of problems, or maybe just one or two problems that I hit a lot. On the other hand, it's pretty unusual and interesting and I found it compelling and helpful. I would rather have this book available than not, and I think a second edition could really shine. So, I am rounding up. :)
Profile Image for Mike Zornek.
60 reviews7 followers
September 15, 2021
I only finished the first half of this book since my vacation time was over and I needed to move on to other things. That said, I really enjoyed the book and it's a great find for people with these shared interests.
Profile Image for Ivan Koma.
383 reviews1 follower
May 30, 2022
Really not bad and can help introduce to Rust, but you need some programming background at first
At the end fell exhausted but game finished
22 reviews
November 5, 2022
Rust'ın temel ve orta seviye kabiliyetlerini oyun geliştirme aracılığıyla, eğlenceli bir şekilde öğrenmek için güzel bir kaynak. Ayrıca ECS kavramlarını da güzel bir şekilde aktarıyor.
Profile Image for Spec.
7 reviews
December 21, 2022
I learned so much about game development with this, not just rust! It was truly fantastic and rewarding following along.
Profile Image for Sergey Shishkin.
162 reviews49 followers
June 3, 2024
I could not finish the book. It's a good book, but I somehow lost interest interest in the second half. The book became more about the specific game framework than about the Rust language.
Profile Image for Austin Routt.
1 review
January 19, 2023
A good "paint-by-number" introduction to the Rust programming language, roguelikes, and entity-component-systems. Although by the end you won't feel like a master of these, you will have a working knowledge of them and a basic roguelike codebase to expand upon. It's a good book for those who prefer light introductions and projects. Also, I see a lot of reuse potential out of this book, as I plan to continue developing the game this book began.
Displaying 1 - 27 of 27 reviews

Can't find what you're looking for?

Get help and learn more about the design.