34

A line of dirt surrounded by water.

I've built those corridors that let me go across the lake. As I went back and forth on them to reach my mine and shelter, I noticed the grass slowly advancing over the area. This gave me a crazy idea for time tracking: the stochastic calendar.

To make sense of it all, however, I need this piece of information:

What is the rate at which sufficiently illuminated grass spreads on a single line?

If I built a dirt line long 30 blocks, with one block at one end covered in grass, how much time would it take on average for this stochastic calendar to be fully covered in grass?

a cat
  • 25,880
  • 31
  • 154
  • 189
badp
  • 56,684
  • 51
  • 238
  • 442
  • Unfortunately, I think it's variable. Fortunately, the code behind minecraft is floating around, so the possibility exists that you can get a definite answer. – Raven Dreamer Nov 06 '10 at 20:24
  • @Raven variable as in the chance of the next tile becoming grass in the next tick changes based on biome/etc.? – badp Nov 06 '10 at 20:30
  • @badp more like "every x amount of time in sunlight means a y% chance of grass to spread." As opposed to "after z time in sunlight, grass" – Raven Dreamer Nov 06 '10 at 20:31
  • 1
    @Raven that's exactly what I was thinking! If there's a y chance of grass appearing every ingame day, after x days grass will have advanced by xy tiles, on average. The higher the x, the more likely it is the actual time required is xy. – badp Nov 06 '10 at 20:38
  • I love this question, and it might make for my first source diving expedition. – Sparr Nov 06 '10 at 22:36
  • Kind of related but at the same time not, CandBGaming put out a 14 minute sped-up video of grass growing. It doesn't really help answer this question, but . . . – Kevin Yap Nov 20 '10 at 06:08
  • @KevinY yes, especially because grass takes less time to grow in a plane that it does on a line :) – badp Nov 20 '10 at 20:49
  • 2
    Bit of an old post, but I just saw this on the forums.. It tracks the day night cycle and in theory could potentially be used for some form of calendar.. provided you had enough mushrooms :) http://www.minecraftforum.net/viewtopic.php?f=1020&t=165642 – James Apr 27 '11 at 22:32

4 Answers4

25

Watching grass grow will not help you tell the time.

Digging through the Minecraft source code to find an answer to your question revealed the following problems with calculating an average time for grass to grow:

  • It checks for grass two blocks in the North and East direction but only one block in the South and West. On the surface this appears to double the rate of growth depending on the direction your dirt column is oriented, but it is more complicated than this because the grass may actually skip a dirt block, creating random acceleration in the growth as well as a random interval.
  • The test for a nearby grass block to 'grow off' is from a randomly selected cube 4*4*6 blocks around the dirt block (it seems that grass grows downwards faster than any other direction. Interesting but irrelevant). You would need to provide a totally grass free area around the start of your dirt column EXCEPT for one grass block at the beginning of it, otherwise it will start off faster and then slow down. If the starting grass block decides to grow of it another direction you are back to square one with an uneven growth probability.
  • The actual time taken between these random checks is buried deep inside the Entity Renderer. Both the frame-rate (for every single frame for the duration of the growing period) and the rendering quality (from the option menu) will have a significant impact on how often it will check for a nearby grass block.

So what we have is a cascading series of random probabilities tied in with the rendering speed of your computer defining the 'average' speed that grass grows.

Okay, but what is the average time it takes grass to grow

After about 20 samples of the growth rate in game I calculated an average speed of one growth every 2 minutes 45 seconds. However, this figure is only accurate on my PC, was calculated by ignoring blocks that were way outside of the standard deviation (grew too fast or slow) and is a very rough approximation.

There is still hope!

So your hopes of telling time stochastically from grass are riddled with problems, but there are other methods of building giant in-game clocks. Since redstone repeaters are Turing complete and perfectly timed, it is entirely possible to build a fully functional clock in Minecraft.

Dave DuPlantis
  • 6,374
  • 4
  • 31
  • 50
Christopher
  • 2,676
  • 2
  • 23
  • 28
5

Tested this yesterday (wanted to know it aswell) and the result is:

It's apparently random

5 lines each with 10 blocks.

Some blocks began to spread grass after about 10secs others need several minutes or even (in game) days.

It seems that there is no scheme to when grass grows.

Iceag
  • 958
  • 6
  • 16
2

Time it. Make something like a dozen long lanes of soil, then leave minecraft running and record the time it takes each one to get to the end. Then do some math to find the average time for each block.

1

Poisson Process

http://en.wikipedia.org/wiki/Poisson_process

With a long enough row, you should be able to calculate time reasonably well assuming that grass growth is a homogenous Poisson process. It would need to be set up so it only has one direction to grow in, and that direction must be South or West.

It's probably easiest just to calibrate this empirically rather than trying to calculate it.