Chapter 15Combat Systems and Loot

Writing spawn functions for every item, monster, or other entity you think up can take time, and waiting for your game to recompile so that you can test those new ideas is not fun. But don’t worry, there’s something that can help: data-driven design.

With data-driven design, instead of hard-coding entities into your game’s source code, you specify these entities in a data file, which gets read when the game generates a new level. This type of setup allows you to rapidly test new ideas.

Terminology Time

images/aside-icons/info.png

A data-driven design loads as much data as possible from data files, and then it uses that data to populate ...

Get Hands-on Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.