Quick guide
FoodSim in plain English
FoodSim is a top-down training arena where two colour-coded teams collect glowing fruit for points. The centre canvas shows the field, the stats bar tracks the current round and the neural network monitor highlights the brain that is leading the race. You can tweak the run at any time with the control panels on the left and right.
What you see on the main screen
- Playfield canvas: Agents leave light trails as they hunt fruit, deliver it to their goals and dodge any obstacles you draw.
- Stats bar: Shows generation number, active teams, fruit on the map, deliveries made and the best fitness score so far.
- Neural Network Monitor: Displays the winning brain, its fitness and which team discovered it.
- Left column: Adjust NEAT settings, paint manual obstacles and pick a focus track in the ambient sound lounge.
- Right column: Control fruit spawns, trail length, collision rules and configure each team’s speed, vision and behaviour.
How to run a session
- Press Restart if you want to clear the field and begin from generation one.
- Let the teams play and watch the stats and brain monitor update live as new leaders appear.
- Use the obstacle toolbox to drop glowing barriers that force the agents to find new paths.
- Adjust team sliders or global settings mid-run to see how the population reacts.
- Save a training file once you like the behaviour, or load an earlier run to continue evolving it.
- Open the control panels only when you need them—each section starts collapsed so you can focus on the playfield.
- Toggle Performance mode in the top bar to hide the sidebars and devote the whole screen to the action.
NEAT in simple steps
- Sense: Each agent reads nearby fruit, teammates, walls and timers through its neural network inputs.
- Act: The network outputs tell the agent which way to drive and whether to speed up or slow down.
- Score: Agents earn fitness by grabbing fruit, delivering it and staying alive.
- Evolve: At the end of the generation the best brains stay, the rest mix and mutate, and the next wave starts slightly smarter.
Tip: If the teams stall, raise mutation or lower the elite ratio to shake things up. When you spot a strong pattern, ease the mutation and increase elites to keep refining it.
Want to tinker further?
The JavaScript bundled in index.html drives both the simulation and the NEAT logic. Dive in when you want to add new sensors, change the fitness math or create extra team presets.
⟵ Back to the simulation