I have been thinking about balancing and dropping items (weapons and gear) in the levels. One of the factors is that I cannot make hundreds of items with different stats for each level — I just don’t have the time to do so. So I think the way I will do items is that they will be a mix of designed properties and procedural values based on player’s progress. I will design a good couple dozen unique items. Then drop them in-game with a level that corresponds to player’s current dungeon level. And scale the item’s gameplay values (like damage) according to this level. Items of higher rarity would always win against less rare items of the same level. So the player can use a rarer item for a couple levels past where they found it.
So, firstly I want to store the level together with the item the player has equipped. This level is a value in parallel to the weapon definition, so I have to store at least 2 values – ID and level. This means completely changing how I store and process the equipped gear and weapons. Starting with gear, I did this change and finally got its level displayed:
One thing is that I am not actually saving player’s equipped weapon, which is a problem I let persist for so long that I have to rewrite the entire weapon storage system.
First thing is that I need to separate weapon type from what I currently have as weapon type:
I renamed weapon type to weapon class, because that’s what it is for purposes of knowing the overall weapon “type”:
But the actual “type” is essentially the ID of the weapon that I can use for saving it and passing around the value:
I can then list all the player weapon in a dedicated weapon collection (same as gear collection):
And the gear system can know about all the weapons to look them up:
All of this is for the player only. Enemy weapons don’t need an ID, so they just specify themselves as an enemy weapon:
In fact, I am renaming them all to IDs instead of “type”. Naming’s important.
Finally, after lots of changes, I get to display the weapon’s level that the player has equipped:
I also had to change how debug editor for this works. I can no longer directly “equip” items, because they must come with additional values and these values exist only on real item in the world. So I need to drop a real item at player’s location and let them equip it “normally”. I can specify the level then for this new item:
Since I had to completely change how I store player weapons versus enemy weapons, I totally broke my secondary bullet counter for swapping weapons (and not instant-reloading them), so I added some debug to see that I am storing the value correctly:
I wish I had considered this all before I hardcoded and intertwined so many systems. I guess that’s the bane of not having a proper GDD and design.
I wonder what the item rarity drop rate should be. It’s hard to tell without playtesting, but I think it would be something like rare/blue is every 3rd item and epic/purple is every 8th item. The rest are common/white items. I need to decide on this, because that determines how many different items I need for it to feel like there’s a decent selection available. For example, it’s fine if I have many repeats of white items, but I rather have blue items mostly unique and when a player finds a purple, it’s more than likely not what they already had/have. Of course, there will be repeats (and the player may actually want a specific weapon/gear). Then I further need to decide how many items are of certain class, like energy. In short, there are two extremes of items — common and forgettable, and rare and memorable.
So I am thinking, for starters, I would have something like this for weapons (each box – item, color – rarity, text – class):
I’ll change my weapon types/ids to matching values:
And then redo my existing semi-compatible assets (names and types) to the same organization:
Now I can see which weapons I still need to make. I had some very precise considerations for weapons before, and I will still consider the arch-types of weapons, but at some point I just need to make the damn things. Starting by filling out all the placeholders:
And same for gear:
And now I need to assign the correct (mostly placeholder) sprites to all of these. To I added a debug overlay for all sprites, so I can do so quicker:
This is extremely tedious… I am literally drag&dropping hundreds of items between other items. For future projects, I might need to rethink my approach. Unfortunately, I can’t think of anything less tedious in the long run.
Anyway, I need to drop these items to the player now. But I want there to be more blues and purples the further the player progresses. For that I cannot use my current level distribution logic, which is basically “on” or “off”:
(I can technically specify the same item multiple times with different level range and sliders, but that would be really cumbersome.)
What I am doing instead is having a weight for each level:
So this means that, for example, in level 1 white items are predominant and rarely there’s a blue. But in level 10 there are mostly blue items with purples and whites mixed in. So this lets me fine-tune when I drop items. I will need to playtest this to see how the different amounts of items feel. I might write a debug simulator for drops, so I can visually see how items might get generated in the level. But I don’t really think I can get a feel without playing, because the player sees items one at a time between fights as they loot.
Actually, as I look at it — tweaking it might be a massive pain. I am essentially putting the same 10 numbers over and over. What I want instead is a more “readable” value:
And then have those values store the actual finicky values separately and only once (so 4 entries instead of 50+):
Ah, much better. DRY as applied to technical design in the works.
Here’s me getting (really lucky with) a blue drop in level 1:
Finally, I feel like I am actually adding content to the game, even if it’s all just placeholders. There is still a lot to do. And this is really slow and tedious (I use this word a lot, don’t I?). I will likely need to do all the same kind of things for enemies as well.