Micron banner

Micron

3 devlogs
21h 53m 57s

A web-based game where you build increasingly complex electronic circuits, then build more circuits on top of those until you make something cool.

Repository

Loading README...

Avalon

I now finally have a working prototype of the whole thing. The actual logical simulator part of the, you know, logical simulator game, had not been done yet. It was an absolute pain to build from scratch in JavaScript. I know nothing about circuits or circuit design and I had to come up with an algorithm to generally simulate all kinds of circuits. Including oscillatory ones that propagate forever with no stable end. It took multiple days of thinking everything through and only four hours of writing the code, three of which were spent debugging an issue where the UI itself refused to update when the simulator ran.

Not fun (thumbs up)

What you see below is two circuits:

  • The full-bit adder is a way to add numbers together. This is one of the basic components that power your CPU’s arithmetic unit. Each toggle button is one input, and the two numbers you see at the end are the sum of all three inputs, but in binary. 0 is 00, 1 is 01, 2 is 10, and 3 is 11.
  • The SR NOR Latch is a thing used in memory circuits to remember values. Just pulse one toggle button and the circuit switches across two stable outputs. S is Set, R is Reset. Pulsing Set makes the circuit “latch” its output to 1, and pulsing Reset sets it back to 0.

Both circuits seem to work fine.

0
Avalon

I succumbed to the urge. I rewrote the entire thing from scratch because the previous version was not scalable. I don’t have much to show for it except for:

  • Landing page for days
  • Animations
  • Animations
  • Better schematic management window

Hopefully the video might depict what exactly changed. It’s very little.

0
Avalon

I built a basic scaffold, and not much else. I’ve used:

  • SvelteKit, a meta-framework for building web things
  • Svelte Flow, a library that lets you add interactive graphs and nodes and connections to your web thing
  • shadcn/ui, a library of components like buttons or command menus, and
  • Tabler Icons, an icon library for the little logic-gate symbols.

Right now, you can add “nodes” to the screen and wire them up together. A node can be a logic gate, or an input, an output, or anything that is part of a circuit. It took a really long time to actually learn how Svelte Flow was supposed to work. It’s simple when you actually read the documentation, which I did not :D

Clicking to move nodes around works, deleting nodes can be done with the X, Delete, or Backspace key, and you can add a node with Ctrl+Q.

I’ve used shadcn for UI components only because everyone is talking about it. It took a long time to figure out how it’s actually meant to be used.

There are only four logic gates added, and they have no functionality. Most of them are supposed to have two inputs, not one, but I’m adding that later.

The circuit simulation engine is going to be a headache, so I’ve put that off for later as well.

TL;DR: There is now an infinite graph where you can add logic gates. The gates do nothing. You can connect logic gates together, but that also does nothing. Most of the time was spent learning how to wrangle Svelte Flow and shadcn into submission.

0