Howdy! This book will teach you everything you need to know about building video games and interactive simulations with the Amethyst game engine. This engine is written entirely in Rust, a safe and fast systems programming language, and sports a clean and modern design. More correctly, though, Amethyst is actually a collection of separate libraries and tools that collectively make up a game engine.
Amethyst is free and open source software, distributed under a dual license of MIT and Apache. This means that the engine is given to you at no cost and its source code is completely yours to tinker with. The code is available on GitHub. Contributions and feature requests will always be welcomed!
This book is split into several sections, with this introduction being the first. The others are:
- Getting Started – Prepare your computer for Amethyst development.
- Concepts – An overview of the concepts used in Amethyst. Recommended.
- Pong Tutorial – Build a basic pong game in Rust.
- Math – A quick introduction to doing math with Amethyst.
- Animation – Explains the architecture of the
SystemExecution – Shows you how to structure more complex games that need to change the
- Glossary – Defines special terms used throughout the book.
- Appendix A: Config Files – Shows you how to define your data in RON files.
Read the crate-level API documentation for more details.
Most of us have worked with quite a few game engines over the years, namely Unity, Unreal Engine, JMonkeyEngine and many more. While they all are pretty solid solutions if you want to build a quality game, each have their own pros and cons that you have to weigh before using them, especially in regards to performance and scalability.
We think that basing the Amethyst engine on good and modern principles will allow us to make an open source game engine that can actually be more performant than those engines. Those principles are:
Modularity is at the core of the Unix philosophy, which proved itself to be an excellent way of developing software over the years. You will always be free to use the built-in modules, or to write your own and integrate them easily into the engine. Since modules are small and well integrated, it is easier to reason about what they do and how they relate to other modules.
Modern computers, even cheap ones, all have multithreading with multicore CPUs. We expect that over the years, there will be more and more opportunities for parallelism to improve performance. With a proper parallel engine, we are convinced that your game will be more and more performant over the years without even needing you to update it.
Building your game around the data makes it really easy to prototype and quickly build a game. Complex behaviours like swapping assets during gameplay become a breeze, making testing and balancing a lot faster.
Why use Amethyst?
While there are a lot of great building blocks in the Rust ecosystem, using the Amethyst engine instead of building your own game engine definitely has a lot of advantages.
First of all, the engine is based on the Specs library, which is a common base on which the engine's concepts are built. For a great introduction to game development with Rust and an Entity Component System, see this great talk by Catherine West. Amethyst's take on ECS is described in the concepts section of the book. A lot of features have been glued together using those:
There are the obvious ones:
And also the less known but also essential features:
If you were not to use Amethyst, not only would you need to create all those features (or use pre-existing crates), but you would also need to glue the layers together.
Amethyst does all of this for you, so that you can focus on making your game instead of worrying about the low-level details.
Futhermore, because of the architecture of Amethyst, almost all the parts are both configurable and replaceable. This means that if you do want to change something to suit your needs, there's always a way to do it.
For example, the rodio crate is currently used for the audio features in the engine, but if you would rather use something more complex or a custom solution, all you have to do is add some glue that moves the data coming from Specs into the library that you are using to play and control the audio, without even having to touch the engine code!
We are always happy to welcome new contributors!
To know where to start, we suggest you read our contribution guidelines