Level Files and Binary Data
This chapter explores how to load and save JSON-based level files representing the game world. These level files store global properties as well as properties of all the actors and components in the game.
In addition, this chapter explores the trade-offs of using text-based file formats versus binary file formats. As an example, it discusses an implementation of a binary mesh file format.
Level File Loading
To this point, this book hasn’t used a data-driven approach to the placement of objects in the game world. Instead, the
Game::LoadData function code dictates the actors and components in the game, as well as global properties, such as the ambient light. The current approach has several disadvantages, ...