Chapter 6 Compose Dungeon Denizens
Hands-on Rust — by Herbert Wolverson (50 / 120)
👈 Wrap-Up | TOC | Understanding Terminology 👉
In the previous chapter, you created the beginnings of a dungeon crawler. You added a random map, an adventurer to roam the dungeon, and collision detection to prevent the player from walking through walls. You also took your first steps into programmer art and layered graphics. In this chapter, you’ll learn a popular approach to managing game state — the data that represents your game’s world simulation.
Games can have a lot of data: every monster, every item, every little graphical effect needs to be stored somewhere in your computer’s memory. In the past, games employed various techniques to handle the resulting combinatorial explosion of data. An increasingly popular approach to managing game data is the Entity Component System (ECS) architecture. It efficiently handles large amounts of data and is becoming the de facto standard for large engines such as Unity and Godot (Unreal Engine uses a similar system with components, but without separate systems). Rust is a great fit for ECS-driven game development, and you can find several great ECS systems available in the crates system. For this book, you’ll use Legion — an open source, high-performance ECS included for free in the Rust crates library.[51]
👈 Wrap-Up | TOC | Understanding Terminology 👉
Hands-on Rust by Herbert Wolverson can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.