Neuronic Netronics by kaliuresis

[raw]
made by kaliuresis for Ludum Dare 57 (COMPO)

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

```

Capture.PNG

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.

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🗨️

Feedback

gsoutz
07. Apr 2025 · 09:49 UTC
impressive overall, idea code graphics and controls. couldn't get into the game loop though supposed to match left to the right but how? good job pulling this off.
ImmortalFox
07. Apr 2025 · 11:41 UTC
Unfortunately I am too dumb to understand the game. But I liked the idea, animations and the mechanics.
Gargantuan Janitor
09. Apr 2025 · 01:57 UTC
Can you please reply to this tomorrow so I try this one again? I'm confused but very intrigued
smilewood
09. Apr 2025 · 02:28 UTC
This is a really cool game, I think that especially the was the sounds and graphics interact really sell what you are going for. Moving the connections around and sliding the sliders was cool. I did have a lot of trouble figuring out how to get connections to form, and the overall goal of the puzzles I did solve was still a mystery, I ended up messing with things until it worked. I think that with just a little explanation on what the individual pieces did it would have been a lot more approachable. Aside from that though this is a very impressive piece of work, well done!
Jimbly
10. Apr 2025 · 00:28 UTC
Oh my gosh, I don't understand! Or at least that's what I feel like, though I managed to fumble through all of the levels, and even get the special ending, however it felt like I had to cheat for that one - I modified my graph half-way through and for some reason sometimes it didn't reset the progress and it gave me the win. Was it possible to do somehow without that (I can't imagine how, since there's only one input, but... I might have missed something)?

![Screenshot 2025-04-09 172341.png](///raw/dd3/z/6bd1d.png)

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:).
Talif Moor
10. Apr 2025 · 00:59 UTC
Pretty funky puzzle game, I stopped on the 7th round. It could definitely use a bit more of a tutorial. I nearly gave up on the second puzzle just because I had no idea what I was doing.
🎤 kaliuresis
10. Apr 2025 · 02:40 UTC
@gargantuan-janitor Here's your reminder
🎤 kaliuresis
10. Apr 2025 · 03:02 UTC
@jimbly That sounds like a bug, but it is possible to solve without that.
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.
Gargantuan Janitor
10. Apr 2025 · 03:06 UTC
@kaliuresis thank you for the reminder.

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.
🎤 kaliuresis
10. Apr 2025 · 03:43 UTC
@gargantuan-janitor You can create links from non-input nodes by clicking near the edge of the circle, I'll add that to the hints. For the automatic case switching I chose to do that since there are some puzzle exploits from letting you manually switch cases, but maybe there could have been a better solution. It might also have just been fine to let people cheat to skip levels considering how difficult they can be, and the cheating method is not very obvious either.

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.
Gargantuan Janitor
10. Apr 2025 · 04:07 UTC
Awesome man, thanks for the thorough reply, it's been illuminating.
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.
grid96
11. Apr 2025 · 13:25 UTC
Very cool interpretation you came up with. I have to admit though that it's kinda beyond my understanding. Probably really cool when you are already into the entire topic. Are you planning on continuing this project and maybe add a tutorial?
Alex Davies
12. Apr 2025 · 05:14 UTC
This is a really interesting idea but it could do with maybe some more tutorialization, and it would help massively to be able to save certain structures or at the very least copy over stuff from the previous level, since most of them seem to quite naturally follow on from the previous level. I think especially for the not gate-related levels the idea that you have to capture a value in a loop of nodes to get a constant value is not very obvious, especially when you can't connect two nodes directly to each other in a loop. Overall, a really interesting idea though, and very well-designed levels, and of course impressive given you're hand-rolling wasm.
mao
12. Apr 2025 · 18:27 UTC
Love this entry! Messing around with the mechanics and figuring out what's possible was really fun. I know the whole "figure it out yourself" design philosophy isn't for everyone, but I personally really enjoy it. Bonus points for writing it in Webasm, of course.
HolySparks
12. Apr 2025 · 18:43 UTC
Works very smoothly and I'm sure you would if you had more time but this kind of game urges for an efficient tutorial
dhim
13. Apr 2025 · 06:39 UTC
Very cool concept!

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)
🎤 kaliuresis
13. Apr 2025 · 12:26 UTC
@dhim Definitely agree that a different visualization method could work better. Having something with more continuity across zero would have helped make it slightly more intuitive.

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
YouCarryOats
13. Apr 2025 · 14:20 UTC
Really wish I could figure this out but I haven't dug enough into NN's I guess! Loved deep learning as a take on the theme, and with some more tutorialization a game like this could definitely be used to help people understand the fundamentals of NN's. I hope it gets developed out a bit more with the feedback from the comments here. Nice job setting it up with web assembly too!
Thoastbot
13. Apr 2025 · 14:43 UTC
This game is, interesting - cant quite wrap my head around how it works, but i love the graphiks and sounds, feels very fitting. I thought i kinda got it, but even just to reverse a signal seems to be kinda hard - i didn't quite see how what exactly influenzed what - and in the end i just made a connectionless strobo maschine that wouldn't stop flickering what so ever xd
Baturinsky
13. Apr 2025 · 15:07 UTC
Way too confusing for a game. Needs a tutorial. I.e. few braindead levels where player is told explicitly what and how he has to do. Only after thenm when they see how thing works, you give them (us :) ) something requiring actual thinking.

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.
🎤 kaliuresis
14. Apr 2025 · 07:01 UTC
@baturinsky The first three levels were intended to be the braindead tutorial levels where the only challenge is figuring out the controls and there are only a small number of possible things to click, but I definitely still underestimated how confusing they are.

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
loveapplegames
14. Apr 2025 · 07:06 UTC
I was drawn to this entry because I worked with neural nets in my last few entries. This is a very interesting concept that may help in teaching neural nets, and also well executed. I got stuck at level 5 though because I can't find a way to put a bias on a neuron. That is, you basically have to turn a 0 into an 1, but I can't do this with only multiplication. So, did I miss a way to add bias to a neuron?
🎤 kaliuresis
15. Apr 2025 · 01:00 UTC
@loveapplegames There are a couple ways to solve level 5. The main intended way is to (scroll to reveal)
```
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.