Skip to content
Snippets Groups Projects

Better superfetation implanted ova count sim

Merged pregmodfan requested to merge pregmod-dev-betterSuperfetation into pregmod-master

With this change simulation of superfetation ova release become more logical (IMHO). I don't like flat ova/4 count - it's to boring for me. :)

Now it's tied to fertility factors, pregAdaptation, and already implanted ova count. If mother have enough potential free space in womb it's allow full fertility force factors to be in use. If not - smaller and smaller ova count can be implanted, tied to potential free space. If ova count go above potential safe value, it's not guaratee to implant even single ova. But there is always a chance for implantation, and fertility factors still affect it. All calculation use birth size of fetus, not current size. So even if womb is crowded on early stage, it's still be processed as already crowded.

With these changes superfetation is not so deadly for natuaral mothers without fertiltiy drugs usage and without upgraded curvatives and surgery. But it's still allow player to overdo it relative easily. Further tweaking is possible but current state looked reasonable for me. It's not strictly artifical state(can be encountered in slaves naturally), so without artifical factors (fertility drugs etc) it's should have some natural safety mechanic. IMHO.

Also making this to force me add new function: FetusGetPrediction(actor, age). Function returns what volume (in cc) a single fetus of given actor will be, at given age of gestation (weeks). It's use current pregnancy profile, so automatically suport animals or other thing that change pregnancy profile for actor.

UPD: found that game code not really adapted to possibility of setPregType() returning 0. No errors, but some strange description on end week possible. Need some adaptation, or just changing if (ovum < 0) ovum=0; to if (ovum < 1) ovum=1; Resolving...

Edited by pregmodfan

Merge request reports

Approval is optional

Merged by PregmodderPregmodder 5 years ago (May 27, 2019 12:39am UTC)

Merge details

  • Changes merged into pregmod-master with f87f239d.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
381 vol = getVolByWeight(actor, age);
382 } else if (actor.pregData.sizeType === 2) {
383 vol = getVolByRaw(actor, age);
384 }
385
386 if (vol === 0)
387 vol = 0.1;
388
389 return vol;
390
391 function getCurData(actor, age) {
392 let i = 0;
393 let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cage, csize;
394 let data = {};
395
396 while (actor.pregData.fetusWeek[i + 1] < age && i < actor.pregData.fetusWeek.length - 1) {
  • ezsh
    ezsh @ezsh started a thread on the diff
  • 379 vol = getVolByLen(actor, age);
    380 } else if (actor.pregData.sizeType === 1) {
    381 vol = getVolByWeight(actor, age);
    382 } else if (actor.pregData.sizeType === 2) {
    383 vol = getVolByRaw(actor, age);
    384 }
    385
    386 if (vol === 0)
    387 vol = 0.1;
    388
    389 return vol;
    390
    391 function getCurData(actor, age) {
    392 let i = 0;
    393 let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cage, csize;
    394 let data = {};
  • ezsh
    ezsh @ezsh started a thread on the diff
  • 419
    420 return data; // csize * rate;
    421 // maybe not very effective code, but simple and easy to debug. May be optimized more in future.
    422 }
    423
    424 function getVolByLen(actor, age) {
    425 let phi = 1.618;
    426 let targetData, targetLen;
    427 let volume = 0;
    428
    429 targetData = getCurData(actor, age);
    430 targetLen = targetData.size * targetData.rate;
    431
    432 volume = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)));
    433
    434 if (volume < 0) { // catch for strange cases, to avoid messing with outside code.
  • @ezsh

    This is direct copy from working code, with changes minimal to be enough. I will do not like to make it different from original with optimizing right now. It's can be second step, after mechanic is in place and working without bugs.

    Edited by pregmodfan
  • I'd default to at least 1 ova instead of 0 as you've noticed that everything is built around that being the only possibility.

    I can get behind better implantation statistics rather than a flat 1/4. Though you have to keep in mind that hyperpreg off really does not want to go above 150kcc belly size.

  • It's tied to pregAdaptation, so limit is based on it.

    I can add additional limit to hyperpreg off option, but IMHO better to add limit/scaling to pregAdaptation itself (if it not already present). If hyperpregnant is not allowed to exist, then scaling back limits is logical, IMHO.

  • Perhaps. Scaling it off pregAdaptation is a neat idea though.

  • pregmodfan added 1 commit

    added 1 commit

    • 65563ef7 - balance and some descriptions fixes

    Compare with previous version

  • I should also say that pregAdaptation is naturally gated by pregnancy size and superfetation with hpreg off has a four week cooldown which will greatly affect overall sizes.

  • pregmodfan added 1 commit

    added 1 commit

    • eec63a5d - limit for in case that hyperpregnancy turned off

    Compare with previous version

  • pregmodfan unmarked as a Work In Progress

    unmarked as a Work In Progress

  • @Pregmodder

    Ready to merge, I think.

    There is still some strange descriptions for multiprenancy in slaveInteract screen (caused by .pregWeek resetting to 0 - with superfetation impregnation it's should be not), but it's not related to these changes and need separate refactoring.

  • Basic tests ran?

  • Yes, and played with it too. I do not release untested code.

  • merged

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading