Opening your Snake workspace.
Loading your game…
- 1 · Set up
- 2 · Train
- 3 · Check
- 4 · Run
Know the grounds. Set the goal. Then train.
- Environment & assumptions
- Measurable goal
- Reference strategy
- Training phases
- Checks & limits
Objectives & optimization
Example: Success at least 90%; score at least 5; steps at most 500; prioritize efficiency. Separate clauses with semicolons. Use supported metrics shown in Use values. Choose game rules and the task in World; text does not create new mechanics.
One snake. Three choices.
Choose a goal, inspect the rules, then teach it to finish.
Your first game agent
Each decision is straight, turn left or turn right. The snake grows when it eats. Choose solid walls or wraparound edges in World. Hitting its own body always ends the round.
- Open World and try the arrow keys or touch controls.
- Choose Rule teacher to see a reference run.
- Open Train to fit a small neural network without watching every attempt.
- In Results, review the comparison, then choose Test in World to activate a passing model.
Snake experiments and saves are separate from robot projects. Other games have separate environments and models.
Find the next bite.
Choose a short teaching challenge or demonstrate until the board is full.
Click the board, then use arrow keys. Reverse turns are ignored. Amber cells mark immediate collision risks; a red tile marks a crash. The NN uses simulator coordinates. Full-board mode supplies authored cycle-direction cues; five-food mode supplies free-space features. These are not screen pixels.
See what it learns.
Collect five foods or fill the board, on seeded food sequences.
12 inputs → 24 neurons → 3 actions
Inputs: immediate danger in each direction, current heading, relative food position, and reachable free space after each action. For the full-board goal, the last three inputs are authored cycle-direction cues instead of free space. The cycle reference can fill these even-sized boards; the NN learns to follow that supplied route signal. Outputs: straight, left, right.
The neural network starts with random weights and imitates an authored rule teacher. No safety rule overrides its choice. Learning happens in Train; Run uses fixed weights.
Training and validation use different episodes. A checkpoint is selected using validation results before its final twelve test episodes. Success applies to this grid, selected wall rule and selected goal. Switching to pass-through edges requires its own training and checks.
Teach, then check.
Training runs off the UI thread. Your active model stays available.
Define the challenge, then train
Up to 6,000 examples, 60 epochs and a 60-second limit. Two candidate attempts per training round, including cancelled attempts.
Ready · 0 / 2 attempts used.
Activation needs at least 8/12 successes, at least two more than the untrained network, and no regression against a compatible active model. A failed candidate stays available for inspection.
Uses fresh teacher examples and the current two-attempt training round. Review each candidate before activation. Run keeps active weights fixed.
Off. Train manually, or start another training round when both attempts are used.
What actually happened?
Compare controllers on the same twelve test seeds.
Train a candidate to create measured results.
Finish a failed round to enable retraining.
Why did it fail?
Finish a round or train a candidate to see its outcome and a controlled next test.