Why Build Dungeon Scrawl V2?

This is the story of what's wrong with Dungeon Scrawl, and why a complete rewrite was desperately needed.

Lockdown had just come into effect in the UK. This was an issue for a final year computer science student such as myself, now locked in my dorm all day every day. I had to find even more creative and (importantly) indoors methods of procrastination. That dissertation wasn't going to not write itself.

I was interested in web development, and now that D&D could only be played online it seemed like a fitting time for the birth of an online RPG map-making tool: Dungeon Sketch!

Through some stroke of incredible luck, a Reddit post demo-ing an early version of the tool hit the front page and Dungeon Sketch was thrust into the spotlight. There was just one problem.

Dungeon Sketch Sucked

The thing about many final year computer science students is that they have no clue how to build good software, and this was especially true of me. Luckily I was not too dispirited by this, being completely unaware of the shoddiness of the code I was writing.

In the post-exams lockdown summer I had enough free time to crank out features with an incredibly high velocity. As time went on, adding features and fixing bugs became harder and harder, and I was running up against performance issues that I couldn't solve.

It was around this time that Dungeon Sketch became Dungeon Scrawl through a Patreon vote. 'Scrawl' is harder to pronounce, especially for people whose first language isn't English, but it has irresistible punny charm.

Hardcore Dungeon Scrawl fans may disagree with such a disparaging view of the tool, but consider the following:

  • In Dungeon Scrawl V1, you cannot see what the currently selected brush is
    Such a simple and useful feature this would be. I developed Dungeon Scrawl without any form of (good) state management. My approach to Dungeon Scrawl's UI was "I'll just slap something together in a day so you can see what you're doing". Combine these and you get bad software! State was all over the place, and the UI had no idea how to access it, modify it, and keep up to date with it.
  • In Dungeon Scrawl V1, the UI looks bad
    I guess this one isn't a show-stopper. But I really don't like the way the UI looks. Putting Material UI in things isn't an excuse to stop using one's brain.
  • In Dungeon Scrawl V1, occasionally an edit will turn the dungeon into a big spidery mess and you have no choice but to undo and try again until it resolves itself.
  • In Dungeon Scrawl V1, a ludicrous number of people have probably never moved the camera (/panned the map) and this is my fault, not their's. At the time I was using CAD software that turned 'space to pan' into muscle memory, and I assumed it was intuitive for everyone else. Narrator: it wasn't. And so the barrage of 'how do I move the map' questions began. I imagine there's an uncomfortably large group of people who have never moved the map. Right/middle click to pan, trackpad gestures, or a dedicated panning tool are some of the obvious ways this could be fixed.
  • In Dungeon Scrawl V1, performance is terrible
    Especially in Chrome. Something to do with Firefox's canvas renderer makes it run Dungeon Scrawl much faster than Chrome.
    My approach was of course to tell everyone to use Firefox. Today, 10% of Dungeon Scrawl users use Firefox (67% use Chrome). I shudder to think of the human hours that have been wasted on Dungeon Scrawl lag.

Let's talk about performance a bit more for a moment. Why does Dungeon Scrawl perform so badly when we have the technology to run 3D games in the browser at 60 fps? The answer comes down to a little thing called the graphics card. The graphics card is good at processing lots of data in parallel, which is useful for rendering things fast. The CPU is a lot less good at processing data in parallel, which is a lot less useful for rendering things fast.

Dungeon Scrawl V1 hates the graphics card. It opts for doing things on the CPU wherever possible which is fine if you're ok with your dungeon drawing tool becoming a lumbering beast that has to switch off hatching every time the map moves because that's too many numbers to deal with at once.

Aside: I am astounded at what people have been able to accomplish with Dungeon Scrawl, despite these limitations. Take a scroll through the map-showoff channel of Dungeon Scrawl's Discord for a taste. There's a strong cohort of talented mapmakers that are pushing the limits of what the tool can do.

Onto V2

There's no salvaging Dungeon Scrawl V1. It's the "throw it away and start from scratch" kind of bad. Luckily for you and I, in the two years since Dungeon Scrawl's release I have been working professionally as a web developer. While this does mean that I have much less time to dedicate to Dungeon Scrawl (which has the status of 'side project' in my life), it also means that I'm improving as a developer which increases the likelihood that the V2 will be good.

So what's new in V2? These are the main items:

  • State management in one place
    There is a single source of truth for application state (e.g. which brush is selected). It's easy to read, modify, and subscribe to. What this means for you is that the UI will be much better than last time.
  • Good undo/redo stack
    In Dungeon Scrawl V1 you can only undo/redo edits to the dungeon shape. In the next version, most actions are undoable (and if they're not undoable, that's by design). For example, adding/deleting a layer can be undone.
  • Good performance
    I'm delighted to report that Dungeon Scrawl will get some use out of your graphics card's fans. Everything is faster: dungeon editing, panning and zooming (which doesn't hide the hatching while you're doing it), loading times.
  • Awesome layers
    I won't go into it too much here, but I'm really excited to get people using the new layers system. It's much more expressive than last time, giving advanced users freedom to go crazy with their own styles.

The important takeaway is that because of the solid foundation (in terms of performance and quality), much more is possible with V2 than V1. For example, a developer-friendly plugin system is feasible. Multiplayer features are also greatly simplified thanks to the state management and undo/redo system.

The future is exciting for Dungeon Scrawl!

If you want to keep up with development and be notified of future posts:

Show Comments