Show HN: I made a digital circuit drawing and simulation game

(github.com)

137 points by rafinha 5 days ago | 14 comments

Inspired by games like Turing Complete/Virtual Circuit Board/Logic World, I tried to make a mix of aseprite and wiredworld/wired-logic, the idea being the user can build a digital circuit using a "fullstack" pixelart creation workflow.

The circuit is just an image. The primitives are (i) connected wires which have undefined, 0 or 1 state during simulation (displayed brighter or darker in function of the state) and (ii) NANDs, which are little pixel triangles. During simulation the user can interact with any wire by clicking on it, toggling its state, which is cool for messing around when learning. The simulation uses a unit-delay event driven algorithm.

Then, on top of that there are little wire interfaces on the left side of the image that communicate with an external system. This external system is defined in lua and is simulated together with the main circuit (they alternate until convergence). By default there's a sandbox mode with a clock and a power-on-reset signal. The user can choose other "levels", where the API change and there are some problems to solve, from finding if a number is multiple of 3 to solving hanoi tower to finding if a number is prime. The idea is that if the user want to learn but not sure what to do they can try to solve these puzzles, or they can change the lua scripts to add their own stuff/interface for a custom project.

I've also included a small wiki (circuitopedia) with some basic digital concepts to guide those who are new or are a bit rusty. It's not super detailed but I guess it can at the very least present the concepts so the user can dig further on more serious material if they want to.

I developed the game in C with raylib, with scripting in lua/luajit. I've put the game on steam (for windows) and released the source code on github under GPLv3. There's also a web demo version on itch.io, even though it's a bit laggy: https://lets-all-be-stupid-foreva.itch.io/circuit-artist-dem... .

Feedback is appreciated!

madflame991 5 days ago | next |

I tried the demo and I liked it!

I would prefer if I could pick a color in a faster way than switching to the color picker or using the palette: maybe middle click or Ctrl + left-click (gimp does that). It would reduce the mouse travel quite a bit; sometimes I happen to have the exact color I want next to my cursor.

I would also suggest putting the trailer on Steam. All I see is images in the steam carousel thing; I think the trailer being in the carousel would help.

rafinha 5 days ago | root | parent |

I'm glad you liked it :) . That's a good idea for the colors, I'll put it in, thanks! You're also right about the trailer, I'll put it there.

dusted 3 days ago | prev | next |

Build instructions are a bit sparse.

$ git clone https://github.com/lets-all-be-stupid-forever/circuit-artist... Cloning into 'circuit-artist'... remote: Enumerating objects: 326, done. remote: Counting objects: 100% (326/326), done. remote: Compressing objects: 100% (269/269), done. remote: Total 326 (delta 59), reused 306 (delta 52), pack-reused 0 (from 0) Receiving objects: 100% (326/326), 1.41 MiB | 7.70 MiB/s, done. Resolving deltas: 100% (59/59), done. $ cd circuit-artist/ $ mkdir build $ cd build/ $ cmake . CMake Warning: Ignoring extra path from command line:

   "."

CMake Error: The source directory "/home/chris_ji/code/circuit-artist/build" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. $ cmake .. -- The C compiler identification is GNU 11.4.0 -- The CXX compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:17 (add_subdirectory): The source directory

    /home/chris_ji/code/circuit-artist/third_party/raylib

  does not contain a CMakeLists.txt file.

CMake Error at CMakeLists.txt:18 (add_subdirectory): The source directory

    /home/chris_ji/code/circuit-artist/third_party/nativefiledialog-extended

  does not contain a CMakeLists.txt file.

-- Configuring incomplete, errors occurred! $

rafinha 3 days ago | root | parent |

You're right, I'll put better instructions this week. In the message you sent it seems to be a git submodule initialization thing.

dusted 2 days ago | root | parent |

Cool! :) I opened an issue on github about it, I'd do a pull request, but I didn't manage to make it build yet :) Super cool project, looking forward got playing with it :)

imtringued 4 days ago | prev | next |

I don't know if you have given it a try, but check out industrial tools like Cadence Virtuoso and Innovus. by letting people design their own standard cells, you can let your players go deeper down the rabbit hole.

rafinha 3 days ago | root | parent |

That looks cool, I'll take a look thanks! I've been studying how to implement blueprints+layers, that might give some good clues indeed, thanks!

mattdeboard 4 days ago | prev | next |

Oh wow. Awesome. I had an idea for similar game for system design but got bogged down trying to learn game dev. This is so cool

amelius 4 days ago | prev | next |

Does it have a maximum fan-out of the gates, like real gates do?

rafinha 4 days ago | root | parent |

I haven't thought of that. It might be cool to add something like that for some extra puzzle/optimisation element. I guess it might be useful for netlist export? thanks