Technical debt

I started this page back in 2003.

In that year, WordPress released version 0.7. Altavista was purchased by Yahoo. Smartphones weren’t a thing yet. This was 3 years before jQuery’s first release. And even Joomla was yet to be released.

This was a full decade before I’d finally move this project to its own domain name. I didn’t use a version control system since I didn’t have a server in which to install subversion (or *gasp* CVS) and Git/Mercurial hadn’t been “born” yet.

D&D’s third edition still felt new. And I’m pretty sure I started this project before 3.5 came around.

My code was small, I just had a couple of pages and a handful of DB queries. But developing these tools can be so much fun… that the codebase grew. Organically… and messily. Even though I reused a lot of code, the technical debt was piling on. And I don’t spend that much time on this page, so the earlier I tackled this debt, the better.

So in 2019 I settled on MVC as my pattern of choice and picked a framework with which I felt comfortable. Said framework has had two major revisions, but upgrading to the newer version so far seems to be less painful than was moving my spaghetti code to an organized structure. In retrospect, I should have started earlier.

But now, as 2024 draws to an end I’m 99% done.

Yeah, it took me 5 years. But in my defense, I did say that I don’t spend much time here. And I did take a couple of detours, like when I realized I could write the Deckplan generator or the Subsector generator thanks to heavy code reuse. Both these generators took an amazingly small amount of time. Yes, they’re very rough on the edges (as usual) and unfinished, but they might be useful to someone somehow.

If all goes according to plan, future features and improvements should take less time to develop.

Hello world!

Some years ago, a page named Irony.com used to have all sorts of generators; but then one day it all disappeared. I wanted to have something I could rely on.

And this is how I got started with the rpg20.com site.

Monsters

The monsters database is what started it all. When WoTC released the SRD, I thought of writing a script that converted the document to a more manageable medium. I was already thinking of PHP and MySQL.

Before taking a dive into this endeavor, I searched the web. Turns out that some guy named John H. Kim had already done exactly that. And best of all: he was willing to share it.

I downloaded the monster and spell databases and uploaded to my page. After a quick hack, I had a usable UI. I then added a search function, list by CR option, filter by HP/CR, and not so long ago: terrain and climate search.

Images and maps

Then I thought about generating images. One of the things I remember most fondly about Ed’s Irony.com was that it generated an image of a town/village. So I thought I’d give it a try.

Ugly map
Ugly map

But the thing is… I think I’m terrible at drawing maps. So this has been something I’ve had a hard time doing: visual improvements.

But I told myself that dungeons should be pretty straightforward. And they look cool. And I love mazes. So I went ahead and made a dungeon generator.

image of a generated dungeon
A generated Dungeon

Evolution

I think I only had the monster/spell databases and the dungeon generator when I showed the page to a friend. He asked if I intended to put something in the room… descriptions, encounters, anything. A few minutes later my dungeon generator had monsters. Not long after that, it started having treasures.

But then I started thinking: I could have a region map that has one or more cities (and cities have taverns, right?), and maybe a dungeon somewhere, and there could be caves in a mountain.

So I’m at the point in which I have a ton of plans and not nearly enough free time to work on it. Ah, well… I still have fun even if it progresses slowly.

The code

These tools are online-only and most of them written in PHP. I don’t have any plans to develop offline-tools at the moment because it’s a bit more complicated: I’d have to compile for Linux, Mac, and Windows (I don’t own a Mac); any minor change requires to recompile everything; people don’t always know which version they’re using; etc.

Will this page dissapear? Well, it might some day. But before that happens, I’d release this code someplace else.

What’s the license for my code? I haven’t decided yet, and nobody’s asked so far… I guess I could use GPL to make sure modifications are shared back… But I guess I’ll decide as soon as someone’s interested in it.