This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
labs:minecraft [2016/05/24 12:52] pbrandes |
labs:minecraft [2020/08/31 21:03] (current) |
||
---|---|---|---|
Line 3: | Line 3: | ||
You are provided a modded version of Minecraft which allows you to connect to a running game world to obtain a robot called a "turtle". When you close the connection, the robot disappears. You may also open multiple connections to obtain multiple robots which can then work in parallel. | You are provided a modded version of Minecraft which allows you to connect to a running game world to obtain a robot called a "turtle". When you close the connection, the robot disappears. You may also open multiple connections to obtain multiple robots which can then work in parallel. | ||
- | The setup is based on the mod [[http://www.computercraft.info/|ComputerCraft]] and as such provides the same [[http://computercraft.info/wiki/Turtle_%28API%29|API]]. A small example demonstrating some of the turtles' functions can be found [[http://ttsil.net/misc/turtlecraft/TurtleClient.zip|here]]. | + | The setup is based on the turtles in the mod ComputerCraft and as such provides the same [[http://computercraft.info/wiki/Turtle_%28API%29|API]]. A small example demonstrating some of the turtles' functions can be found [[http://www.disco.ethz.ch/members/mikoenig/TurtleClient.zip|here]]. |
Even though most tasks can be solved using only one turtle, parallelization is the key to do them quickly. This introduces a few synchronization issues that you need to deal with: how to divide the task among the turtles and how to prevent turtles from crashing into each other. | Even though most tasks can be solved using only one turtle, parallelization is the key to do them quickly. This introduces a few synchronization issues that you need to deal with: how to divide the task among the turtles and how to prevent turtles from crashing into each other. | ||
Line 11: | Line 11: | ||
==== Exercise 0 ==== | ==== Exercise 0 ==== | ||
- | Download the [[http://ttsil.net/misc/turtlecraft/TurtleClient.zip|example Eclipse project]], and run it on a singleplayer world. | + | Download the [[http://www.disco.ethz.ch/members/mikoenig/TurtleClient.zip|example Eclipse project]], and run it on a singleplayer world. |
If you can't find the turtle moving about, try printing its location using ''System.out'' or using a flat world (seed: "qwer"). | If you can't find the turtle moving about, try printing its location using ''System.out'' or using a flat world (seed: "qwer"). | ||
If you have trouble understanding what's going on, be sure to check out the [[labs:minecraft#Hints|Hints section]] below! | If you have trouble understanding what's going on, be sure to check out the [[labs:minecraft#Hints|Hints section]] below! | ||
Line 28: | Line 28: | ||
Try to complete this task as quickly as possible by using as many turtles as you can handle! On world seed "qwer" 50 seconds is a good time. The assistants' record is 47.2 seconds. | Try to complete this task as quickly as possible by using as many turtles as you can handle! On world seed "qwer" 50 seconds is a good time. The assistants' record is 47.2 seconds. | ||
- | To tell the mod to detect the tower, download [[http://ttsil.net/misc/turtlecraft/ComputerCraft.cfg|this config file]] and place it in your /home/ubuntu/.minecraft/config folder. Again, the tower should start at y = 90 and be centered around the spawning location. | + | To tell the mod to detect the tower, download [[http://www.disco.ethz.ch/members/mikoenig/ComputerCraft.cfg|this config file]] and place it in your /home/ubuntu/.minecraft/config folder. Again, the tower should start at y = 90 and be centered around the spawning location. |
Hint: Use ''getItemDetail()'' to find out what materials you picked up! | Hint: Use ''getItemDetail()'' to find out what materials you picked up! | ||
Line 50: | Line 50: | ||
* We extended the [[http://computercraft.info/wiki/Turtle_%28API%29|Turtle API]] by 2 additional methods to allow a turtle to determine its position and orientation in the world: getLocation() and getFacing(). | * We extended the [[http://computercraft.info/wiki/Turtle_%28API%29|Turtle API]] by 2 additional methods to allow a turtle to determine its position and orientation in the world: getLocation() and getFacing(). | ||
* Singleplayer worlds pause when the window loses focus unless you select "Open to LAN" in the menu. | * Singleplayer worlds pause when the window loses focus unless you select "Open to LAN" in the menu. | ||
- | |||
- | |||
- | ==== Installing from scratch ==== | ||
- | If you want to run the mod at home, you need to install [[http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.9.html|Minecraft Forge for Minecraft 1.8.9]] over an existing Minecraft Installation to add the "forge" profile to the launcher. Then copy [[http://ttsil.net/misc/turtlecraft/cc.jar|the mod]] into the ~/.minecraft/mods folder. After launching the first time with the mod installed, a configuration file with default values for the measured goal will appear in ~/.minecraft/config. | ||
- | |||
- | You may also be interested in the original [[http://www.computercraft.info/|ComputerCraft mod]] in which turtles are programmed directly in the game in [[http://www.lua.org/|Lua]]. |