Neuronic Netronics by kaliuresis
A puzzle programming game about building small neural networks. The inspiration and connection to the theme is the phrase deep learning. The networks didn't end up being very deep in the sense of having many layers, but I think there is quite a bit of depth to the mechanics. Some of the puzzles can be pretty difficult but there is a small surprise if you manage to make it all the way to the end.
Link: https://kaliuresis.itch.io/neuronic-netronics
Controls: * Left click to place nodes, drag nodes, create new links, adjust connection weights
- Right click to delete things
Here are some hints for the first few levels (spoilers, scroll to see) ``` Nodes have a value from -1 to +1. Positive values are displayed as yellow circles growing from the center, negatives are displayed as yellow rings growing inward from the edge
Links between nodes have a weight from -1 to +1, the node value will be the sum of all the incoming nodes multiplied by the link weight, this values is then clamped to -1 to +1 after all the values are added.
You can create additional nodes by clicking on an empty region. You can create new links by clicking and dragging near the edge of a node. Slide the white circle along the link to adjust link weights
```

I'm pretty happy with how this turned out. I was slightly worried the mechanics would end up isomorphic to every other game about logic gates, but I think there is a bit of additional depth that differentiates it.
I had an interesting development setup for this. Most of the game code is in hand written Web Assembly, with a tiny bit of javascript just to interface with inputs and outputs. The only part where I cheated was for text rendering, which I didn't feel like making in wasm and is used minimally. Aside from that all of the graphics and audio are handled in wasm, with video and audio buffers directly written to in memory. Despite the self imposed restrictions, I was able to keep a pretty good pace and ended up having a good bit of time for polishing graphics and audio at the end, which I tend to neglect. While this setup was mostly for fun and learning, it did end up having a few advantages, the biggest of which is that changes to the code are reflected almost instantaneously. I wanted to experiment with procedural audio this jam, and web assembly actually ended up being very good for this. I could change numbers in the code to tune things and it was nearly as responsive as a slider, but with much more flexibility. I think the limitations and unfamiliarity also helped me keep from being too ambitious and over-scoping. While I probably won't use raw wasm again for a jam, it was a great learning experience. My main takeaways are how to do web-builds without the bloat of emscripten, and that wasm is a pretty simple format to build custom tooling for. I also think the procedural audio was a huge success, I learned a lot about how to use simple primitives to make creating new sounds and controlling them with game logic fairly fast.
| HTML5 (Web) | https://kaliuresis.itch.io/neuronic-netronics |
| Link | https://github.com/kylerNat/ld57-Neuronic-Netronics/tree/main |
| Original URL | https://ldjam.com/events/ludum-dare/57/neuronic-netronics |
Ratings
| Overall | 62th | 3.761⭐ | 25🧑⚖️ |
| Fun | 152th | 3.304⭐ | 25🧑⚖️ |
| Innovation | 4th | 4.522⭐ | 25🧑⚖️ |
| Theme | 223th | 3.174⭐ | 25🧑⚖️ |
| Graphics | 123th | 3.609⭐ | 25🧑⚖️ |
| Audio | 179th | 3.048⭐ | 23🧑⚖️ |
| Humor | 239th | 1.889⭐ | 20🧑⚖️ |
| Mood | 203th | 3.158⭐ | 21🧑⚖️ |
| Given | 5🗳️ | 5🗨️ |

It took me a while to figure out what my available tools were - in the end I decided it was "add" and "multiply by -1...1" and, with what felt like a hack, "generate a 1.0", is that what they're supposed to be?
Doing this all in WebAssembly (5K lines of it?!) is really impressive and cool. The visuals were wonderful and I love the excessive fire effects (reminds me of old ASM demos on the 486 :laughing:).
Those are the intended tools, they're roughly based on how real neural networks work with linear layers followed by a non-linear activation function (in this case the function is clamping to [-1, +1]). There are also a couple other "hack" tricks that can be useful.
@talif-moor Yeah, I knew it could probably use some explanation but I like non-verbal puzzle games and the thematicness of unsupervised learning too much to give up on that idea. I still think it could work without explanatory text but it would need a lot more fine-tuning and play-testing to make the visuals and feedback more clear. I've added some hints to the description to help explain the basic mechanics.
I love this kind of game and I loved figuring this one out. I do think a slightly better tutorial is needed, if only because I would not have figured out that links are sliders if I hadn't opened the hints.
I do feel I'm fighting the interface half of the time. Wanting to see how tweaking some values around works for one input i part6icular is super annoying, as you have to wait for the entire cycle and only get a couple seconds to do so. Also, if there's another way of linking a node to the output that isn't at creation, I haven't figured it out, which makes trying stuff near the output very annoying every time you want to re add a link you closed.
I'm enjoying it, will probably keep playing a bit before rating it, but these seem like the frustrating reasons I would drop this game over.
The sounds and the graphics are really nice and I would love to hear about how you hand write wasm.
My setup with wasm is that I write to a wat file (the text format for wasm) in vim, with a build script running the wat2wasm command whenever I save. The javascript side continuously checks the hash of the main.wasm file, and will reload it when it changes. I have the data separated from the update loop, so that it can be reloaded without losing state or having to refresh the page. At least for a project this small everything was nearly instant.
The graphics are a buffer that gets directly copied onto the canvas from the js side, and similarly the audio is just writing samples from a ring buffer into a js audio worklet. For data structures I have hard-coded addresses for everything, which would probably be a problem if the project grows but it worked out fine for a jam.
This was my first time trying this and I just learned things by reading the wasm docs (which are thankfully not too long) about a week before, so there are definitely ways this could be improved. One thing I originally wanted that I didn't have time to setup before the jam was a custom pre-processor that I could use to have macros, binary file embedding, and a more flexible way to layout memory.
I definitely wouldn't recommend doing hand wasm like this except for fun or to optimize specific functions, but I think a similar setup with a higher-level language before wasm would work very well. The normal way web builds are done is with emscripten, which is meant to let you run desktop apps on the web and consequently it has tons of bloat like emulating a file system which isn't really necessary if things are made for the web in the first place. As a comparison the last web game I made for ludum dare used emscripten and was a 2.58 Mb wasm file, while this one has a 15 kb wasm file.
I'm really enjoying this game and I'd love to see it expanded after the jam is over, it feels like it has potential to be a commercial product.
Lacking a bit of explanation about dragging the weight along the edges.
For me, the -1,1 range is really hard to understand with your visualization. Maybe a bottom/top splitting of the node and edge would make it more visual.
I'd love to know more about asm and the dev setup you have use. Have you per chance use git / github during the dev process ? Would you share the source code that way ?
I am making a list of github projects I have rated [github list of ld57 entries](https://github.com/stars/dhmmasson/lists/ludum-dare-57-compo), and I'd love to have your entry in it.
(see my post on tips for a repo if you wish [see my post on preping your repo](https://ldjam.com/events/ludum-dare/57/focus-hunt/preparing-your-github-repository-for-ludum-dare-57)
I had a local git repo which is included in the source zip. I've put it on github just now: https://github.com/kylerNat/ld57-Neuronic-Netronics/tree/main
As for WASM, I guess coding in wat is educational and flexible, but have you checked out AssemblyScript? It's easy to setup, compiles fast and outputs relatively small wasm.
I hadn't heard of AssemblyScript before, it looks interesting. I was planning on doing C to wasm for next time, but AssemblyScript looks like an potential alternative
```
Make a loop of neurons, which will stay on forever.
```
The other method, which is a bit less practical, is to
```
Create a delay line long enough to pass the signal from the on case to the off case.
```
There's also a bug where deleting nodes/links does not count as editing your solution and doesn't clear your progress, but that is very much a bug and not intended or necessary to complete any levels.