I love Rust! It is fast, flexible and the compiler is always telling me what I’m doing wrong. Once my code compiles, it actually works (mostly).

Also I like game development. This is what was driving me to learn programming as a child. Now, 20 years later, I didn’t finish a good but but I made some mini games as the ludum dare compo.

So I was very happy when I stubled over the Amethyst engine. It’s an ECS game engine which is written completely in Rust.

What is ECS?

It means Entity Component System. You basically have a World where you can add Entities. To the Entities, you can assign Components which can be a screen position, a bounding rect, an image to draw, etc. Finally Systems will iterate over all entities which have specific components assigned and can modify them.

For example, one could build a MoveSystem which iterates over all Entities which have a SpeedComponent and a ScreenPositionComponent assigned and modify the ScreenPositionComponent based on the SpeedComponent.

With this, all data (= Component) is encapsulated from the the logic (= System). And the ability to add several Systems to the engine allows to only take care of one specific task in each system. For example, there can be systems for user input, movement, sword attack, animations, audio, etc.

On the one hand, this allows to easily enhance the game. If a new feature is required, simply add a new System. Additinally, the engine claims that iterating over the Entitie’s Components can be optimized and is very fast. It’s also possible to do this parallel while Rusts borrow checker makes sure, that everything is still safe.

What is my plan?

The plan is to make a simple game with Amethyst. I will post updates on the status of the game. Please note that I’m not a professional game developer and my code will contain some bad practices. If you are an expert and you see that I do something terribly wrong or if there is a better way to do something, please let me know. This will allow me to learn and I will add a note in my blog post then.