All projects

Reinforcement learning in Unity

DQN vs PPO vs NEAT, from scratch

status
A-Level NEA
year
2025
area
AI & ML

My A-Level Computer Science project (full write-up): agents learn a game of tag in Unity using three reinforcement-learning algorithms I implemented without any ML libraries.

The agent configuration design: algorithm set to DQN, learning rate, exploration probability and decay, batch size and layer sizes.
Design mockup from the report: configuring an agent.

Details

  • Neural networks (with an Adam optimiser), policy optimisation, and a NEAT genetic algorithm with mutation, crossover and speciation, all from scratch.
  • Configurable environment: adjust hyperparameters before a run and watch learning progress in 3D.
  • Per-round metrics (wins, reward, distance) exported to CSV and graphed live.
  • 18 tests, including hand-checked PPO and DQN maths and backprop within 5% of a Wine-dataset benchmark.

Screenshots

The results screen design: a wins per 10 rounds chart for the runner, with tabs for loss functions and failures.
Design mockup from the report: the post-simulation stats.

keys

`
open or close the terminal
j k
next or previous section
0-9
jump to a numbered section (0 is the top)
gg G
top or bottom of the page
/
search everything (a grep in the terminal)
?
this list
esc
close whatever's open

(single-letter keys can clash with screen readers and your own shortcuts)

In the terminal, help lists the commands. Not all of them: try what you'd try on a real one, and eggs keeps score.