I think this is the second time I’ve given a literal update from the trenches; we’re at the Roots’n’Blues festival, providing wi-fi to a big, dusty field (it’s usually muddy, but no rain this year!). So I’m taking advantage of being the guy who setup the wi-fi security to post a weekly update. 🙂

Quite a bit of progress this week, the modderngl2 branch is not all that far away from being mainlined now:

  • Moved voxel model selection over to Lua, so adding models to the game doesn’t require a recompile.
  • I just couldn’t get voxel-based character graphics to look good. Scenery/buildings and similar are looking great, but people were too hard. So (characters only) I went back to sprites, and made a bunch of high-res ones. I used MakeHuman for templates, and then drew in details as needed. I also implemented a Lua-based system for specifying the details. More on this below.
  • Restored the AI status effects system (and converted it to the new setup).
  • Restored the movement, gravity, settler spawner/beam-down systems (and converted them).
  • Put in placeholder system for the “rest of the world” system – designed to effectively keep running world-gen post start, so the world feels alive. I wasn’t happy with the occasional pauses this caused before, so it’s being slightly re-architected.
  • Found a seed that gives me a worst-case scenario for oceans (a barely playable map that is 80% water), and used it to profile/tweak the water flow system. It’s running a lot more predictably now.
  • Made the message-passing system thread-safe, since I’m using pooled threads to concurrently run some systems now when I can.

So – character models. Nox Futura has a really detailed settler generator, and I really wanted to reflect that in the graphics. There are a ton of different cosmetic options (procedurally generated when settlers join the game, or on spawn for NPCs). To reflect this, I’ve gone with the time-tested “paper doll” approach: you render lots of sprites on top of one another to compose the character. Each render supports a color tint option, allowing for each layer to be customized for the character (a shader handles tinting, integrates game lighting, and ignores transparent pixels). So for a typical character, there’s a base body (gender-specific) – tinted by ethnicity. I then draw underwear, since I’m trying to avoid making this an M-rated experience (I really don’t get why nudity is verboten in the USA, while legs blown off isn’t… one of those two seems natural to me! Oh well.) Then hair is splatted on, tinted to match the appropriate hair color. Next, the character’s inventory is iterated, and items (tinted appropriately) are blitted onto the sprite. I started off thinking “that’s a lot of blitting, I’ll need to come up with a cache strategy” – but it has been plenty fast enough on everything I’ve tested with, so I’ve kept it simple for now.

 

There really are a LOT of combinations. Humans have 9 available skin tones, 5 hair-styles (in 24 colors), and an ever-increasing inventory of clothing options (all of which can be recolored) – there’s 22 clothing graphics so far, with more to come. Clothing sets are calculated from starting profession and gender; there are 53 professions and two genders (with each clothing item having color options, an average of 4). So a rough estimate is 228,960 combinations at this point.

Future improvements:

  • I’d like to scale the sprites by height/weight, to further differentiate characters.
  • I need to fix a couple of sprites that don’t have the background properly obliterated.
  • I need to add about 30 more clothing graphics to finish out the currently supported inventory.
  • I’d like some items to appear, so you have immediate feedback as to weapon/tool choices.