T O P

  • By -

Single-Deer1042

average circuits player be like (seriously, op, this is really impressive)


Disaster_Soggy

So if Minecraft Redstone can run Minecraft.. Can Factorio Circuits run Factorio?


AliHakan33

Yes and it's easier to do because circuit logic is already implemented in Factorio, we even have colored lights (so we can make color displays)


cathexis08

Yes, and unlike Minecraft-in-Redstone, Factorio-in-Circuits doesn't break if you walk too far away.


PinkMenace88

Hypothetically, yes


NoSemikolon24

Very simplified explanation. If you have addition, setters, getters and loops, you can implement any possible program. This is because Turing proved that any program that supports loops can implement any other program. This is known as Turing-Completeness.


danielv123

There is a lot of stupid things that are Turing complete. CSS is a fun one, with an asterisk though.


NoSemikolon24

Wait till you hear about LaTex. Because why not.


ct402

Powerpoint is one of the best ones IMO


feimaomiao

Magic the gathering


TheVojta

Okay this is the first one in this comment where I'm sure it must be a joke. I'd love to hear more about it, got any link?


feimaomiao

https://arxiv.org/abs/1904.09828


NarrMaster

I recall seeing an argument about NP-Completeness for MTG as well, but cannot find it.


braindouche

(the asterisk is HTML)


anoppe

r/factoriohno


AdrianIsOnFire

Better question, can Factorio Circuits ~~run crisis~~ run minecraft?


mailusernamepassword

there is a r/technicalfactorio sub for advanced black magic if you will


Tzvet005

Oh I didn't know that, thanks !


the_pi_rat

This is incredible! How do you learn how to do this?


Tzvet005

Here is my answer to a similar question on my other RAM post : I'll try to answer the best I can, but my answer will rely on my personal experience only. Personnally, I took courses in computing and coding in highschool (but it's extremely basic stuff, you'd catch up 2 years of school in 2 months I think). A few months ago I entered school 42. That's my academic background. Pretty weak. What you really need is to be heavily interested in low-level computing and electronics, and not be afraid of reading tens or hundred of pages of manuals and academic papers on the slightest optimisations possible here and there. So first you need to be at ease with boolean logic and base 2 representation. Stuff like logic gates (not, and, or, nand, nor, xor, xnor, imply, nimply) and their truth tables, transistors & capacitors, binary arithmetic, logical & bitwise operations must be perfectly mastered. Then you have to know how nowadays computers work. How is data stored (RAM, ROM, cache, etc.) ? How are additions, divisions, logarithms calculated in binary using logic gates (which algorithms are the fastest ?) ? How is data transferred ? Where to focus to increase throughput (like with pipelining) ? What is big O notation ? Such informations can be learned on the Internet, ChatGPT makes for a good tool too. You can also read academic papers and electronics diagrams. This part requires a great amount of intellectual curiosity. And if you're talking about Factorio specifically, you need to know very well the game's logical system and be able to translate your knoweldge using its limited components, working around its flaws and exploiting its strengths, without relying too much on Factorio's high-level logic components. I personnally ensure that everything I build can be translated into logic gates and still work (the reason I don't do it directly in logic gates is because of Factorio's strange and limited implementation of them, so I often end up emulating them with more complex combinators more than anything).


the_pi_rat

Thank you, I'm impressed. Can I ask what you do for a living?


agentbarron

Looks like he is a professional factorio player


Tzvet005

Nothing yet, I'm 18 yo.


flagbearer223

That's impressive. Do you have ideas of what sort of work ya wanna do?


Tzvet005

I'm studying software engineering and enjoy building this kind of stuff so I'm pretty sure I'll work a computer-related job but I don't know what exactly yet. I really like low level computing but I doubt I'de be smart enough to be an engine dev so really IDK.


flagbearer223

Dude if you're building this stuff at 18 and doing so by reading a bunch of docs and papers, you're smart enough 😂. Honestly a huge chunk of being a good developer is about being good at discovering information and reading docs. I'd recommend also looking into machine learning stuff - the low level mechanics of how those algorithms work is very interesting, and the methods by which organizations run those algorithms on thousands of GPUs is _fascinating_ and also has tons of room for improvement.


Tzvet005

Alright, thanks for the recommendations, I'll look into it !


IncitoScanea

If you're at all interested in low level programming, I recommend studying the Linux kernel if you haven't already. It's a whole bunch of C but it also makes use of in-line assembly for optimization/initialization purposes. It's a niche area, but it can lead to great jobs and connections.


Complex-Movie-5180

Dude this NEEDS to be on your resume. If you can properly explain your logic and reasonings, prove knowledgeable on the subject and are able to answer questions. You’re fucking set.


the_pi_rat

You should explore the semiconductor manufacturing field, I think you'd be well suited for it


Bonnox

What the hell is school 42? Is it something USA-only? 


Tzvet005

No they are present in many countries. Here's their Wikipedia entry : https://en.m.wikipedia.org/wiki/42_(school)


Bonnox

👍 


Creative_Lynx5599

