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.

5 comments:

  1. That's pretty cool thanks for clearing it up.

    ReplyDelete
  2. oh and will the source ever be published, baring that perhaps a way to tweak this generator/add our own parameters to it ?

    ReplyDelete
    Replies
    1. My kneejerk response is "no," because I'm sure my code is as ugly as it gets. But looking far forward, I think I'd be comfortable with doing so at such time as I was confident I'd never touch it again myself. But that's a long way off.

      Delete
    2. Nothing you can possibly make even comes close to the utter shit professionals see every day. It takes an entire team of idiots YEARS to make truly bad code. Nobody with a brain is going to give you shit because your code isn't perfect. Nobody's is.

      Just bite the bullet and put it out there, but not until you've gotten your name out a little bit so nobody can pass your work off as theirs. Once you've had 4-5 releases that draw some decent attention, you can put the code up somewhere and let people help you. A good developer can do more in half an hour than a novice can in weeks, so you have a lot to gain if anyone decides they want to give you a hand.

      Delete
  3. eToro is the ultimate forex broker for newbie and full-time traders.

    ReplyDelete