Course project for Mathematical Underpinning of Reinforcement Learning (Warsaw University of Technology). We trained three published agents and four methods of our own on Craftax, a much harder, crafting-heavy relative of Crafter, and compared them at 1 million and 1 billion environment steps. This page shows what came out. Scores are always the training-episode return in % of the 226-point maximum, so 2.2 means about 5 points per episode.
What we found
At 1M steps the PPO family wins, but not by much. Count-bonus PPO-RNN has the best mean (2.27%), yet its gap to plain PPO (2.17%) and PPO-RNN (2.19%) is within seed noise (probability of improvement 0.74 and 0.68, Holm-adjusted p of 0.53 and 1.0).
The value-based PQN-RNN family (1.36% and 1.48%) and the two skill methods (Dyna-Q 1.08%, SMDP skills 0.83%) are clearly worse and much less stable across seeds.
At 1B steps (only 3 seeds, so indicative) the controls catch up with everything we added: PPO-RNN, PQN-RNN and count-bonus PPO-RNN all land at about 16%, PPO stays at 11.7%, and the skill methods stay near 8-9%.
Our add-ons (count bonus, self-imitation, their combination) did not give a reliable gain over their base control at either budget. Self-imitation is the only one whose change at 1B excludes zero, and it is negative.
Even the best agents never leave the first floor in the final evaluation episodes, and 47 to 54 of the 67 achievements are never unlocked by any seed. Zombies are the most common cause of death for every method.
One caveat on the reproduction check: our PPO and PQN-RNN controls match the published numbers, but PPO-RNN at 1B scores 16.2% against the published 15.3%, slightly above the tolerance band. We kept the number and say so in the report.
Results at 1M steps
10 seeds per method, tuned hyperparameters. Mean with standard error and the interquartile mean (IQM); "eval" columns are the final checkpoint played with a sampled (stochastic) or arg-max (greedy) policy. The block column says which comparison a row belongs to: the same three controls (same runs) appear in both blocks, so each group of methods sits next to them.
Final score per method: IQM (circle) and mean (diamond) with 95% bootstrap intervals. The main block is on top, the skill methods below with the controls repeated.Training score over environment steps for the controls (dashed) and our methods; the band is a 95% bootstrap interval over seeds.The same curves for the two methods that use hand-written skills, against the controls.
Reading. The curves of the PPO family overlap for most of the run, which is why the final intervals overlap. The PQN-RNN and skill curves are lower and their bands are wide: a few seeds collapsed during training. Combining the count bonus with self-imitation (combo) did not add up: it ended below count-bonus PPO-RNN alone.
Our runs next to published scores
Final training score at 1M steps in % of the 226-point maximum, with a 95% interval. Rows marked ours are our runs; rows marked literature are values reported in the papers named in the first column. The evaluation protocols differ (see the protocol column), so read this as an orientation, not as a like-for-like ranking.
Results at 1B steps
3 seeds per method, so treat the order of close methods as unresolved.
Final score per method at 1B, with 95% bootstrap intervals over the three seeds.Training score over 1B steps for the controls and our methods.The same for the skill methods.
Reading. Four methods end within about one point of each other, so we cannot rank them. PPO without memory is clearly behind, and both skill methods are behind by a factor of about two. The skill methods gain a factor of 8 to 10 from 1M to 1B, similar to the neural agents, so the gap stays.
Does the 1M ranking carry over to 1B?
Mean final score at both budgets on log axes. A rising cloud means the order is kept. Gains from 1M to 1B range from about 5x (PPO) to 12x (PQN-RNN).Gain over the base control at each budget. On the dashed diagonal the advantage is unchanged; below it the method loses ground at 1B.Share of the budget at which the smoothed score reaches 90% of its final value. Below the diagonal a method gets there earlier at 1B.
Reading. The ranking mostly survives: the skill methods stay at the bottom and the recurrent agents stay at the top, but the PQN-RNN family, which was far behind at 1M, closes the gap completely. The small advantages we saw at 1M vanish at 1B (the points sit on or below the diagonal), and self-imitation is the one case where the loss is clearly different from zero. In relative terms combo, count-bonus PPO-RNN, PPO, PPO-RNN and self-imitation reach 90% of their final score later at 1B than at 1M.
Three baselines and four methods
Baselines (published agents, rerun with our code)
PPO (ppo): feed-forward Proximal Policy Optimisation, the MLP baseline of the Craftax paper. Every PPO-based method starts from its tuned settings.
PPO-RNN (ppo-rnn): PPO with a GRU memory, the strongest baseline in the Craftax paper. It is the base of the count bonus and of self-imitation.
PQN-RNN (pqn-rnn): a recurrent Parallelised Q-Network, the only value-based baseline. It learns online with Q(lambda) from the batch it just collected, with no replay buffer and no target network.
Our methods
Count-based progress bonus (count-bonus-ppo-rnn, count-bonus-pqn-rnn): an intrinsic reward β/√N over a hand-chosen summary of game progress (floor, tools, armour, spells, bucketed inventory), counted over the whole run and added to the environment reward of a PPO-RNN or PQN-RNN agent. The network never sees the counts.
Self-imitation learning (sil): PPO-RNN plus a buffer of the steps that led up to each achievement, and an extra loss that copies a stored action only where what followed turned out better than the critic expected.
SMDP Q-learning over hand-defined skills (smdp-skills): two levels. A table over progress keys picks one of 25 skills with semi-Markov Q-learning; one shared recurrent network learns how to carry out all skills from their own success signals.
Dyna-Q over a skill-level model (dyna-q): the same skills, plus a learned lookup-table model of what each skill does from each progress key, used for Dyna-Q style planning updates.
combo: count bonus and self-imitation together on PPO-RNN, tested to see whether the two ideas add up.
Where the 25 skills come from. We wrote them by hand from the game rules and the achievement list (collect wood, craft a pickaxe, place a table, descend a ladder, fight, and so on). Each has a start condition, a success test and a step limit. They were not extracted from data or from anyone's play. Twenty-three are learned skills and two are one-step primitive options. This is prior knowledge the skill methods get and the others do not, so we always report them in a separate block.
The game: 67 achievements in four tiers
An achievement pays out once per episode, the first time it becomes true. Rewards by tier: 25 basic achievements at 1 point, 18 intermediate at 3, 15 advanced at 5 and 9 very advanced at 8, so 25 + 54 + 75 + 72 = 226 points. The step reward also adds 0.1 times the health change.
Basic (25 achievements, 1 point each)
collect wood, place table, eat cow, collect sapling, collect drink, make wood pickaxe, make wood sword, place plant, defeat zombie, collect stone, place stone, eat plant, defeat skeleton, make stone pickaxe, make stone sword, wake up, place furnace, collect coal, collect iron, collect diamond, make iron pickaxe, make iron sword, make arrow, make torch, place torch
Intermediate (18 achievements, 3 points each)
make diamond sword, make iron armour, make diamond armour, enter gnomish mines, enter dungeon, defeat gnome warrior, defeat gnome archer, defeat orc soldier, defeat orc mage, eat bat, eat snail, find bow, fire bow, collect sapphire, collect ruby, make diamond pickaxe, open chest, drink potion
Advanced (15 achievements, 5 points each)
enter sewers, enter vault, enter troll mines, defeat lizard, defeat kobold, defeat troll, defeat deep thing, learn fireball, cast fireball, learn iceball, cast iceball, enchant sword, enchant armour, defeat knight, defeat archer
Very advanced (9 achievements, 8 points each)
enter fire realm, enter ice realm, enter graveyard, defeat pigman, defeat fire elemental, defeat frost troll, defeat ice elemental, damage necromancer, defeat necromancer
What the agents actually do
Share of episodes at the end of training in which each advanced achievement is unlocked. Eight of them are never reached at all.Cause of death in the final evaluation episodes, per method.
Reading. In the final evaluation episodes every method stays on the first floor: nobody gets down the ladder. Zombies are the most common cause of death for every method (47 to 61% of deaths depending on the method), so staying alive on the first floor is the practical bottleneck at these budgets.
What do the policies do? Decision trees
We distilled every trained network (9 methods, 10 seeds each, final 1M checkpoint) into decision trees on named game features and measured fidelity: how often the tree picks the same greedy action as the network on 64 held-out episodes.
Fidelity of the trees against their number of leaves (log axis), median over seeds. The muted line is the 0.9 level, which no method reaches.
Fidelity peaks at only 0.40 to 0.51, with 32 to 256 leaves, and falls for bigger trees. The 90% level is not reached by any method (above 4096 leaves for nearly all). So the policies are not simple rules in disguise, and the low number is not a labelling bug: we checked it.
Trees do better than just predicting the most common action (gains of about 0.1 to 0.19), and best on the "do" action: facing water or a tree and interacting.
Small trees still read sensibly. PPO reacts to the distance to water first (the most important feature), then the distance to trees and food. Crafting happens only next to a table. Recurrent policies split first on the previous action, so their rules read as "what to do after X".
Rare actions such as sleeping, placing a table, descending or using potions and spells are almost never captured by the trees, even at 256 leaves.
Played in the game, 256-leaf trees score much less than the networks they imitate (for PPO about a third of the greedy network score), so matching actions on visited states does not mean matching behaviour. A round of DAgger helped PPO's tree (0.34 to 0.48).
Videos
The videos follow the learning process and the most interesting moments: a short version of about 3 minutes and a long one of about 12 minutes. They are on YouTube, not in this repository; the links will be added here once they are public. The music is generated for the project and the narration is synthetic.
GIFs
Data and code
Dataset: MLflow store, per-run metrics, analysis, decision-tree rules and final checkpoints (MIT).
1B-step runs: the faculty EDEN cluster, one GPU per run. PPO, PPO-RNN and the combination ran on an NVIDIA A100-SXM4-40GB; PQN-RNN and the other additions ran on an NVIDIA H100 PCIe.