23 January 2018

Minecraft: Player Velocity

Still, remember Minecraft? The blocky game that sold minions? I've decided to do some theorycrafting on a different game this time. Just to throw something into the mix. Since I've been very hyped about velocity in the past days.

The Same Like Before

No! Let's do it differently! Well... we're still forced to do the calculation the same basically. The easiest way to determine the velocity is by using the formula in physics. Velocity equals the distance done per second. So the easiest way would be to determine the distance and the time and calculate velocity that way. I still wanna do things differently than before so instead of using my stopwatch I'm using Minecraft's features.

Getting the Value of the Variables

This is some common knowledge but if you didn't know yet you know now. In Minecraft, each block has a size of 1-meter times 1 meter. Using this we can easily determine the length of a distance by counting blocks. It's as easy as it sounds. For the time we're gonna do something different. The best way to get the time is by using the in-game time system. Minecraft has a day and night cycles that are 20 minutes long or 24000 ticks. Using the time command we can determine the current amount of ticks of the day:
  /time query daytime  
However, this will probably return some number between 0 and 24000 depending on what time of day it is. So we need to reset this count to a value that makes it easy for us to calculate the difference. Of course, we could use the query command twice and subtract to get the value but that makes things more complicated. Using this command we can reset the ticks of the day back to 0:
  /time set 0  

Building the Experiment

The next step is building the experiment. For this, we will build several blocks in a straight line and place redstone signals to the start point of the measurement and to the endpoint of the measurement. I did this for a normal line for us to walk and run on and another one for minecarts on a boosted railroad. counting the blocks between both results in 41 blocks or 41 meters in my case.

For our detection mechanic, we're gonna use a classical tripwire trap using string and tripwire. Once something walks upon it these tripwires will set off a redstone signal. We're going to use this signal to power the first command block that is going to set the time to zero ticks. At the end of the path, we place another one of these that will send a redstone signal to the other command block which will query the current time. This way we can determine the time it took us from the first tripwire to the second tripwire.

For the mine carts, we're going to use a detector rail instead. Detector rails send off a redstone signal when there's a  minecart on them. Just like the tripwires, the first detector rail will send a redstone signal off to the first command block resetting the number of ticks to zero. Another detector rail at the end will send off a redstone signal to a command block that will query the current amount of ticks that have passed.

And Now The Best Part About Experiments

Nothing is better than executing the experiments. Even though it's more fun when things blow up.
So for our player movement and riding movement, we simply run over the first tripwire until we reach the other tripwire. So let's see how long it takes me to walk this. It took me 195 ticks to walk this. How much time are 195 ticks? Using the Minecraft Wiki we know 1000 ticks equal to 50 seconds. That means 1 tick is 50 / 1000 = 0.05 seconds. So in our case 195 ticks are 195 * 0.05 = 9.75 seconds. So we did 41 meters in 9.75 seconds. That's a movement speed of  41m / 9.75s = 4.21 m/s.

Next up let's run our stretch. This time I got 150 ticks. Going through our calculation again we have 150 * 0.05 = 7.5 seconds. So we did 41 meters in 7.5 seconds. Now we're running with a  41m / 7.5s = 5.47 m/s.

Let's Move On With Riding

First the most fabulous of all the ridable animals. The Pig. Get a pig, put on a saddle, get out the stick with a carrot and off we go. This amazing gracious animal maxes out at an unbelievable time of 346 ticks. That's a whole 346 * 0.05 = 17.3 seconds. So the pig puts on a surprising amount of 41m / 17.3s = 2.37 m/s.

Let's better go into the opposite direction of the movement speeds. Spawning a horse and taming it we can run our stretch taking a time of mere 73 ticks or 73 * 0.05  = 3.65 seconds. That's a whole 41m / 3.65s = 11.23 m/s.

Now it also would be interesting to know if the other horse types have the same or nearly the same speed so let's check them out.

Going with a mule the time I reached was 127 ticks or 127 * 0.05 = 6.35 seconds.  So the mule did me a 41m / 6.35s = 6.46 m/s.

The donkey gave me a time of 114 ticks or 114 * 0.05 = 5.7 seconds. So it did a 41m / 5.7s = 7.19 m/s.

I also figured out pressing the run key must do something on mounts and well... the times are the same. So aside from changing the camera view and looking fancy holding the run key does not increase your speed at all.

Last Animal: The Mine Cart

What do you mean the mine cart is not an animal? I bet one can somehow craft together a theory explaining mine carts to be animals, but that's not our topic. Let's check out our minecart track, time and speed. I've built some more boosters before the first signal for the mine cart to reach the maximum speed before the first detector rail. So I'll take back at the beginning and place the cart there. Let's see what the times gonna be.

It's 105 ticks. That's 105 * 0.05 = 5.25 seconds over a distance of 41 meters. We got 41m / 5.25s = 7.81 m/s.

Bonus Experiment: Ship

Decided to add an additional bonus experiment. The concept is the same as without first track but on water now. 

We have to start a little earlier than our first checkpoint to reach maximum speed before. We need to do this to prevent the acceleration to inflict an error on our time. I made sure it's again 41 blocks so let's see what the time is.

It's 106 ticks. Nearly the same as the mine cart. That's 106 * 0.05 = 5.3 seconds over a distance of 41 meters. So that's 41m / 5.3s = 7.74 m/s.

No, mph?

Yes, no mph. Instead, you get this bonus experiment with the ship. If people really, really want me to do mph here I'll do it but for now, bare with what you get. It's not that hard to be like "7.74 m/s in mph" on google. :P

Liked the post? Noticed an error? Wanna discuss the content or leave a comment*? You can join or check into the discord to do so! (*Note: Comments are disabled to avoid saving user data on this website.)
>> Join Discord

About Me

My photo
I'm a B.Sc. Games Engineer and I created this blog to share my ideas, theorycrafting, thoughts and whatever I'm working on or doing.