Hello, everyone! I've been busy laying the groundwork for the big cosmetics update and I finally have some visual progress to show for it. The next build is still a few weeks away, but in the meantime, here's some of the problems I ran into and the solutions that'll make adding more options much easier in the future. Also some previews of new features to come.
I wrote the original customization code over 3 years ago so it was pretty cumbersome and difficult to expand on. Every outfit was hardcoded into a monolithic script with arrays of properties that needed to be synced up to work properly. It worked, but it was very difficult to add new options without breaking old stuff. It ended up being an extremely long list of parameters that was daunting to look at.
I fixed this by defining some custom data types for each customization option; one for shirts, one for pants, one for hairs etc. Each data type contains only the properties needed for that specific option and it automatically tells the customizer what properties to change when equipped. So setting up a new option is as simple as right-click > create > shirt then assigning their specific values. No more massive lists of parameters to dig through.
I also had to make some changes to the character shader, which is the logic that tells the game how to draw the character. It handles stuff like skin color, clothing, sweat effects, and anything else that changes the appearance of the character. It's pretty complicated and I'm starting to run into limitations. Here's what that looks like under the hood.
The biggest obstacle is that a shader can only support up to 16 textures. I use textures to mask out clothing, sweat, cellulite, stretch marks and many other things. I hit the 16 texture limit a while ago so I needed to figure out a way to squeeze more texture data from fewer image assets if I wanted to add more options. One way to do this is through RGB channel packing, which breaks up a single texture into 3: one for red, one for green and one for blue. Here's an example of how a texture can be broken up to make a mask for finger nails, palms and belly bloat all from a single image.
I applied this method everywhere I could, but it still wasn't enough. So I had to resort to another trick called texture atlasing. It's pretty straight forward; arrange multiple images into quadrants of a single texture, then break up each quadrant into its own mask. Using this combined with channel packing lets me get up to 12 masks from a single texture.
This only works for textures that never change though. Otherwise I'd need a different atlas for every possible combination of mask, which would get out of control quickly. So stuff like clothes can't take advantage of this technique since they are customizable. Either way, this left me with more texture slots to add stuff like clothing patterns.
With those obstacles out of the way, I started rebuilding the customization interface, which can now support many more options and is easier to use. Now you can scroll through lists of clothing options with preview icons, access more variables like shininess and opacity, and assign clothing patterns with their own custom colors.
I also rewrote the save system to make the experience more user friendly. Instead of a limited number of save slots, there's a proper name-based system that will allow you to name your characters and save them to a drop down list. With this setup, there will be no limit to the number of characters you can save. I also reworked the save file structure so you won't need to migrate saves from old builds to new ones.
Now that most of the ground work is laid, I can start adding a slew of new options. This overhaul took longer than I thought so I might break this up into two updates depending on how much time it takes me to create more outfits/hairs/accessories/etc. Either way you can expect a new build in the next 2 or 3 weeks. If I don't end up adding all the options I want by then, I will release another build with even more stuff not too long after that.
Thanks for your patience and support as I continue chipping away at this and I'll see you again soon!