Map Drawer

In GDRL, I use a little Map Drawer to draw & debug my maps.  All the screen shots from yesterday's post were screenshots of the map drawer.

This debug tool is just a scene that hosts the map schema, and i can run the scene to see the results.  there's a `seed` spinbox so I can "scrub" through results.

I have a list of "map_drawer_data" objects that allow me to dictate what is in a bb layer - A grid of cells, a list of cells, a list of rects, etc.  Then I can toggle them off and on to view each layer.


In this example, I generate both a backtrack maze and the mystery dungeon from the previous blog post.  I can visualize all of them at once or individually, and then scrub through potential seeds.

Since the drawer object holds a reference to the map generation resource, I can edit that in the inspector while in the map drawer scene, and that works fine for my needs for now.

Why no `@tool` scripts?  I find these noisy and polluting.  since I have runtime functions on the map generation steps, those would have to be @tools as well, and that brings a whole new layer of mental overhead to reasoning about those scripts.  Right now they are tiny and simple and thats fine, but I've made (literally) this exact mapping tool with both `@tool` scripts & as a plugin, and both bring a lot of tool maintenance that takes away from, you know.  Making a game.  Or writing a blog post!

If I were to expand on this Map Generator / Drawer, I would likely write a whole separate plugin for it - I've done it before!  I'll try to line up a post that has some breakdowns of old tools I've made in godot.  Here's another clip of the Map drawer scrubbing through some Mystery Dungeons.

Mastodon

This article was updated on