Craftax agents
Four agents for Craftax, as ONNX files. Watch them play, or take over from them, at playcraftax.com.
| Agent | Network | Score / 226 | Game completed | From |
|---|---|---|---|---|
puffer162/ |
4 MinGRU layers of 1,024 (14M parameters) | 162 | 72% | PufferLib 5.0 |
ppo-rnn/ |
one GRU of 512 (6.9M) | 35 | 15.3% | reproduction of the PPO-RNN baseline from the Craftax paper |
trxl/ |
gated Transformer-XL, 128-step memory (4.7M) | 42 | 19% | Gautier Hamon, transformerXL_PPO_JAX |
priml-boss/ |
4 MinGRU layers of 1,024 + a convolutional board encoder (15.5M) | 194 | 86% | reproduction of rekursiv.ai's priml recipe, with its boss-fight fine-tune |
Each folder has:
<agent>.onnx: 32-bit weights<agent>-16bit.onnxand<agent>-8bit.onnx: smaller downloads, still computed in float32<agent>.safetensors: the weights for PyTorch or JAX (inpriml-boss/, priml's own bf16 weights, with its tensor names so itsMinGRUPolicyloads them)LICENSE- in
ppo-rnn/only:params.msgpackandconfig.json, the original flax params - in
priml-boss/only:metrics.json, priml's own evaluation
priml-boss beats the final boss, the necromancer, in 43% of games. Its score comes from priml's own evaluation (10,068 games on the 8,192 worlds it trained on), so expect a little less on fresh worlds.
Inputs and outputs
All four take the same input and give the same output, one game step per call:
- In:
obs, 843 floats: the 9 × 11 tiles around the player (8 numbers each) plus 51 for health, inventory and the rest. - Out:
logits, a score for each of Craftax's 43 actions (rule out the ones the game doesn't allow, then take the highest), andvalue, the agent's guess at how well it's doing.
Each also keeps a memory from step to step. Start it at zeros and feed each step's _out back in as the next step's input:
| Agent | Memory |
|---|---|
puffer162 |
h [4, 1, 1024] |
ppo-rnn |
h [1, 1, 512] |
trxl |
kv [4, 1, 128, 256] and fill [1] |
priml-boss |
h [4, 1, 1024] |
priml-boss also takes prev_action [1]: the action played on the previous step, 43 at the start of a game.
For the full format, or to convert your agent so it plays on playcraftax.com, see craftax-agents on GitHub.
All four agents are released under the MIT license, so you can use, change and share them freely. The copyright stays with each agent's authors (PufferAI for puffer162, TextJam, Inc. for ppo-rnn and priml-boss, Gautier Hamon for trxl), and the LICENSE file in each folder says so.