Thursday, October 27, 2011

On the Efficiency of Nether Wart Harvest Spacings in Minecraft


[Editors Note: For those who do not play Minecraft, you should. You can play it in your browser here, but I strongly recommend downloading the client from here.]

Once again, my mathematical mind found itself thinking about the efficiency of Minecraft. Obviously, the warning for high mathematical content which I developed and then never bothered to actually use, could be applied here.


      Abstract

The expected yield per hour of a Nether Wart plant that is left for a given time period before being harvested and replanted can be calculated using statistics. The expected yield for several interval lengths is calculated and an optimum interval of between 25 and 50 minutes is found to be sufficient to allow the majority of the plants to grow, without leaving fully grown plants too long to waste update cycles.

      1. Introduction

The game of Minecraft is an open sandbox construction game created by Markus "Notch" Persson. The basic gamplay involves the player manipulating blocks in an effectively infinite 3D environment. The player controls an avatar that is capable of placing and removing blocks to create various structures, artworks or creations[1]. A significant part of the gameplay for the advanced player is farming for resources.

Nether Wart was added to the game in the 1.9 pre-release, and is a plant which only grows in the Nether on Soul Sand [2]. Due to the importance of Nether Wart in potion brewing, and since it can only be grown in the Nether, optimum farming methods become necessary. After being planted, Nether Warts need to undergo two stages of growth in order to be fully grown.

      2. Methodology

The aim of this investigation is to determine the time for which Nether Wart should be left in order to maximise the number of seeds obtained in a given time period. It is useful to define our target variable as the net yield per plant, , measured in seeds per hour. Freshly planted and half grown plants will yield a single seed, while fully grown plants will yield two to five seeds [2]. The distribution of the number of seeds dropped by a fully grown plant appears to be uniform, for an average of 3.5 seeds per plant. Thus the yield per plant per hour is given by the formula


where represents the probability that the plant has undergone growth cycles, and is the actual time in hours since the seed was first planted.

The algorithm the game applies when checking for growth is as follows [3]. The game runs through an update cycle (I avoid the word tick, due to confusion with redstone ticks) every twentieth of a second. Each cycle, the game checks twenty random blocks in each loaded chunk for updates. A chunk is a 16 x 16 square with the full 128 block height of the world, and consists of 32 768 blocks. Thus the probability of a certain block being checked for updates is 20 in 32 768, or 0.061%. If a Nether Wart that is not fully grown is chosen to be checked for updates, then the probability of it growing to the next stage is one in 15.

After update cycles, the probabilities of the plant being at each stage of growth is given by



where is the probability of a plant growing in any given update cycle, which is given by



After a certain time in hours, the number of update cycles that have been applied are


From this, it is possible to calculate the expected yield per hour per plant for a farm that is harvested an replanted at regular specified intervals.

      3. Results

The yield per hour per plant was calculated for various time intervals. Exact agreement was found for the probabilities of various stages of growths with the work of Pernsteiner [3]. The probabilities of a plant being at each stage of growth and the resulting yield per hour per plant is shown in Table 1.

Table 1: Yield per hour per plant at various times after planting.
Time Fresh Plant Half Grown Fully Grown Net Yield
1 s 99.92% 0.08% 0.00% 0.00
30 s 97.58% 2.38% 0.03% 0.08
1 min 95.23% 4.65% 0.12% 0.17
5 min 78.33% 19.12% 2.54% 0.76
10 min 61.37% 29.97% 8.67% 1.30
20 min 37.67% 36.78% 25.56% 1.92
30 min 23.11% 33.86% 43.03% 2.15
35 min 18.10% 30.94% 50.95% 2.19
40 min 14.18% 27.70% 58.12% 2.18
50 min 8.70% 21.25% 70.05% 2.10
1 hour 5.34% 15.65% 79.01% 1.97
2 hours 0.28% 1.67% 98.04% 1.22
4 hours 0.00% 0.01% 99.99% 0.62


The results are plotted in Figure 1 below.


Figure 1: Plot of net yield per hour against time

      4. Discussion

Figure 1 shows a maximum yield at 36 minutes and 43.6 seconds. However, the relatively flat gradient between 25 and 50 minutes would suggest that any time within this range would provide a reasonable yield.

The method with the highest yield would obviously be to monitor the farm constantly and manually harvest and replant those plants that are fully grown, but leave those that have not yet started to grow. However, the method of harvesting all plants at once lends itself to large or automated farms.

The above analysis does not account for the fact that a farm would take a finite amount of time to plant. Assuming a planting rate of about two plants per second, a 16 x 16 farm would take just over two minutes to plant. Because of this, the first plants two be planted would have had roughly two minutes longer to grow than the last plants to be planted. This should be accounted for when harvesting.

It is tempting to spread the farm over several chunks. This has absolutely no effect on the growth rate, as each block still has the same 0.061% chance of being selected for update, regardless of which chunk it is in.

      5. Conclusions

The expected outcome for the net yield of a Nether plant after a certain time period is easily calculated using statistics. A formula to calculate the probability of a Nether Wart having reached its first and second stages of growth respectively was developed and was then used to calculate the length of time that an Nether Wart farm should be allowed to grow to maximise the yield in a certain time period. The optimum time between harvests was found to be 36 minutes and 43.6 seconds, but any time period between 25 and 50 was found to be reasonable.

      6. References

[1]. Curse, Inc.; Minecraft Wiki - The ultimate resource for all things Minecraft; September 2011.
[2]. Curse, Inc.; Nether Wart - Minecraft Wiki; October 2011.
[3]. Pernsteiner, S.; Minecraft Crop Growth Algorithm; October 2011.

If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



No comments: