Wednesday 8 July 2015

Making babies

Hello everyone!

While answering a post on the tfgamessite forums, I decided to explain a bit about how Newlife's impregnation mechanics work. Instead of putting it in my forum message, I'm going to post here so people from other sites can read it too.

If you prefer not to know how the game mechanics work, then look away now!


Okay, so, Newlife and impregnation:

The obvious solution for impregnation would be to check each time you have unsafe sex. That's what happened early in pre-release versions but it ran into problems when the game was improved to allow sex multiple times a week.
With that system, even if you aren't especially fertile in a given week, your chance of getting pregnant skyrockets if you have sex a lot. Alternatively, if I limited the code to one check, then your chance of getting pregnant is normal but whoever you sleep with first will always end up being the father.
As a result, I completely rewrote how it works. Here's what it does now:

When you have sex with a man, and he comes in a way that's unsafe, then the game stores that you've been inseminated, who by, and any modifiers. For example, if he comes outside but some gets in a dangerous place then it's not as risky as if he finishes deep inside you.
If you have sex several times, then each of those gets stored, even if it's the same man as an earlier time.

Impregnation is then calculated right at the end of the week, just before showing the week planner screen for the next one. 

First the game checks if you're already pregnant or if you're protected by the pill. There's just one check for the week, not one for each individual insemination. Being on the pill normally guarantees safety, but the Forgetful (10%)  and Unusual Body Chemistry (50%) traits add failure chances. 
Having this check at the end of the week is the reason why the pill you get in-game is described as having a slight morning-after effect. If you go on the pill by visiting the doctor, then you'll be protected for that week even if you had sex before the doctor visit.

If you aren't protected by the pill, then the game picks a random number. This is stored and the same one is used to process each insemination. That way we avoid the problem where multiple shags makes your pregnancy risk so high its silly.
Next, the game starts checking your inseminations in a random order. The risk is calculated based on your cycle, the insemination modifier, the man's fertility modifiers and any fertility bonuses that you have. This is compared to the random number chosen earlier.
If you get pregnant then the other inseminations aren't checked and that man gets to be the daddy. Otherwise, the game moves onto the next one and adds a small cumulative modifier to the risk. This means that having sex many times in a week will increase your risk of pregnancy and each additional time makes it a bit more risky, but the effect is generally much smaller than if impregnation was checked independently each time you had sex.

Well, I hope that was interesting for you. Now get out there and make some babies!

10 comments:

  1. Interesting. Very interesting. Now write a post that explains why the player needs to buy cookware to make dinner instead of just using whatever breakfast is made with.

    So if the game stores data that says the player has been inseminated and by who, can any of that be used in contexts more visible to the player? Can the weekly summary indicate that two different guys came inside the player on three separate occasions, but it was a safe week there's nothing to worry about? Could the "risky inseminations" stat be further broken down by the number of times one has been received from specific men? I'm just generally curious about the kind of things you're able to do with what the game tracks and how that might translate into more stuff for the player to experience, specifically when it involves impregnation content.

    ReplyDelete
    Replies
    1. Good point. I've added some checks to the breakfast scene. No more making porridge in the bathtub!

      The insemination information gets cleared each week so it isn't really a source of long-term detail. It might be possible to use it in the week summary, although I'm still quite undecided what form that should take in the final version.

      Delete
  2. Add some stockings/pantyhose to outfits pls =)

    ReplyDelete
    Replies
    1. Sorry, the Unethical Experimentation Party made pantyhose illegal because it isn't tested on animals. Stockings will happen sometime, though probably not as part of the friends update.

      Delete
  3. Hoping there will be another job like nanny so the character can be the single or married daddy or widower plaything(or lover whatever); moreover, I also hoping to choose the character like hairy guy or not because some people are really into hairy guy(not only body hair, also facial hair) and of cause some are not and some don't care.
    One more thing, when the character is pregnant, I can go visit Ivy and the doctor to make the pregnancy move faster. Will the pregnancy move twice faster if I visit both or it just effective once even I visit both of them?
    Sorry for my bad English, not a native speaker.

    ReplyDelete
    Replies
    1. Hi,
      I'm intending to add some "single dad" romance content to the neighborhood update, rather than tying it to a career. No-one would want to bring up a child in the miserable dump where the player lives at the start of the game, after all.

      I'm not sure about hair & beards. I agree that it'd be nice content to have, but I don't know if it'd be pushing the complexity of the physical actions beyond where they can be reasonably written in an acceptable amount of time. Ask me again a few more major updates down the line when more of the game mechanics are finished - I'll have a better idea then.

      Pregnancy acceleration is cumulative, and the fecund trait counts there too. 2x for one source, 3x for two, 4x for all three. The increase won't always be exact as you can lose some in overflow.

      Delete
    2. Thank for the answer,
      Actually, I was thinking about a sleepover nanny job then you might not need to live in that miserable dump and Ivy could give the character more money at the beginning, but it would change a lot about asking other guys to walk you home, it would be terrible to ask other guys to go to your employer house. However, I still hoping you would consider about a job like nanny, may be a day care, since there a childcare work experience choose at the background.

      Happy to know you would think about adding the hair & beards in your game. I will definitely ask again about this and I find it funny that Ivy is trying to help people with baldness problem but no one in this game is describe as hairless(only hair color).

      Knowing the pregnancy acceleration is cumulative is really helpful, thank you.

      One more question, I know you are working on the marriage system, will you consider adding an other kind of relationship except boyfriend or just friend? Since there is asshole NPC would treat the character as his plaything, I hope he will ask the character being his personal cum dump and different from putting a ring on your finger, he would put a dog collar on the character and ask she to be his sex slave.

      Thank you very much and sorry for my bad English again.
      Shelby

      Delete
    3. Hi, it's unlikely that those sort of relationships will be modelled in the game, because it'd need a ton of unique content and changes to support ai-decision-making to a lot of existing actions. I'm trying to keep the scope of Newlife down enough that I can complete it in my planned development time, so I don't want to add major changes that aren't in the core plan.

      There is, however, a sex-slave path in the endgame, if you're playing the female-start storyline.

      Delete
    4. Different anon, but yay sex slave ending!

      Delete
    5. Wait, what? You mean a sex-slave ending is live now? I have to investigate! (Yet another different anon)

      Delete