Hey Folks! Making headway on the character clothes and appearance today.
As you can see in the screenshot, we now have underwear! And skin tone/hair color now matches face appearance, including when reloaded from a save file. So now the character's top-down appearance has some semblance of permanence. Which is a big step towards following what your crew is doing, since you can now tell them apart and they don't change every load :)
This basically replaces the old code which randomly assigned clothing each time the game was loaded. So a lot of this was already working, and I just needed the new skin-tone sprites with underwear, and some bits of code to synch the face and "nude" body parts.
The next step is the clothing that appears atop this layer. And for that, I have a special mesh for each body part that wraps around the nude layer, to cover it from all sides. It's still a basic rectangle like all other game items, except it's middle was pulled out a bit so it always appears "over" the skin on both sides. (Imagine a really squashed dodecahedron.)
On the code side, I'm going to need some way to tell the mesh which image to use on each body part. And for that, I think I'm going to have individual items list the body part sprites they change. E.g. pants will change upper and lower legs on both sides, a shoe will change the appropriate foot, etc.
More than that, however, we need to ensure a person cannot wear pants when they are already wearing pants. (Or if they can layer, control how many layers we support.) And for that, I think I'm going to borrow the NEO Scavenger architecture. A slot has 1 or more things that can go in it, and items have defined settings for which slots they go in.
Similarly, an item in a certain slot is going to give the owner certain benefits/drawbacks. So combining an item with a slot means we add those traits, and they get removed again when the item is removed.
So far, I have a "Slots" entity which is going to be added to anything that has slots in the game, and it'll have a list of 1 or more "Slot" classes defined. Somewhere in an item's data, I'll need to define some slot info, so that'll be where I pick up tomorrow!