{"id":13729147,"url":"https://github.com/danijar/crafter","last_synced_at":"2025-04-12T14:19:40.223Z","repository":{"id":37441935,"uuid":"346185313","full_name":"danijar/crafter","owner":"danijar","description":"Benchmarking the Spectrum of Agent Capabilities","archived":false,"fork":false,"pushed_at":"2024-01-23T23:33:05.000Z","size":45596,"stargazers_count":426,"open_issues_count":10,"forks_count":70,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-12T14:19:29.854Z","etag":null,"topics":["artificial-intelligence","deep-learning","environment","minecraft","reinforcement-learning","simulation"],"latest_commit_sha":null,"homepage":"https://danijar.com/crafter","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danijar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-10T00:37:31.000Z","updated_at":"2025-04-06T07:56:19.000Z","dependencies_parsed_at":"2023-01-27T20:01:10.621Z","dependency_job_id":"3ba5891b-4a0e-4293-8273-4bab3cfd1170","html_url":"https://github.com/danijar/crafter","commit_stats":{"total_commits":161,"total_committers":4,"mean_commits":40.25,"dds":"0.018633540372670843","last_synced_commit":"e04542a2159f1aad3d4c5ad52e8185717380ee3a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fcrafter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fcrafter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fcrafter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fcrafter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danijar","download_url":"https://codeload.github.com/danijar/crafter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578875,"owners_count":21127714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","deep-learning","environment","minecraft","reinforcement-learning","simulation"],"created_at":"2024-08-03T02:00:55.709Z","updated_at":"2025-04-12T14:19:40.193Z","avatar_url":"https://github.com/danijar.png","language":"Python","funding_links":[],"categories":["Papers","Game \u0026 Simulation Environments"],"sub_categories":["ICML 2023"],"readme":"**Status:** Stable release\n\n[![PyPI](https://img.shields.io/pypi/v/crafter.svg)](https://pypi.python.org/pypi/crafter/#history)\n\n# Crafter\n\nOpen world survival game for evaluating a wide range of agent abilities within\na single environment.\n\n![Crafter Terrain](https://github.com/danijar/crafter/raw/main/media/terrain.png)\n\n## Overview\n\nCrafter features randomly generated 2D worlds where the player needs to forage\nfor food and water, find shelter to sleep, defend against monsters, collect\nmaterials, and build tools. Crafter aims to be a fruitful benchmark for\nreinforcement learning by focusing on the following design goals:\n\n- **Research challenges:** Crafter poses substantial challenges to current\n  methods, evaluating strong generalization, wide and deep exploration,\n  representation learning, and long-term reasoning and credit assignment.\n\n- **Meaningful evaluation:** Agents are evaluated by semantically meaningful\n  achievements that can be unlocked in each episode, offering insights into the\n  ability spectrum of both reward agents and unsupervised agents.\n\n- **Iteration speed:** Crafter evaluates many agent abilities within a single\n  env, vastly reducing the computational requirements over benchmarks suites\n  that require training on many separate envs from scratch.\n\nSee the research paper to find out more: [Benchmarking the Spectrum of Agent\nCapabilities](https://arxiv.org/pdf/2109.06780.pdf)\n\n```\n@article{hafner2021crafter,\n  title={Benchmarking the Spectrum of Agent Capabilities},\n  author={Danijar Hafner},\n  year={2021},\n  journal={arXiv preprint arXiv:2109.06780},\n}\n```\n\n## Play Yourself\n\n```sh\npython3 -m pip install crafter  # Install Crafter\npython3 -m pip install pygame   # Needed for human interface\npython3 -m crafter.run_gui      # Start the game\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eKeyboard mapping (click to expand)\u003c/summary\u003e\n\n| Key | Action |\n| :-: | :----- |\n| WASD | Move around |\n| SPACE| Collect material, drink from lake, hit creature |\n| TAB | Sleep |\n| T | Place a table |\n| R | Place a rock |\n| F | Place a furnace |\n| P | Place a plant |\n| 1 | Craft a wood pickaxe |\n| 2 | Craft a stone pickaxe |\n| 3 | Craft an iron pickaxe |\n| 4 | Craft a wood sword |\n| 5 | Craft a stone sword |\n| 6 | Craft an iron sword |\n\n\u003c/details\u003e\n\n![Crafter Video](https://github.com/danijar/crafter/raw/main/media/video.gif)\n\n## Interface\n\nTo install Crafter, run `pip3 install crafter`. The environment follows the\n[OpenAI Gym][gym] interface. Observations are images of size (64, 64, 3) and\noutputs are one of 17 categorical actions.\n\n```py\nimport gym\nimport crafter\n\nenv = gym.make('CrafterReward-v1')  # Or CrafterNoReward-v1\nenv = crafter.Recorder(\n  env, './path/to/logdir',\n  save_stats=True,\n  save_video=False,\n  save_episode=False,\n)\n\nobs = env.reset()\ndone = False\nwhile not done:\n  action = env.action_space.sample()\n  obs, reward, done, info = env.step(action)\n```\n\n[gym]: https://github.com/openai/gym\n\n## Evaluation\n\nAgents are allowed a budget of 1M environmnent steps and are evaluated by their\nsuccess rates of the 22 achievements and by their geometric mean score. Example\nscripts for computing these are included in the `analysis` directory of the\nrepository.\n\n- **Reward:** The sparse reward is `+1` for unlocking an achievement during\n  the episode and `-0.1` or `+0.1` for lost or regenerated health points.\n  Results should be reported not as reward but as success rates and score.\n\n- **Success rates:** The success rates of the 22 achievemnts are computed\n  as the percentage across all training episodes in which the achievement was\n  unlocked, allowing insights into the ability spectrum of an agent.\n\n- **Crafter score:** The score is the geometric mean of success rates, so that\n  improvements on difficult achievements contribute more than improvements on\n  achievements with already high success rates.\n\n## Scoreboards\n\nPlease create a pull request if you would like to add your or another algorithm\nto the scoreboards. For the reinforcement learning and unsupervised agents\ncategories, the interaction budget is 1M. The external knowledge category is\ndefined more broadly.\n\n### Reinforcement Learning\n\n| Algorithm | Score (%) | Reward | Open Source |\n|:----------|----------:|-------:|:-----------:|\n| [Curious Replay](https://arxiv.org/pdf/2306.15934.pdf) | 19.4±1.6 | - | [AutonomousAgentsLab/cr-dv3](https://github.com/AutonomousAgentsLab/cr-dv3) |\n| [PPO (ResNet)](https://arxiv.org/pdf/2307.03486.pdf)| 15.6±1.6 | 10.3±0.5 | [snu-mllab/Achievement-Distillation](https://github.com/snu-mllab/Achievement-Distillation) \n| [DreamerV3](https://arxiv.org/pdf/2301.04104v1.pdf) | 14.5±1.6 | 11.7±1.9 | [danijar/dreamerv3](https://github.com/danijar/dreamerv3) |\n| [LSTM-SPCNN](https://arxiv.org/pdf/2208.03374.pdf) | 12.1±0.8 | — | [astanic/crafter-ood](https://github.com/astanic/crafter-ood) |\n| [EDE](https://openreview.net/pdf?id=GZDsKahGY-2) | 11.7±1.0 | — | [yidingjiang/ede](https://github.com/yidingjiang/ede) |\n| [OC-SA](https://arxiv.org/pdf/2208.03374.pdf) | 11.1±0.7 | — | [astanic/crafter-ood](https://github.com/astanic/crafter-ood) |\n| [DreamerV2](https://arxiv.org/pdf/2010.02193.pdf) | 10.0±1.2 | 9.0±1.7 | [danijar/dreamerv2](https://github.com/danijar/dreamerv2) |\n| [PPO](https://arxiv.org/pdf/1710.02298.pdf) | 4.6±0.3 | 4.2±1.2 | [DLR-RM/stable-baselines3](https://github.com/DLR-RM/stable-baselines3) |\n| [Rainbow](https://arxiv.org/pdf/1710.02298.pdf) | 4.3±0.2 | 6.0±1.3 | [Kaixhin/Rainbow](https://github.com/Kaixhin/Rainbow) |\n\n### Unsupervised Agents\n\n| Algorithm | Score (%) | Reward | Open Source |\n|:----------|----------:|-------:|:-----------:|\n| [Plan2Explore](https://arxiv.org/pdf/2010.02193.pdf) | 2.1±0.1 | 2.1±1.5 | [danijar/dreamerv2](https://github.com/danijar/dreamerv2) |\n| [RND](https://arxiv.org/pdf/1810.12894.pdf) | 2.0±0.1 | 0.7±1.3 | [alirezakazemipour/PPO-RND](https://github.com/alirezakazemipour/PPO-RND) |\n| Random | 1.6±0.0 | 2.1±1.3 | — |\n\n### External Knowledge\n\n| Algorithm | Score (%) | Reward | Uses | Interaction | Open Source |\n|:----------|----------:|-------:|:-----|:-----------:|:-----------:|\n| [Human](https://en.wikipedia.org/wiki/Human) | 50.5±6.8 | 14.3±2.3 | Life experience | 0 | [crafter_human_dataset](https://archive.org/details/crafter_human_dataset) |\n| [SPRING](https://arxiv.org/pdf/2305.15486.pdf) | 27.3±1.2 | 12.3±0.7 | LLM, scene description, Crafter paper | 0 | ❌ |\n| [Achievement Distillation](https://arxiv.org/pdf/2307.03486.pdf) | 21.8±1.4 | 12.6±0.3 | Reward structure | 1M | [snu-mllab/Achievement-Distillation](https://github.com/snu-mllab/Achievement-Distillation) |\n| [ELLM](https://arxiv.org/pdf/2302.06692.pdf) | — | 6.0±0.4 | LLM, scene description | 5M | ❌ |\n\n## Baselines\n\nBaseline scores of various agents are available for Crafter, both with and\nwithout rewards. The scores are available in JSON format in the `scores`\ndirectory of the repository. For comparison, the score of human expert players\nis 50.5\\%. The [baseline\nimplementations](https://github.com/danijar/crafter-baselines) are available as\na separate repository.\n\n\u003cimg src=\"https://github.com/danijar/crafter/raw/main/media/scores.png\" width=\"400\"/\u003e\n\n## Questions\n\nPlease [open an issue][issues] on Github.\n\n[issues]: https://github.com/danijar/crafter/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanijar%2Fcrafter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanijar%2Fcrafter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanijar%2Fcrafter/lists"}