Posted July 19, 2025 by Byte Arcane
Ok, weekly update time! It's not super-expansive, but it will have to do, to get back at the weekly pace. So, the main theme for this week is items, and more specifically potions/bottles.
On potions and bottles
I've implemented a super-flexible enchantment system, and I want to use it! But, when reality kicks in (and basic design intelligence) I realise that it's not a good idea to have lots of item types that can do everything. So, let's see what's going on here - everything in the context of items that can be used. I've got:
So, what's the problem? I need to set constraints, for anything to make sense. E.g. I don't want a potion that increases your skill in archery - a tome should do that. So my current (WIP) allocation is as follows:
Alright! But potions is still a broad category. Also, since this is a graphical roguelike, I need flexible graphics. Questions that need to be answered, is: Can we easily differentiate between...
Now one solution is to keep it lame and use some potion graphic from an AI pack of 10000 potion sprites, or find/make a procedural potion bottle generator. Guess what I chose :) WARNING: numbers follow
So, for the procgen potion generator, I've decided to pregenerate art rather than compose on the fly, but it's not huge effort to do the latter. My limitation is 2048 sprites because I keep my sprites in texture arrays, and it's the maximum array size. For 32x32 pixels of uncompressed RGBA sprites, this means 8MB of VRAM for our potions, plus 2MB for the distance field if needed. It's fine.
So, how do we generate combinations? A potion bottle sprite is a function of bottle shape, content color and grade:
At the moment I have 6 shapes, 3 of which are from DCSS and 3 are mine (altered DCSS versions really), which I call potion, phial, flask and flagon, bomb and oil. If we have 5 grades per bottle, this means that we're left with 2048/30 colours, which is 68. I've decided to use a palette for the colours, more specifically the resurrect64 one from lospec, which means I get a total of 1920 sprites and I have 128 to spare, for example these could be unique bottles for unique items. This leads to a nicely packed 10MB texture atlas for just bottles.
Gold stacks
I've been debugging gold and stacks, as different gold stack sizes have different sprite. All works fine now, so, video below!
Some unfoggy overworld to close off the weekly update: walking around with fog of war turned off, just to enjoy nature a bit :)
Have a nice weekend and see you next time!