Log In  


Cart #neuraltrainer-7 | 2025-07-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Overview:

Neural Trainer is a game where you manually calibrate a neural network and apply it to classic arcade-style games. Adjust weights and biases in real time to train your neural net and conquer each level!

Each neuron in the network has knobs representing its weights and bias.
Rotate the knobs to tune how strongly each input affects the neuron's output.

TO DO:

  • Score start at 15 and pass level at 0. Go back to menu screen
  • Make the calculation more intuitive.
  • Make the ❎/🅾️ buttons more intuitive.
  • Add more sprites to the games

ADD GAMES

  • Jump spike. Spikes automatically move left. Input: Distance from spike. It should be easier than Dino and it should have only 1 hidden layer
  • Jump spike(s). Same game, it needs to jump in the right time. Inputs: Distance from spike and Quantity of spikes.
  • Space shoot with weapon with cooldown/overheat mechanic (to make sure to use x axis in neural network also)
  • Categorize fruits by (color,size,etc)

Goal:

  • Score more than 15 points to complete each level

Controls:

Menu:

  • During game, press "Enter" and then select "Return to Menu"

Neural Network:

  • Use the ⬆️,➡️,⬇️,⬅️ to navigate through nodes
  • Press ❎ to enter/leave knob mode.

Inside a Node (Knob mode):

  • ➡️ and ⬅️ to navigate through knobs.
  • Use ⬆️ and ⬇️ to rotate the selected knob and adjust the value.

Games:

  • Dino – Jump over obstacles using distance detection
  • Bird – Navigate through pipes by learning when to flap
  • Ping pong - Move up/down and hit ball against the wall
  • Catch the apple - Predict landing position and move to it. Avoid catching a bomb

Math:

Start with inputs – the network reads values like:

[distance in X from object], [distance in Y from object], ...

You can see the input values in the footer description

Each hidden neuron/node adds things up:

total = (input1 × weight1) + (input2 × weight2) + ... + bias

These values (weight1, weight2 and bias) are controlled by the knobs.

knob values range from left to right: -2.5, -2, -1.5, -1, 0, 1, 1.5, 2, 2.5

Then it activates the neuron using this rule: if total > 0 then output = 1 (green) else output = -1 (red)

These outputs go into the next layer, and the process repeats.

[SPOILER] SOLUTION FINAL LEVEL:

5


1

I was pressing random buttons on the apple game when an error occurred : And, also, I don't quite understand what the values correspond to.


@mikamembert, thanks for the feedback! :)

  • index knob_idx = 0 issue fixed

This games really needs a more intuitive UI


1

Thank you for replying to me and for fixing the bug! I'm giving it a star!



[Please log in to post a comment]