This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Changes

Jump to: navigation, search

Talk:Pig

2,570 bytes added, 23:47, 22 October 2020
Extra Truffles
:::There's more than one way to skim a profit. ;) [[User:Butterbur|Butterbur]] ([[User talk:Butterbur|talk]]) 02:10, 14 January 2020 (UTC)
::::Here's an update to these old numbers. I'm not sure why precisely my older 2.35/day estimate was inaccurate, but I've attempted the experiment again. In practice I think it's probable that area boundaries and the presence of other truffles on the ground inhibits the production of more truffles. With that in mind I setup an enclosure with no grass, a larger area, my barn located at the top and center of the enclosure (attempting to increase the space between barn door and pen boundaries), and the barn door open at all times (maximizing time pigs spend outside). I was able to boost the average truffle production to ~2.66 truffles/day per pig. (Interestingly, I did NOT use the Shepherd profession this time.) That's still not 3/day however. A question I've been interested in answering is what amount of space is necessary for a pig to maximize its potential truffle production.
::::Our probability series is indeed (1 * 2^1)/(3^2) + (2 * 2^2)/(3^3) ... (x * 2^x)/(3^[x+1]) and its sum from x=0 to infinity should indeed = 2 extra truffles on average. But how would we actually fully reach an average of two in practice? We would in practice need to observe rare situations where a pig produces 5, 6, 7, 10... even 20 extra truffles in a given day. In fact we would need to observe the entire spectrum from 0 to an infinite number of extra truffles. In practice, a single pig's ability to find a large number of truffles in a given day is going to be limited by the finite number of open tiles available to that pig and the finite amount of time in which a pig can engage in searches from 6am to 5pm. Thus the real average number of truffles will be something less than 3. The question is how much less.
::::To further estimate the real limits to daily truffle finding, I would like to know more about how the truffle search behavior works. Is a random check done to initiate searching behavior every game tick or perhaps every 10 in-game minutes? [[User:Farmonymous|Farmonymous]] ([[User talk:Farmonymous|talk]]) 19:21, 17 October 2020 (UTC) :::::The basic answer is that the chance is 0.0002 every game tick. Which is probably as important in limiting the truffle rate as friendship/66% chance of multiple truffles.:::::The relevant code is::::::* FarmAnimal::findTruffle actually generates the truffle. This is where <tt>Animal Friendship/1500</tt> is used to decide whether another truffle is possible that day.:::::* FarmAnimal::behaviors calls FarmAnimal::findTruffle, but only if all the conditions are met; this is where the 0.0002 chance is imposed. (It also handles the condition that the pig's bounding box cannot overlap with any terrain features or objects -- grass and flooring are both terrain features).:::::* FarmAnimal::updateWhenCurrentLocation and FarmAnimal::updateWhenNotCurrentLocation call FarmAnimal::behaviors -- and those functions eventually lead back to the primary game update loop, i.e., once per game tick not once per 10 in-game minutes.:::::I'm not sure what the ticks/second rate is in the game (is it hardware dependent?), but I'm surprised even 2.66 truffles/day are possible. Assuming 20 ticks/second gives 10080 ticks in 12 game hours; 10080*0.0002 implies only ~2 truffles on average. With the potential for pretty large fluctuations -- I'm guessing there might be no real difference between your 2.35/day test and your 2.66/day tests, but just random variations. At 10080 ticks there's also a 13% chance of no truffles, i.e., 1 truffle is not guaranteed.:::::Plus, some fraction of the ticks will inevitably fail to meet the necessary conditions. Truffle-finding is only possible if the pig isn't eating or trying to find food. Whenever the pig's fullness is less than 195, there's a 0.002 chance (10 times more likely than truffle-finding) that the pig will go in search of grass -- using up time and leaving the pig standing in a grassy spot where truffles aren't possible. If there's no grass in the enclosure, I'm guessing the pig still heads in the direction of grass outside the enclosure, then maybe gives up when it hits a fence?:::::Other limitations are time spent in the barn, the chance that any time after 5pm the pig will head to the barn, etc. Fraction of ground covered in grass/flooring. I don't think the ground filling up with truffles directly prevents more truffles -- but indirectly it would limit the places where a pig can stand and probably increase the chances that pigs go back in the barn.:::::Hope this helps. [[User:Nebulous Maestress|Nebulous Maestress]] ([[User talk:Nebulous Maestress|talk]]) 23:46, 22 October 2020 (UTC)
3,556
edits

Navigation menu