From bd40b1abcd084c4186ad552766f7a406dd91abec Mon Sep 17 00:00:00 2001 From: GitJournal Date: Mon, 8 Jan 2024 17:47:57 +0800 Subject: [PATCH 01/27] update1 --- .fdignore | 4 + docs/.gitignore | 4 + docs/codeview.html | 522 +++++++++++++ docs/data/0.json | 548 +++++++++++++ docs/data/1.json | 545 +++++++++++++ docs/data/2.json | 545 +++++++++++++ docs/data/3.json | 547 +++++++++++++ docs/data/4.json | 13 + .../070cac4d-21b0-4008-9110-5d80d6a8f90a.json | 45 ++ .../0a53cd4c-c664-4838-9098-c9716ebd56cd.json | 50 ++ .../16ac124a-b251-4a99-8683-e0d477357768.json | 35 + .../198b2885-52e2-44a7-8f1a-ce757f808760.json | 60 ++ .../1af74e6e-3d8d-4619-88ff-310619755426.json | 50 ++ .../23f7199d-4253-4b37-976f-09d45221301e.json | 45 ++ .../4aa795e3-98ec-47f8-8182-b879751876fb.json | 15 + .../4ef7eda2-c6d2-49bc-adbf-3114c26ab5a4.json | 35 + .../53d0d63b-73f9-4375-aaf9-a688ebf98c23.json | 40 + .../828d206d-59f2-4b3a-a349-ae8a46170bbf.json | 20 + .../88ad27ef-f62f-4656-8119-f1c927ea9e23.json | 85 ++ .../8ad7a98e-71d5-45b5-8d54-39289d955faf.json | 25 + .../903dcbbc-91dd-401e-890a-99d089f47ff0.json | 60 ++ .../92354371-a8e4-4050-86ea-b7f99e23c23c.json | 135 ++++ .../925053b3-31c7-43ea-82f6-f2dce9a7ae76.json | 10 + .../a2d1b2f8-7ef8-401b-bcd6-d13ace4d050a.json | 45 ++ .../a9247fa2-5685-42aa-9868-427cb1469509.json | 50 ++ .../d2d35480-1f74-4e33-8d40-424ce68f773c.json | 25 + .../db701825-637c-44fd-b41d-84bfe67688a6.json | 80 ++ .../df146e51-7408-4269-aea9-9bd8aef08073.json | 10 + .../e31cbbf0-b729-43d3-860a-0c65c2b4ba6c.json | 35 + .../f0b9f841-a34f-4c6a-9af1-d1ef0e9df343.json | 35 + .../f800cd5e-0783-4f3e-bdde-61feee92aa21.json | 15 + docs/index.html | 724 ++++++++++++++++++ docs/metadata.json | 125 +++ docs/src/README.md | 497 ++++++++++++ docs/src/agent.py | 206 +++++ docs/src/behavioural_cloning.py | 143 ++++ docs/src/data_loader.py | 222 ++++++ docs/src/inverse_dynamics_model.py | 95 +++ docs/src/lib/action_head.py | 275 +++++++ docs/src/lib/action_mapping.py | 235 ++++++ docs/src/lib/actions.py | 178 +++++ docs/src/lib/impala_cnn.py | 195 +++++ docs/src/lib/masked_attention.py | 182 +++++ docs/src/lib/minecraft_util.py | 88 +++ docs/src/lib/misc.py | 263 +++++++ docs/src/lib/mlp.py | 31 + docs/src/lib/normalize_ewma.py | 60 ++ docs/src/lib/policy.py | 467 +++++++++++ docs/src/lib/scaled_mse_head.py | 50 ++ docs/src/lib/torch_util.py | 200 +++++ docs/src/lib/tree_util.py | 280 +++++++ docs/src/lib/util.py | 276 +++++++ docs/src/lib/xf.py | 479 ++++++++++++ docs/src/requirements.txt | 4 + docs/src/run_agent.py | 35 + docs/src/run_inverse_dynamics_model.py | 205 +++++ 56 files changed, 9248 insertions(+) create mode 100644 .fdignore create mode 100644 docs/.gitignore create mode 100644 docs/codeview.html create mode 100644 docs/data/0.json create mode 100644 docs/data/1.json create mode 100644 docs/data/2.json create mode 100644 docs/data/3.json create mode 100644 docs/data/4.json create mode 100644 docs/doc/070cac4d-21b0-4008-9110-5d80d6a8f90a.json create mode 100644 docs/doc/0a53cd4c-c664-4838-9098-c9716ebd56cd.json create mode 100644 docs/doc/16ac124a-b251-4a99-8683-e0d477357768.json create mode 100644 docs/doc/198b2885-52e2-44a7-8f1a-ce757f808760.json create mode 100644 docs/doc/1af74e6e-3d8d-4619-88ff-310619755426.json create mode 100644 docs/doc/23f7199d-4253-4b37-976f-09d45221301e.json create mode 100644 docs/doc/4aa795e3-98ec-47f8-8182-b879751876fb.json create mode 100644 docs/doc/4ef7eda2-c6d2-49bc-adbf-3114c26ab5a4.json create mode 100644 docs/doc/53d0d63b-73f9-4375-aaf9-a688ebf98c23.json create mode 100644 docs/doc/828d206d-59f2-4b3a-a349-ae8a46170bbf.json create mode 100644 docs/doc/88ad27ef-f62f-4656-8119-f1c927ea9e23.json create mode 100644 docs/doc/8ad7a98e-71d5-45b5-8d54-39289d955faf.json create mode 100644 docs/doc/903dcbbc-91dd-401e-890a-99d089f47ff0.json create mode 100644 docs/doc/92354371-a8e4-4050-86ea-b7f99e23c23c.json create mode 100644 docs/doc/925053b3-31c7-43ea-82f6-f2dce9a7ae76.json create mode 100644 docs/doc/a2d1b2f8-7ef8-401b-bcd6-d13ace4d050a.json create mode 100644 docs/doc/a9247fa2-5685-42aa-9868-427cb1469509.json create mode 100644 docs/doc/d2d35480-1f74-4e33-8d40-424ce68f773c.json create mode 100644 docs/doc/db701825-637c-44fd-b41d-84bfe67688a6.json create mode 100644 docs/doc/df146e51-7408-4269-aea9-9bd8aef08073.json create mode 100644 docs/doc/e31cbbf0-b729-43d3-860a-0c65c2b4ba6c.json create mode 100644 docs/doc/f0b9f841-a34f-4c6a-9af1-d1ef0e9df343.json create mode 100644 docs/doc/f800cd5e-0783-4f3e-bdde-61feee92aa21.json create mode 100644 docs/index.html create mode 100644 docs/metadata.json create mode 100644 docs/src/README.md create mode 100644 docs/src/agent.py create mode 100644 docs/src/behavioural_cloning.py create mode 100644 docs/src/data_loader.py create mode 100644 docs/src/inverse_dynamics_model.py create mode 100644 docs/src/lib/action_head.py create mode 100644 docs/src/lib/action_mapping.py create mode 100644 docs/src/lib/actions.py create mode 100644 docs/src/lib/impala_cnn.py create mode 100644 docs/src/lib/masked_attention.py create mode 100644 docs/src/lib/minecraft_util.py create mode 100644 docs/src/lib/misc.py create mode 100644 docs/src/lib/mlp.py create mode 100644 docs/src/lib/normalize_ewma.py create mode 100644 docs/src/lib/policy.py create mode 100644 docs/src/lib/scaled_mse_head.py create mode 100644 docs/src/lib/torch_util.py create mode 100644 docs/src/lib/tree_util.py create mode 100644 docs/src/lib/util.py create mode 100644 docs/src/lib/xf.py create mode 100644 docs/src/requirements.txt create mode 100644 docs/src/run_agent.py create mode 100644 docs/src/run_inverse_dynamics_model.py diff --git a/.fdignore b/.fdignore new file mode 100644 index 0000000..d83afc4 --- /dev/null +++ b/.fdignore @@ -0,0 +1,4 @@ +.* +cursors +LICENSE +docs \ No newline at end of file diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..c6a61aa --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,4 @@ +!.gitignore +!* +!*/* +cache_db.json diff --git a/docs/codeview.html b/docs/codeview.html new file mode 100644 index 0000000..9e2cb49 --- /dev/null +++ b/docs/codeview.html @@ -0,0 +1,522 @@ + + + + + + + + + Code View + + + + + + + + + + + +
+

Code Preview

+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/data/0.json b/docs/data/0.json new file mode 100644 index 0000000..cd462a4 --- /dev/null +++ b/docs/data/0.json @@ -0,0 +1,548 @@ +{ + "0": { + "file_id": 0, + "content": "/README.md", + "type": "filepath" + }, + "1": { + "file_id": 0, + "content": "The comments discuss Minecraft AI model training, reinforcement learning features, and limited resource data collection for the MineRL BASALT 2022 competition, as well as building a house in under 10 minutes without harming villages.", + "type": "summary" + }, + "2": { + "file_id": 0, + "content": "# Video-Pre-Training\nVideo PreTraining (VPT): Learning to Act by Watching Unlabeled Online Videos\n> :page_facing_up: [Read Paper](https://cdn.openai.com/vpt/Paper.pdf) \\\n :mega: [Blog Post](https://openai.com/blog/vpt) \\\n :space_invader: [MineRL Environment](https://github.com/minerllabs/minerl) (note version 1.0+ required) \\\n :checkered_flag: [MineRL BASALT Competition](https://www.aicrowd.com/challenges/neurips-2022-minerl-basalt-competition)\n# Running agent models\nInstall pre-requirements for [MineRL](https://minerl.readthedocs.io/en/latest/tutorials/index.html).\nThen install requirements with:\n```\npip install git+https://github.com/minerllabs/minerl\npip install -r requirements.txt\n```\nTo run the code, call\n```\npython run_agent.py --model [path to .model file] --weights [path to .weight file]\n```\nAfter loading up, you should see a window of the agent playing Minecraft.\n# Agent Model Zoo\nBelow are the model files and weights files for various pre-trained Minecraft models.\nThe 1x, 2x and 3x model files correspond to their respective model weights width.", + "type": "code", + "location": "/README.md:3-35" + }, + "3": { + "file_id": 0, + "content": "This code provides instructions for setting up and running the Video PreTraining (VPT) model, which learns to act by watching unlabeled online videos. It also includes a link to the paper describing the methodology and provides information on where to find more resources related to VPT. The code includes commands to install pre-requisites, requirements, and run the agent models. Additionally, it lists various pre-trained Minecraft models with their respective model files and weights.", + "type": "comment" + }, + "4": { + "file_id": 0, + "content": "* [:arrow_down: 1x Model](https://openaipublic.blob.core.windows.net/minecraft-rl/models/foundation-model-1x.model)\n* [:arrow_down: 2x Model](https://openaipublic.blob.core.windows.net/minecraft-rl/models/2x.model)\n* [:arrow_down: 3x Model](https://openaipublic.blob.core.windows.net/minecraft-rl/models/foundation-model-3x.model)\n### Demonstration Only - Behavioral Cloning\nThese models are trained on video demonstrations of humans playing Minecraft\nusing behavioral cloning (BC) and are more general than later models which\nuse reinforcement learning (RL) to further optimize the policy.\nFoundational models are trained across all videos in a single training run\nwhile house and early game models refine their respective size foundational\nmodel further using either the housebuilding contractor data or early game video\nsub-set. See the paper linked above for more details.\n#### Foundational Model :chart_with_upwards_trend:\n * [:arrow_down: 1x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/foundation-model-1x.weights)", + "type": "code", + "location": "/README.md:37-51" + }, + "5": { + "file_id": 0, + "content": "This code provides links to download pre-trained models for Minecraft reinforcement learning, trained using behavioral cloning on video demonstrations. Foundational models are trained across all videos in a single training run, while house and early game models refine further with specific data sets.", + "type": "comment" + }, + "6": { + "file_id": 0, + "content": " * [:arrow_down: 2x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/foundation-model-2x.weights)\n * [:arrow_down: 3x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/foundation-model-3x.weights)\n#### Fine-Tuned from House :chart_with_upwards_trend:\n * [:arrow_down: 3x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/bc-house-3x.weights)\n#### Fine-Tuned from Early Game :chart_with_upwards_trend:\n * [:arrow_down: 2x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/bc-early-game-2x.weights)\n * [:arrow_down: 3x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/bc-early-game-3x.weights)\n### Models With Environment Interactions\nThese models further refine the above demonstration based models with a reward\nfunction targeted at obtaining diamond pickaxes. While less general then the behavioral\ncloning models, these models have the benefit of interacting with the environment", + "type": "code", + "location": "/README.md:52-65" + }, + "7": { + "file_id": 0, + "content": "This code provides links to pre-trained models for Minecraft gameplay and mentions fine-tuned models from specific starting points. Additionally, it introduces models with environment interactions that are trained using a reward function aimed at obtaining diamond pickaxes.", + "type": "comment" + }, + "8": { + "file_id": 0, + "content": "using a reward function and excel at progressing through the tech tree quickly.\nSee the paper for more information\non how they were trained and the exact reward schedule.\n#### RL from Foundation :chart_with_upwards_trend:\n * [:arrow_down: 2x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/rl-from-foundation-2x.weights)\n#### RL from House :chart_with_upwards_trend:\n * [:arrow_down: 2x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/rl-from-house-2x.weights)\n#### RL from Early Game :chart_with_upwards_trend:\n * [:arrow_down: 2x Width Weights](https://openaipublic.blob.core.windows.net/minecraft-rl/models/rl-from-early-game-2x.weights)\n# Running Inverse Dynamics Model (IDM)\nIDM aims to predict what actions player is taking in a video recording.\nSetup:\n* Install requirements: `pip install -r requirements.txt`\n* Download the IDM model [.model :arrow_down:](https://openaipublic.blob.core.windows.net/minecraft-rl/idm/4x_idm.model) and [.weight :arrow_down:](https://openaipublic.blob.core.windows.net/minecraft-rl/idm/4x_idm.weights) files", + "type": "code", + "location": "/README.md:66-85" + }, + "9": { + "file_id": 0, + "content": "This code provides pre-trained models for Minecraft gameplay using reinforcement learning and an Inverse Dynamics Model (IDM). The models are trained with different reward functions and excel at progressing quickly through the tech tree. Users can download the models and weights from specified URLs to run the IDM, which predicts player actions in a video recording.", + "type": "comment" + }, + "10": { + "file_id": 0, + "content": "* For demonstration purposes, you can use the contractor recordings shared below to. For this demo we use\n [this .mp4](https://openaipublic.blob.core.windows.net/minecraft-rl/data/10.0/cheeky-cornflower-setter-02e496ce4abb-20220421-092639.mp4)\n and [this associated actions file (.jsonl)](https://openaipublic.blob.core.windows.net/minecraft-rl/data/10.0/cheeky-cornflower-setter-02e496ce4abb-20220421-092639.jsonl).\nTo run the model with above files placed in the root directory of this code:\n```\npython run_inverse_dynamics_model.py -weights 4x_idm.weights --model 4x_idm.model --video-path cheeky-cornflower-setter-02e496ce4abb-20220421-092639.mp4 --jsonl-path cheeky-cornflower-setter-02e496ce4abb-20220421-092639.jsonl\n```\nA window should pop up which shows the video frame-by-frame, showing the predicted and true (recorded) actions side-by-side on the left.\nNote that `run_inverse_dynamics_model.py` is designed to be a demo of the IDM, not code to put it into practice.\n# Using behavioural cloning to fine-tune the models", + "type": "code", + "location": "/README.md:86-99" + }, + "11": { + "file_id": 0, + "content": "This code provides a demonstration of the Inverse Dynamics Model (IDM) using provided contractor recordings for video and actions. The model is run with specific file paths, and a window displays the predicted and true actions side-by-side. Note that this script is designed for demonstration purposes only, not for practical implementation.", + "type": "comment" + }, + "12": { + "file_id": 0, + "content": "**Disclaimer:** This code is a rough demonstration only and not an exact recreation of what original VPT paper did (but it contains some preprocessing steps you want to be aware of)! As such, do not expect replicate the original experiments with this code. This code has been designed to be run-able on consumer hardware (e.g., 8GB of VRAM).\nSetup:\n* Install requirements: `pip install -r requirements.txt`\n* Download `.weights` and `.model` file for model you want to fine-tune.\n* Download contractor data (below) and place the `.mp4` and `.jsonl` files to the same directory (e.g., `data`). With default settings, you need at least 12 recordings.\nIf you downloaded the \"1x Width\" models and placed some data under `data` directory, you can perform finetuning with\n```\npython behavioural_cloning.py --data-dir data --in-model foundation-model-1x.model --in-weights foundation-model-1x.weights --out-weights finetuned-1x.weights\n```\nYou can then use `finetuned-1x.weights` when running the agent. You can change the training settings at the top of `behavioural_cloning.py`.", + "type": "code", + "location": "/README.md:101-114" + }, + "13": { + "file_id": 0, + "content": "This code is a demonstration of video pre-training using behavioral cloning. It requires installing dependencies, downloading model and data files, and then fine-tuning the model with custom weights for better performance.", + "type": "comment" + }, + "14": { + "file_id": 0, + "content": "Major limitations:\n- Only trains single step at the time, i.e., errors are not propagated through timesteps.\n- Computes gradients one sample at a time to keep memory use low, but also slows down the code.\n# Contractor Demonstrations\n### Versions\nOver the course of the project we requested various demonstrations from contractors\nwhich we release as index files below. In general, major recorder versions change for a new\nprompt or recording feature while bug-fixes were represented as minor version changes.\nHowever, some\nrecorder versions we asked contractors to change their username when recording particular\nmodalities. Also, as contractors internally ask questions, clarification from one contractor may\nresult in a behavioral change in the other contractor. It is intractable to share every contractor's\nview for each version, but we've shared the prompts and major clarifications for each recorder\nversion where the task changed significantly.\n
\n Initial Prompt\n We are collect", + "type": "code", + "location": "/README.md:116-136" + }, + "15": { + "file_id": 0, + "content": "This code is a README.md file that lists the major limitations of the pre-training, describes a contractor demonstrations section, and provides details about the versions used for this project. It also mentions how different versions were used to change modalities or prompt changes due to contractor's internal questions and clarifications.", + "type": "comment" + }, + "16": { + "file_id": 0, + "content": "ing data for training AI models in Minecraft. You'll need to install java, download the modified version of minecraft (that collects and uploads your play data), and play minecraft survival mode! Paid per hour of gameplay. Prior experience in minecraft not. necessary. We do not collect any data that is unrelated to minecraft from your computer.\n
\nThe following is a list of the available versions:\n* **6.x** Core recorder features subject to change [:arrow_down: index file](https://openaipublic.blob.core.windows.net/minecraft-rl/snapshots/all_6xx_Jun_29.json)\n * 6.9 First feature complete recorder version\n * 6.10 Fixes mouse scaling on Mac when gui is open\n * 6.11 Tracks the hotbar slot\n * 6.13 Sprinting, swap-hands, ... (see commits below)\n
\n Commits\n * improve replays that are cut in the middle of gui; working on riding boats / replays cut in the middle of a run\n * improve replays by adding dwheel action etc, also, loosen up replay tolerances\n * opencv version bump", + "type": "code", + "location": "/README.md:136-152" + }, + "17": { + "file_id": 0, + "content": "This code is a list of available versions for the Minecraft AI model training program. It includes a description of the features in each version and provides links to download the modified Minecraft version for training.", + "type": "comment" + }, + "18": { + "file_id": 0, + "content": " * add swap hands, and recording of the step timestamp\n * implement replaying from running and sprinting and tests\n * do not record sprinting (can use stats for that)\n * check for mouse button number, ignore >2\n * handle the errors when mouse / keyboard are recorded as null\n
\n* **7.x** Prompt changes [:arrow_down: index file](https://openaipublic.blob.core.windows.net/minecraft-rl/snapshots/all_7xx_Apr_6.json)\n * 7.6 Bump version for internal tracking\n
\n Additional ask to contractors\n Right now, early game data is especially valuable to us. As such, we request that at least half of the data you upload is from the first 30 minutes of the game. This means that, for every hour of gameplay you spend in an older world, we ask you to play two sessions in which you create a new world and play for 30 minutes. You can play for longer in these worlds, but only the first 30 minutes counts as early game data.\n
\n* **8.x** :clipboard", + "type": "code", + "location": "/README.md:153-168" + }, + "19": { + "file_id": 0, + "content": "This code seems to be part of a README file for a Minecraft-based reinforcement learning project. The comments suggest that the developers are working on various features such as swapping hands and implementing replaying from running and sprinting. They also mention not recording sprinting data, checking for mouse button numbers, and handling errors related to recording mouse or keyboard input as null. Additionally, there is a note about prompting contractors to collect early game data (first 30 minutes) in newer worlds to help improve the AI's performance in those stages of the game.", + "type": "comment" + }, + "20": { + "file_id": 0, + "content": ": House Building from Scratch Task [:arrow_down: index](https://openaipublic.blob.core.windows.net/minecraft-rl/snapshots/all_8xx_Jun_29.json)\n
\n Changes and Prompt\n Hi all! Thank you for your hard work so far.\n This week we would like to have you all collect data on a specific task.\n This comes with a new recorder version 8.0 which you will need to update your recording script to download.\n This week we would like you to use a new world each time you play, so loading existing worlds is disabled.\n The new task is as follows:\n Starting in a new world, build a simple house in 10-15 minutes. This corresponds to one day and a bit of the night. Please use primarily wood, dirt, and sand, as well as crafted wood items such as doors, fences, ect. in constructing your house. Avoid using difficult items such as stone. Aside from those constraints, you may decorate the structure you build as you wish. It does not need to have any specific furniture. For example, it is ", + "type": "code", + "location": "/README.md:168-182" + }, + "21": { + "file_id": 0, + "content": "This code is providing instructions for a new task, \"Building a Simple House\". The task involves building a house using primarily wood, dirt, and sand, along with crafted wood items. The structure can be decorated as desired but should not use difficult materials such as stone. It also provides information about the need to update the recording script and use a new world each time.", + "type": "comment" + }, + "22": { + "file_id": 0, + "content": "OK if there is no bed in your house. If you have not finished the house by the sunrise (20 minutes) please exit and continue to another demonstration. Please continue to narrate what you are doing while completing this task.\n Since you will be unable to resume building after exiting Minecraft or going back to the main menu, you must finish these demonstrations in one session. Pausing via the menu is still supported. If you want to view your creations later, they will be saved locally so you can look at them in your own time. We may use these save files in a future task so if you have space, please leave the save files titled “build-house-15-min-“.\n For this week try to avoid all cobblestone / stone / granite\n For this week we just want simple houses without sleeping. If 10 minutes is too short, let us know and we can think of how to adjust!\n Stone tools are ok but I think you may run-out of time\n Changes:\n * Timer ends episode after 10 realtime minutes\n * Worlds are named: `\"build-house-15-min-\" + Math.abs(random.nextInt());`", + "type": "code", + "location": "/README.md:182-194" + }, + "23": { + "file_id": 0, + "content": "This code is for a Minecraft demonstration task where the player must build a house within 20 minutes. If not finished, they should exit and continue with another demo. Narration is required throughout. The demonstrations need to be completed in one session without resuming after exiting or going back to the main menu. Save files will be saved locally for viewing later but may be used for future tasks if space permits. The task requires a simple house without sleep areas and avoids cobblestone, stone, and granite. Stone tools are acceptable but time-limited. The episode ends after 10 realtime minutes. World names follow the format \"build-house-15-min-\" + random number.", + "type": "comment" + }, + "24": { + "file_id": 0, + "content": "
\n * Note this version introduces 10-minute timer that ends the episode. It\n cut experiments short occasionally and was fixed in 9.1\n * 8.0 Simple House\n * 8.2 Update upload script\n* **9.x** :clipboard: House Building from Random Starting Materials Task [:arrow_down: index](https://openaipublic.blob.core.windows.net/minecraft-rl/snapshots/all_9xx_Jun_29.json)\n
\n Changes and Prompt\n You now will have 10 minutes to use the provided resources to build your house / home / or structure. In this version, the experiment will time out after 10 minutes if you are not complete so don't be alarmed if that happens, it is intentional.\n No need to use up all the resources! It's ok to collect a few things but spend the majority of the time placing blocks (the act of placing seems to be harder to learn)\n Changes:\n * Worlds are named: `\"design-house-10-min-\" + Math.abs(random.nextInt());`\n * Starting inventory given by code below\n
\n
", + "type": "code", + "location": "/README.md:196-215" + }, + "25": { + "file_id": 0, + "content": "Introduces 10-minute timer for task completion.", + "type": "comment" + }, + "26": { + "file_id": 0, + "content": " Random Starting Inventory Code\n ```java\n Random random = new Random();\n List hotbar = new ArrayList<>();\n List inventory = new ArrayList<>();\n // Ensure we give the player the basic tools in their hot bar\n hotbar.add(new ItemStack(Items.STONE_AXE));\n hotbar.add(new ItemStack(Items.STONE_PICKAXE));\n hotbar.add(new ItemStack(Items.STONE_SHOVEL));\n hotbar.add(new ItemStack(Items.CRAFTING_TABLE));\n // Add some random items to the player hotbar as well\n addToList(hotbar, inventory, Items.TORCH, random.nextInt(16) * 2 + 2);\n // Next add main building blocks\n if (random.nextFloat() < 0.7) {\n addToList(hotbar, inventory, Items.OAK_FENCE_GATE, random.nextInt(5));\n addToList(hotbar, inventory, Items.OAK_FENCE, random.nextInt(5) * 64);\n addToList(hotbar, inventory, Items.OAK_DOOR, random.nextInt(5));\n addToList(hotbar, inventory, Items.OAK_TRAPDOOR, random.nextInt(2) * 2);", + "type": "code", + "location": "/README.md:216-237" + }, + "27": { + "file_id": 0, + "content": "This code generates a random starting inventory for the player by adding basic tools, some random items, and building blocks to their hotbar and inventory.", + "type": "comment" + }, + "28": { + "file_id": 0, + "content": " addToList(hotbar, inventory, Items.OAK_PLANKS, random.nextInt(3) * 64 + 128);\n addToList(hotbar, inventory, Items.OAK_SLAB, random.nextInt(3) * 64);\n addToList(hotbar, inventory, Items.OAK_STAIRS, random.nextInt(3) * 64);\n addToList(hotbar, inventory, Items.OAK_LOG, random.nextInt(2) * 32);\n addToList(hotbar, inventory, Items.OAK_PRESSURE_PLATE, random.nextInt(5));\n } else {\n addToList(hotbar, inventory, Items.BIRCH_FENCE_GATE, random.nextInt(5));\n addToList(hotbar, inventory, Items.BIRCH_FENCE, random.nextInt(5) * 64);\n addToList(hotbar, inventory, Items.BIRCH_DOOR, random.nextInt(5));\n addToList(hotbar, inventory, Items.BIRCH_TRAPDOOR, random.nextInt(2) * 2);\n addToList(hotbar, inventory, Items.BIRCH_PLANKS, random.nextInt(3) * 64 + 128);\n addToList(hotbar, inventory, Items.BIRCH_SLAB, random.nextInt(3) * 64);\n addToList(hotbar, inventory, Items.BIRCH_STAIRS, random.nextInt(3) * 64);", + "type": "code", + "location": "/README.md:238-250" + }, + "29": { + "file_id": 0, + "content": "This code randomly selects items to add to the hotbar based on the type of biome the player is in. It uses different lists of items for oak and birch biomes.", + "type": "comment" + }, + "30": { + "file_id": 0, + "content": " addToList(hotbar, inventory, Items.BIRCH_LOG, random.nextInt(2) * 32);\n addToList(hotbar, inventory, Items.BIRCH_PRESSURE_PLATE, random.nextInt(5));\n }\n // Now add some random decoration items to the player inventory\n addToList(hotbar, inventory, Items.CHEST, random.nextInt(3));\n addToList(hotbar, inventory, Items.FURNACE, random.nextInt(2) + 1);\n addToList(hotbar, inventory, Items.GLASS_PANE, random.nextInt(5) * 4);\n addToList(hotbar, inventory, Items.WHITE_BED, (int) (random.nextFloat() + 0.2)); // Bed 20% of the time\n addToList(hotbar, inventory, Items.PAINTING, (int) (random.nextFloat() + 0.1)); // Painting 10% of the time\n addToList(hotbar, inventory, Items.FLOWER_POT, (int) (random.nextFloat() + 0.1) * 4); // 4 Flower pots 10% of the time\n addToList(hotbar, inventory, Items.OXEYE_DAISY, (int) (random.nextFloat() + 0.1) * 4); // 4 Oxeye daisies 10% of the time\n addToList(hotbar, inventory, Items.POPPY, (int) (random.nextFloat() + 0.1) * 4); // 4 Poppies 10% of the time", + "type": "code", + "location": "/README.md:251-263" + }, + "31": { + "file_id": 0, + "content": "This code is adding a variety of items to the player's inventory. It uses random number generation to decide how many of each item to add, with some items having a higher chance of appearing than others (e.g., beds have a 20% chance). This helps create a diverse and unpredictable inventory for the player to work with.", + "type": "comment" + }, + "32": { + "file_id": 0, + "content": " addToList(hotbar, inventory, Items.SUNFLOWER, (int) (random.nextFloat() + 0.1) * 4); // 4 Sunflowers 10% of the time\n // Shuffle the hotbar slots and inventory slots\n Collections.shuffle(hotbar);\n Collections.shuffle(inventory);\n // Give the player the items\n this.mc.getIntegratedServer().getPlayerList().getPlayers().forEach(p -> {\n if (p.getUniqueID().equals(this.getUniqueID())) {\n hotbar.forEach(p.inventory::addItemStackToInventory);\n inventory.forEach(p.inventory::addItemStackToInventory);\n }\n });\n ```\n
\n * 9.0 First version\n * 9.1 Fixed timer bug\n* **10.0** :clipboard: Obtain Diamond Pickaxe Task [:arrow_down: index](https://openaipublic.blob.core.windows.net/minecraft-rl/snapshots/all_10xx_Jun_29.json)\n
\n Changes and Prompt\n Prompt:\n For this new task we have given you 20 minutes to craft a diamond pickaxe. We ask that you do not try to search for vi", + "type": "code", + "location": "/README.md:264-288" + }, + "33": { + "file_id": 0, + "content": "This code adds 4 sunflowers to the player's inventory 10% of the time, shuffles both the hotbar and inventory slots, and then gives the player the items if they are the same as the current player.", + "type": "comment" + }, + "34": { + "file_id": 0, + "content": "llages or other ways of getting diamonds, but if you are spawned in view of one, or happen to fall into a cave structure feel free to explore it for diamonds.\n If 20 min is not enough that is OK. It will happen on some seeds because of bad luck. Please do not use glitches to find the diamonds.\n Changes:\n * change to 20 minute time limit\n * _don't count gui time as part of the time limit_\n * World are named `\"collect-diamond-pickaxe-15min-\" + Math.abs(random.nextInt());`\n
\nSometimes we asked the contractors to signify other tasks besides changing the version. This\nprimarily occurred in versions 6 and 7 as 8, 9 and 10 are all task specific.\n
\nPrompt to contractors (click to show)\nAnother request about additional time - please use some of it to chop trees. Specifically, please start the recorder by adding --username treechop argument to the script (i.e. use play --username treechop on windows, ./play.sh --username treechop on osx/linux), and spend some time", + "type": "code", + "location": "/README.md:288-304" + }, + "35": { + "file_id": 0, + "content": "Code discusses time limits for finding diamonds in Minecraft, changing version numbers, and requesting contractors to chop trees while recording gameplay with a specific username.", + "type": "comment" + }, + "36": { + "file_id": 0, + "content": " chopping trees! Getting wooden or stone tools is ok, but please spend the majority of the with username treechop specifically chopping. I did it myself for about 15 minutes, and it does get boring pretty quickly, so I don't expect you to do it all the time, but please do at least a little bit of chopping. Feel free to play normally the rest of the time (but please restart without --username treechop argument when you are not chopping)\nHowever, it is preferable that you start a new world though, and use only the tools that are easily obtainable in that world. I'll see what I can do about getting player an iron axe - that sounds reasonable, and should not be hard, but will require a code update.\n
\n### Environment\nWe restrict the contractors to playing Minecraft in windowed mode at 720p which we downsample at 20hz to 360p\nto minimize space. We also disabled the options screen to prevent the contractor from\nchanging things such as brightness, or rendering options. We ask contractors not to press keys", + "type": "code", + "location": "/README.md:304-311" + }, + "37": { + "file_id": 0, + "content": "The code is providing instructions for the video game Minecraft, asking testers to spend a portion of their time chopping trees and using easily obtainable tools in a new world. It also mentions restrictions on the contractor's environment, such as windowed mode, downsampling, and disabling options like brightness and rendering settings.", + "type": "comment" + }, + "38": { + "file_id": 0, + "content": "such as f3 which shows a debug overlay, however some contractors may still do this.\n### Data format\nDemonstrations are broken up into up to 5 minute segments consisting of a series of\ncompressed screen observations, actions, environment statistics, and a checkpoint\nsave file from the start of the segment. Each relative path in the index will\nhave all the files for that given segment, however if a file was dropped while\nuploading, the corresponding relative path is not included in the index therefore\nthere may be missing chunks from otherwise continuous demonstrations.\nIndex files are provided for each version as a json file:\n```json\n{\n \"basedir\": \"https://openaipublic.blob.core.windows.net/data/\",\n \"relpaths\": [\n \"8.0/cheeky-cornflower-setter-74ae6c2eae2e-20220315-122354\",\n ...\n ]\n}\n```\nRelative paths follow the following format:\n* `/---