Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: Integrating JSON and Loading a Level

In last week’s report, I was starting to figure out how to best configure a map editor so that I could have an easier time loading dungeon levels in The Dungeon Under My House, my non-violent, first-person role-playing game and my second Freshly Squeezed Entertainment project.

I started the week hoping to make up for the previous week’s lack of effort.

Sprint 2024-13: Level editor

Planned and incomplete:

  • Create level editor

While I was more productive this week, I was still struggling to make time for game development due to other obligations, plus dealing with an unusual amount of ennui.

My main goal was to get my map in Tiled, which is exported in JSON, into the game as my dungeon level data.

I decided to use nlohmann’s single-header JSON library, partly because I figured it would be easiest to integrate into my project.

The documentation mentions ways to integrate it into a build using CMake or other build tools, but I think that might be for more complex situations.

What’s nice is that I can easily use the JSON library to create in-memory JSON to use in unit tests, allowing me to test drive my DungeonLoader code. Then, once I’m satisfied that the code works, I can easily use the same JSON library to load the level JSON file, pass in the JSON data, and expect it to work perfectly.

I imagine if I had a few more hours to dedicate to it last week that I could have finished the loader code. Maybe this coming week I’ll be able to be more focused and productive.

Thanks for reading!

Want to learn when I release The Dungeon Under My House, or about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and download the full color Player’s Guides to my existing and future games for free!

One reply on “Freshly Squeezed Progress Report: Integrating JSON and Loading a Level”

Comments are closed.