Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animal reproduction fixes #37283

Merged

Conversation

RarkGrames
Copy link
Contributor

@RarkGrames RarkGrames commented Jan 21, 2020

Summary

SUMMARY: Bugfixes "Fixed the reproduction rates of several animals"

Purpose of change

Fixing animal reproduction rates based on data.

Describe the solution

Black bear
Gestation period is 220 days.
Black bear females typically produce cubs every two years once they become mature. ... Mother and cubs remain together for 16-17 months until May or June of the following year. Then, the family members separate, the mother mates again, and the 2-year cycle repeats.
link

Deer
Gestation period is 201 days.
The fawn will stay with its mother for approximately one year, suckling for three to four months. The female will break the maternal bond by driving the juvenile off just prior to giving birth to the next year's fawn.
link

Pig
Pigs breed at all times of the year, regardless of the season. ... Sows are mated - pregnancy period is 116 days. ... Sows farrow and nurse their piglets for 3-4 weeks. ... Gilts are usually introduced to boars around 25–28 weeks old. The boar will often have daily exposure to young gilt’s, ... with the gilts typically reaching puberty 10–30 days after commencing boar contact.
link

Sheep
Age at puberty (ewe): 6 - 9 months. ... Sheep are seasonal breeders. The natural sexual season is positioned so that lambs will be born in the spring when the weather is warmer and grass is available.
link

Testing

I'm out of ideas on how to test this effectively.

@mlangsdorf mlangsdorf added <Bugfix> This is a fix for a bug (or closes open issue) [JSON] Changes (can be) made in JSON Monsters Monsters both friendly and unfriendly. labels Jan 21, 2020
Copy link
Contributor

@mlangsdorf mlangsdorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't just post links for your data citations. Pull out the bit of relevant data and then link to the research.

You can test this by spawning some animals in an enclosure, teleporting far enough away that they're outside the reality bubble (ie, 5+ overmap tiles), advancing time the appropriate amount, and teleporting back. When the animals are reloaded into the reality bubble, they should age or spawn, as appropriate.

Assuming the data matches and you test this, this looks good, but please bring out the data instead of making me hunt for it in your links. Thanks.

@RarkGrames
Copy link
Contributor Author

I did the formatting you requested.
Testing didn't check out. It takes multiple years for a fawn to mature instead of 330 days. Some monsters in the file had really low numbers for age_grow with 20-50, while others (mostly the dogs and the cow) have seemingly correct days in the 250-350 range.

@RarkGrames
Copy link
Contributor Author

An other thing to consider is if baby_timer spawns a young and then starts to count down or the opposite. The latter will essentially remove some baby animals from the game.

@Ker-Nes
Copy link
Contributor

Ker-Nes commented Jan 21, 2020

Do these numbers scale with season length? Or are they fixed, no matter if your season is 7 days or 91 days?

@RarkGrames
Copy link
Contributor Author

Do these numbers scale with season length? Or are they fixed, no matter if your season is 7 days or 91 days?

No idea. I always play with 91 days seasons and I haven't found any documentation on it.

@mlangsdorf
Copy link
Contributor

Monster upgrades are fixed, irrelevant of season time.
When a monster is spawned or upgraded, it sets its upgrade_time to -1. When a monster is loaded, if the upgrade_time is less than 0, it is set to current_day + next_upgrade_time(). When a monster is loaded, if the upgrade_time is less than the current_day, the monster upgrades.

Thanks for pulling the information out of your sources, but if you've made changes that are not passing the tests, you need to figure out the issue before the PR can be accepted.

@RarkGrames
Copy link
Contributor Author

Ok, I will do some more tests.

@RarkGrames
Copy link
Contributor Author

After making some more tests with several different animals, it turns out none of the animals in mammal.json actually mature according to the days given by age_grow. Spawned a calf, a cattle dog puppy, a bulldog puppy, a piglet, a bear cub. They matured in 2-3 times the amount of days given at age_grow.
baby_timer seems to be the same (2-3 times the given value).

Copy link
Contributor

@mlangsdorf mlangsdorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, thanks for looking into this. separately there is apparently a bug in monster::try_upgrade() but I can't find it by inspection.

@ZhilkinSerg ZhilkinSerg merged commit cf26630 into CleverRaven:master Jan 23, 2020
@RarkGrames RarkGrames deleted the Animal-reproduction-fixes branch January 23, 2020 16:27
@RarkGrames
Copy link
Contributor Author

Thanks for the review. I'll open an issue so it gets documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [JSON] Changes (can be) made in JSON Monsters Monsters both friendly and unfriendly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants