DerEnots - sandbox game with a backend on Zig

DerEnots: A Zig-Powered Redstone-Style Logic Simulator Running Natively in the Browser (WASM)

Hey ziggit!

Just finished a fun pet project I’ve been tinkering with for the last couple of weeks — DerEnots.

It’s a lightweight, fully browser-based cellular logic sandbox inspired by classic redstone contraptions, Wireworld, and similar sandbox games. You get a huge 1000×1000 grid, real-time simulation, smooth panning/zooming, inline block editing, observer mode, speed control up to 100+ TPS, and that satisfying “click-and-build” feel.

What makes it special for the Zig crowd: the entire simulation backend (tick system, signal propagation, block state updates — everything performance-critical) is written in pure Zig and compiled straight to WebAssembly. The frontend is deliberately minimal — just one self-contained HTML file + Canvas, no frameworks, no bloat. It loads instantly and runs buttery smooth even on modest machines.

If you love low-level programming, cellular automata, or just want to see what Zig + WASM can do in a real interactive app, this is a nice little showcase.

Full source code, build instructions, and detailed block documentation are here:
GitHubGitHub - Neon32eeee/DerEnots: DerEnots is a sandbox for building energy circuits. Create circuits from energy blocks, buttons, delays, lamps, and dividers, control energy flows, and monitor their operation in real time. · GitHub

Play the game right now (no download, no install):
Live demoDerEnots

Would love to hear your thoughts — bugs, performance feedback, wild contraptions you manage to build, or ideas for new features. Feel free to open issues or PRs!

Built purely for fun and to push my Zig skills a bit further. Hope you enjoy breaking (and rebuilding) things as much as I did! :rocket:

7 Likes

I think it would help to have something like ctrl+click to be able to open the settings of a block directly (basically this would never set/modify the current block type), it is a bit annoying having to first select the block type button to be able to activate the button.

Maybe you could have multiple such modifiers one for opening the block settings, one for triggering the default action like setting the block state to on. (If there already is a way to do this, it should become more obvious)
Another way to do this would be to add a simple “inspect” cursor before the first block in the hotbar.

You also could think about removing the block state pop up (or making it less needed) if you could directly in your “hotbar” select the direction for a newly placed block.

Alternatively you could implement a click+drag mode when you have something like the energy block selected which could show ghost block placements so that you could place entire lines of blocks with a single 90° turn corresponding to two sides of a rectangle from the starting point to the current mouse position, only placing the blocks when you release the mouse button.

I also think it may make sense to either change the default language to english or make the language switcher a bit more eye-catching, maybe by making it a toggle between RU and EN, because currently it displays the non-active state, which is a bit confusing (why is everything russian while it says EN?).


A pretty cool extra feature could be to be able to step forward and backwards by a single tick. Stepping back could be limited to some number of ticks or if you find a way to store it efficiently it might even be able to play it in reverse until you reach tick zero. I think checkpoints with delta updates in between could be a viable and not so difficult way to implement that.

1 Like

Hey Sze, thanks a lot for the detailed feedback and suggestions! :raising_hands:

I just pushed a commit (c3c018c) that addresses some of the points you raised:

  • Default language switched to English – the UI now starts in EN by default. The language switcher is still there, but I agree it wasn’t very noticeable.
  • Hotkey for energy block – you can now Shift+Click on an already placed energy block to open its settings without changing the block type. This should make tweaking directions much smoother.
  • WASD for direction – when the energy block is selected (single click on it in the world, not the hotbar), pressing W, A, S, D will set its direction immediately. No need to open the settings popup for that.

I haven’t implemented the click+drag line placement or the single‑tick stepping yet, but I really like those ideas – especially the tick stepping, though storing reverse deltas might be tricky. I’ll experiment with it later.

That said, something similar already exists if you hold Ctrl + drag the mouse, but if it’s really necessary, let me know.

2 Likes

I think those are nice changes that make it easier to use, I think it would be good to also have something to discover the modifier keys from the game, maybe something like a help / f1 screen, accessible through pressing a help button, f1 or similar.

If you want more people to play around with it, it could help to have a import and export option for what you have built, so that people can share circuits more easily, or alternatively maybe even a way to share via a link that embeds the data in a query parameter?

Alternatively it would be cool if you could mark a rectangle and copy it to another instance of the game where you paste it, maybe the copied part could just be rectangular ascii text representing the block state?
Would also make it easier to create repeating parts in the game.

I noticed that this configuration:
a splitter that connects to two delayers seems to result in an endless loop that freezes the tick?
Screenshot_2026-04-06_19-29-32

1 Like