Dreamlogic: Programmatic Creation of Data

So, ever since I implemented the Dark Souls weapon reinforcement system in RPG Maker MV for use in my RPG "Dreamlogic," where one of the eight worlds you visit is based off of Dark Souls, I've been faced with a serious challenge.

Ya see, I can make all of the upgrade paths, but that turns out to be a mountain of work for normal weapons. This is because each upgrade has to be its own weapon in the database of weapons. So, for something like a boss weapon, this means I need to make six separate weapons (+0 through +5). This is annoying, but not too bad. It's mostly a lot of copy and paste with some number tweaks.

But standard weapons are another beast entirely. Let me break down why: Each weapon that follows standard upgrading procedure has to have a weapon implemented for all possible upgrade paths. This turns out to be a LOT of weapons. Here, let me count them:

1 for the initial weapon.
5 for +1 to +5.
5 for +6 to +10.
5 for +11 to +15.
6 for Fire to Fire+5.
5 for Fire+6 to Fire+10.
6 for Chaos to Chaos+5.
6 for Magic to Magic+5.
5 for Magic+6 to Magic+10.
6 for Enchanted to Enchanted+5.
6 for Divine to Divine+5.
5 for Divine+6 to Divine+10.
6 for Occult to Occult+5.
6 for Lightning to Lightning +5.

Note: I'm omitting Raw and Crystal, as Raw never really had much point in the Dark Souls 1 system, and Crystal is balanced around durability, which I don't have in my version.

Add all of those up, and for each weapon that follows a standard upgrade path, I have to make SEVENTY-THREE (73) weapons. For ONE conceptual weapon. That's a LOT of work, a lot of copy&paste, and a ton of room for errors.

As a result, I was working on the idea of only having a handful of weapons that can follow a standard upgrade path. When you consider that two weapons would require me to make nearly 150 database entries, I think you can understand why. It's a lot of very tedious work.

It may have been practical restriction, but it also isn't very satisfying for so many reasons, not the least of which is that it just doesn't feel like Dark Souls to have a super limited pool of weapons. The game is known for how many weapons it has, for crying out loud!

Enter a (hopefully fully functional) solution: Database entry generation. Why I hadn't hit upon this idea earlier is mostly the result of ignorance as to what was possible.

However, it looks like programmaticly creating all of the upgrade paths off of the one initial weapon is quite feasible. That means I create one weapon and the code creates the remaining 72 weapon entries necessary to make all upgrade paths possible.

This is part of why I love programming! It's the process of turning repetitive, tedious tasks into something the computer does so you don't have to.

I'm still not 100% certain that this solution will work, but I am pretty sure that it will. And it'll not only save me a lot of tedious work, it'll reduce errors (as soon as the code is error-free, anyway!) AND it'll make it totally feasible to have a ton of different weapons because it requires no extra effort on my part to make all of the additional data entries required to make them work.


Popular posts from this blog

Guild Wars 1 Skill Review Project

GW1 Skill Review Profession Highlight: Warrior

A New Player's Guide to Guild Wars 1