Slow and steady progress on enclosures and breeding


I had hoped to finish both the basic enclosures and the basic breeding by the end of January, but I failed to consider the beginning of the semester and how exciting new math classes can be. So I've been getting used to the semester flow again. That said, progress has been made.

Mostly on the back-end, a new Enclosure class, that can keep track of the parameters related to an enclosure: its size, objects it contains, even the level of cleanliness apparent, though that is not currently implemented. What remains to do are the less entertaining aspects: the ability to move bokes from one enclosure to another (as well as the rules guiding that movement) and a search feature in the enclosure for bokes. Eventually, of course, I want enclosures to be more complex and more customizable, but at this point, especially before I've introduced the concept of stress, it makes more sense to keep it small.

So today I spent a little bit of time building up the information popup for the enclosure. 

I'm also having deep thoughts about breeding, and the ways in which I want to structure the information for a litter. Baby bokes, called bokelets, should not be able to be removed from the enclosure in which their parents are. Similarly, paired mates should not be separated; that would prove stressful, and the mother might lose the litter, or the bokelets would not get enough to eat! The easiest way to prevent this is to simply not allow it in the code. This isn't coded yet, but I've thought out the logic.

I've also pondered making pairings more realistic. Bokes are community animals, and so are happy spending time around others of their kind. But like any animal group, a mix of males and females should result in a lot of new babies... so that will be reflected in the set-up. If you as the player want more control, bokes are also perfectly happy living in same-sex groups for the majority of their time. 

One big aspect of realism for me has been, as I mentioned in the last devlog, litter sizes. So I went on a hunt to learn more about litter size distribution (in the mathematical sense). Has anyone ever modeled the litter sizes of carnivores? While I found some information, I eventually concluded that a simple formula would work best, and decided on the Poisson distribution.

The Poisson distribution looks like this (the exact height and width of the curve depend on a number called λ, lambda). For every number on the horizontal axis, the height of the curve tells me the probability that a litter of that size will occur. By changing lambda, I can make certain results more or less likely. 


While I am using a Poisson distribution, I am actually off-setting the result by 1. The code generates a random number from 0 to 1 and uses that number to find the number of bokelets that should be in the litter. Then I add 1 to that. Why? Notice that the first number on the horizontal axis is 0. That would mean you could have a litter with no bokelets! While I might find a different distribution at some point, playing around with a litter size generator already took a big chunk of my work hours (actual work hours) on Monday, so I simply decided on this offset.

The way I have this set up, to allow me to modify lambda, means that the genetics of the mother and father can influence the number of bokelets. I'm not entirely sure if I'm happy with this distribution, but thankfully it will be easy to change. The way things turn out, it is very likely there will be 5-7 bokelets in a litter, but then it is also (less) likely that there will be four or eight bokelets. It is much less likely that extreme numbers of bokelets, like one or two, or more than 10 bokelets, will be born, but it is possible, up to a maximum of 16 bokelets. Large litters will have some repercussions, but for now, I'm simply enjoying playing around with the numbers.

Leave a comment

Log in with itch.io to leave a comment.