Monday, August 24, 2015

Procedurally generated slaves

I may have been a little misleading earlier when I mentioned the hardcoded slaves from the thread on /d/. These are actually just a supplement to the main source of slaves in the game, which is code capable of spitting out a near-infinite cornucopia of slaves.

I try to avoid calling it a random slave generator because it isn't random at all. At present a slave is described by 61 different stats, from birth name to nipples to oral skill. The code generates them one after the other, and many of them modify each other. For example, the more weight a slave carries to start with, the larger her breasts are likely to be. A slave's age has a chance to alter the starting point of 10+ other stats. There's even a hidden race stat that helps determine starting skin and hair color: that wasn't originally the case, but I got tired of every other slave being generated with dark skin and blonde hair!

In-game, there are currently four slave markets, and three of them use the procedural slave generator. The generator runs and then the market's code modifies the result to give the slave that market's particular flavor. For example, one of the markets specializes in lower-cost merchandise, so its slaves receive reductions in obedience, health, and other stats.

Finally, there are currently nine random events that can result in the PC acquiring a new slave. These also use the generator, but have heavier-than-usual stat changes to fit the events. For example, one random event involves enslaving a business rival; the resultant slave will tend to be older but more experienced and attractive than usual.

There's even two events that result in the PC acquiring two slaves: a mother daughter pair. Those were a lot of fun to code. The generator produces the mother first, stores her, and then modifies her stats heavily to produce the daughter.