Alpha Devlog 4: Textures


As the last technical devlog (I'll release an early alpha build next week), I want to do a short dive into the way textures are handled both in this game as in Ero Witches. I like seeing equipment reflected on the player characters, like so:


Look at Twitter for a moving version that actually shows what I want to say.

This, combined with using paperdoll animation, leads to a large amount of textures being needed. For example, Ero Witches had 9409 individual textures:


These were then laid over a puppet, with a skeleton that got animated during combat:


And the same holds for the sprites in the overworld.

Exporting Textures

For drawing textures I use Krita. Which makes sense, unless you're doing pixel art in Aseprite, there isn't really any other good working free choice. I then just draw the textures in place, like so:



The important part is that each texture, for each layer of the paperdoll animation, needs it's own layer. The template is as follow, ID,layer-alt+modulation. ID is how the engine recognizes which texture to use, so if it needs a chainmail armor it will add all textures with the ID chainmail_armor. The layer determines the layer it has to be placed on the animated puppet. The alt is an alternative version based on some player characteristics, such as boob sizes. And the modulate indicates that the engine has to modulate it with a certain colour such as skin- or haircolor.

The reason that these need to be separate layers is that Krita allows you to export every single layer as its own image. This will be useful for later.



Note that this isn't optimal memorywise. You'll often see in other games that the textures are all put on the same sheet to save space when loading it into the engine. This is a conscious choice to speed up development at the cost of performance (there's many of these btw). But I have a suspicion that Godot does this optimization under the hood anyway, since there's no way my export builds would be that small otherwise.

Importing Textures

At startup in the engine, I loop over all texture folders, read all filenames and then split them up in a large dictionary of the form ID -> layers -> alts -> modulates. It's rather straightforward, and beats an old method I used where I had to look for textures whenever I needed one while the game was running.

This of course doesn't work on exported builds, since the ".png"'s aren't exported at that point. So for that case, I just create a .txt file which contains the dictionary above whenever I run the game in the editor. When exported, the game reads from that file instead.

Finally, to help me remember which textures I still need to create, I also have a short verification at startup. This will for every ID that might be requested, check whether at least some textures of this ID exist, and warn me if this isn't the case.

Triggering textures

Then, whenever a puppet of a player is made, the player gives a list of all the texture IDs it wants to display to the puppet. Most of these come from equipment, but they can come from other sources as well (such as crests). The puppet also asks the player which alternative hints it has, and if available replaces the equipment or base layers with those by reading the required textures from the dictionary created in the previous step. This whole process is fully automated, so once the textures are made, everything else follows.

Closing Words

As mentioned earlier, I'll release a tech demo like early alpha build next week. It will be very barebones in terms of content (5 enemies, 4 classes, 1 dungeon type, limited equipment, etc...). I'm just writing this part to keep expectations down, it won't be as polished as the first release of Ero Witches with its five completed dungeons. And it certainly won't have new content every week as that game had.

I'm still hoping you'll enjoy it as unpaid QA of course.


Get Ero Dungeons

Leave a comment

Log in with itch.io to leave a comment.