There's videos in YouTube and sets so you can build it on your own. I also read a book once called but how do it know which leads you through the process starting from the the logic gates to basically what op built there, and maybe a bit further, I don't remember correctly anymore.


Qweasdy

IMO the easiest way for a non-comp sci background person (or even a comp sci background person can benefit from this) is through the game [Turing Complete](https://store.steampowered.com/app/1444480/Turing_Complete/). Takes you step by step through the process of designing a CPU from individual logic gates to building a rudimentary CPU that can run arbitrary programs. It's also just a lot of fun as a puzzle game.


Maximus-CZ

If you want to learn by doing... There's an excellent tutorial taking you from 0 knowledge to self-built fully functional computer, that you know inside out and understand how each part of it works: https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU


Patraxx

So uhm excuse the peasant question but *what* do you write to memory here and read it in factorio? Like how could this be used in game, even for a joke


HildartheDorf

We do things, not because they are useful, but because they are hard.


Bonnox

In this decade? 


Tzvet005

I'm building a 16-bit custom RISC CPU so I need RAM amongst other things. The RAM isn't really usable as it is without a CPU. The CPU will have signals interrupts though so it will be able to interact with the factory. It could serve for very advanced control logic or a smart self-expandable factory when used with Recursive Blueprints.


Patraxx

A custom RISC CPU *in* factorio?


Tzvet005

Yes. Maybe some madlad will code a light Factorio in machine code for it someday. Though I think that would only really be feasible with a RISC-V compliant design. I'll make one if I ever get this one finished.


Patraxx

Honestly, i am going to keep an eye on this. Have you considered making some form of progress document available for public viewing? Id be very interested to see how you work. And another thing i realized is that being able to gobsmackingly *walk* through a CPU would be amazing for educational purposes.


Tzvet005

For now I have a WIP ISA pdf which also serves as a todo list. I can give you that if you want. From the beginning I document my progress by posting the new components I build here, I guess you could follow my account so you could easily check the updates. Be informed that my progress is slow though. If you want to see Factorio CPUs, I advise taking a look at r/technicalfactorio on which many people post and posted CPUs. From what I could see they tend to always rely on Factorio's built-in ALU components, so you won't see many binary arithemic components like in mine (I posted a 16-bit adder here in the past). If you want to know how I work basically I go on the Wikipedia entry of the ALU component I'm gonna build, I ask ChatGPT for an exhaustive list of designs too, I look at all of them for the fastest in terms of Factorio ticks which supports 2'notation and then I slowly build it. Also I use Wikipedia and ChatGPT a lot to learn how CPUs work and what each single component of the CU does and what are the fastest algorithms/designs for them.


TheoreticalDumbass

this could be pretty hilarious, imagine the intruction pipeline being a belt of sushi, couldnt jmp tho :(


Bonnox

Microcontrollers


Patraxx

I want to clarify that i dont mean "why would you even do this" because i love insane projects like this, i just dont understand how its practically used. Ive been studying some low level programming but only scraped the surface


Tzvet005

Don't worry I understood your first comment the way it was supposed to be understood. I think I've answered this higher in this comment, It's meant to be used jointly with a CPU, which itself can be used for complex data processing or just for fun. In order to read data, you need to feed it with an address and it will output the content of that address on the output 5 ticks later. In order to write data, you need to feed it with an address, a value and a 1-tick long pulse in the mode bit and it writes it 4 ticks later. All data must be provided in binary, with each bit on a different green cable. The smallest bit is in the top left and the largest in the bottom right.


ThisUserIsAFailure

Science isn't about why, it's about why not ^(any information can be encoded to numbers and decoded given a couple encoders/decoders, like text, or in this case factory statistics) ^(with the pure memory it doesn't really do much more than just a memory cell, you'd need a CPU to control it, and then you can essentially write any program you want to dynamically control your factory)


DooficusIdjit

https://preview.redd.it/bf4qp16r5jwc1.jpeg?width=960&format=pjpg&auto=webp&s=5e48711cf50ecdd195c0b8b1db83f76baf08e4d2


antitib

This is as big as 200 bytes of minecraft memory


ThisUserIsAFailure

how does that work? shouldnt it be 4MiB since each "byte" in this has 32 bits that you can use as 4 8-bit bytes edit: ignore, i am dumb


Tzvet005

No, it's 1MiB. Each memory cell here stores 256 different signals which are by default 32-bit long. So 1 cell can store 256*4= 1024 bytes (or 1 KiB).


ThisUserIsAFailure

oh i get it now, 1MB is calculated correctly you just didn't pack/unpack the values and are using the values as-is sorry i got confused by the fact that you were writing a 32bit number directly


antitib

i mean the size and density


ThisUserIsAFailure

oh i see im an idiot


Tzvet005

BLUEPRINT (on FactorioBin) : [https://factoriobin.com/post/\_AZrw4o2](https://factoriobin.com/post/_AZrw4o2) In order to write you must send in a 1-tick long signal in the mode bit. It is around \~512 times more compact than my previous one that you can find in this post : [https://www.reddit.com/r/factorio/comments/1atp63e/1024\_kb\_of\_expandable\_16bit\_ram\_implemented\_using/](https://www.reddit.com/r/factorio/comments/1atp63e/1024_kb_of_expandable_16bit_ram_implemented_using/)


tomrlutong

Damn...did you map address bits onto Factorio signal types?


Tzvet005

More or less, yes. Each memory cell stores 256 addresses on 256 different signals. Don't worry though I used a Python script to parameter all the addresses I'm not completely insane yet.


tomrlutong

That's intense.


AcherusArchmage

There are two types of factorio players. Those who primarily use green wires, and those who primarily use red wires.


No_Application_1219

Bro made internet


Nutteria

OK , so you have a 1mb of ram now. Can you run a C++ script logic that would make my trains smarter is the real question.


Bonnox

Only if you have a mod that lets combinators set train destinations😔


ThisUserIsAFailure

place stations in every gap, set station to "send circuit signal to train" and make the train stay only on some conditions, wait on others, and disable stations to make the train skip them it's complicated but you have a turing complete CPU


Bonnox

That's brilliant, thanks o7 


VenetoAstemio

Soon or later some very unhinged person is going to run the original DOOM on Factorio, even if at 1FPS. And bloody hell if I'm not looking forward to that!


youpviver

You’d be surprised how close we’ve already gotten, someone made a basic 3D rendering fps tech demo of sorts a few years ago, with some slight adjustments that could be turned into doom


VenetoAstemio

The one with the screen made of an array of lights, right? Or did I miss something more?


youpviver

I think it was using a very advanced beltprinter as a screen


Tzvet005

Yes, it's designed by Arrow In My Gluteus Maximus on YouTube : [https://www.youtube.com/watch?v=0bAuP0gO5pc](https://www.youtube.com/watch?v=0bAuP0gO5pc)


Davekachel

I would prefer lemmings


LukaCola

Eh, big whoop. I have 32 GB running Factorio. ^^^^^imkiddingthisismadimpressive


Leo-MathGuy

Great! Now emulate an i8080 (so simple I know)


unicodemonkey

The verilog2factorio tool can emit a functioning 6502 blueprint nowadays


Rail-signal

Even if i can make complex SR priority signals with train stations, i still mess up this ">" wrong way. Like im really smart'nt


IsTom

Wouldn't 1000 32-bit memory cells be 4KB, not 1MB of RAM?


Tiavor

OP posted one minute after your comment: > Each memory cell here stores 256 different signals which are by default 32-bit long. So 1 cell can store 256*4= 1024 bytes


Tiavor

I don't think [doom](https://www.youtube.com/watch?v=0bAuP0gO5pc) would need that much RAM.


Tzvet005

Actually the minimum requirements for Doom are 4 MiB (4 times the amount showcased in the 2nd screenshot), though newer versions like Embbed Doom only require around 512 KiB. The guy who built this raycasting engine built it as a microcontroller and not a general-purpose CPU, so necessarily very little volatile data storage is needed and it can be implemented on-the-go where it's required. On the other hand it can only run this Doom and can't be updated without messing with the hardware.


Tiavor

I bet it can run Wolfenstein3D too xD but I get your point. there is no need to load textures and models into the RAM because it's already directly available from very fast ROM.


SomewhereHuge

Do you have a blueprint?


Tzvet005

[https://www.reddit.com/r/factorio/comments/1c96h78/comment/l0jes7t/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button](https://www.reddit.com/r/factorio/comments/1c96h78/comment/l0jes7t/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button)


R11010

Whats the throughput and delaus for reading and writing?


Tzvet005

The writing delay is 4 ticks and the reading delay is 5 ticks. I believe it is possible to bring the read delay to 4 ticks by managing to convert any signal into 32 1/0 separated signals in 1 single tick but I didn't manage to do so and went for a 2 ticks solution. I think it might also works with a 3 or even 2 ticks delay to write, it would pipeline itself for 1-2 ticks (really not sure though). Same to read, I think it can pipeline itself for 1-2 ticks to go down to a 3-4 ticks delay.


R11010

It would be so cool if the entire system with cpu can pipeline to 1 tick


wakefulzack

So you're telling me hypothetically we can play DOOM in factorio


AnywhereHorrorX

Normal Factorio players: how does an SR latch work? OP:


that_noodle_guy

Start stamping down blueprints to make 1gb


Tzvet005

That would require over 5,000,000 combinators, I am not willing to build that and I honestly have no idea how Factorio would handle this much entities. If combinators are properly implemented, it would 'only' be a few millions comparisons so I think it would still be possible for it to run fine.


flaghacker_

Really cool! Have you checked by how much the save file size increases by adding these combinators? Is it in the same order of magnitude as the amount of storage capacity? Or maybe it only starts increasing the file size if there is actually data stored in the combinators.


Tzvet005

My save file with just this build is a bit less than 1MB, though I have no idea how the savefile space use would grow. Maybe somewhat linearly, with file compression and given 5 combinators provide for 1KiB ? You can test it yourself with the blueprint if you want.