This is a bit of a weird one. I'll get to finishing up Seablock now The sandbox is the Editor Extensions mod. (At 11:35 I mistakenly say modulo it by 10,000 when it should've been 100.)
After watching, a lot of what you mentioned about memory handling, reminded of TIS, how you usually had a bunch of nothing cicles just to get the timing right. Actually, most things I can relate to Zachtronics games, hummmmmmmm I wonder why
Some things are simply too complex for one explaination to cut it. I've made a bit based resource encoder for Space Exploration, so multiple planets could request or provide resources via cannons on a single data line. Because back then I didn't feel like figuring out how to set up a time encoder instead. (turned out to be easy enough /after/ I tried, 200 hours into the save) And I /still/ only understood 1/4 of the printer : /
At 23:55 the technique that you employ with the belts is a similar technique used in PCB design for timing-sensitive signals: meandering. For anyone else reading with a desktop PC, if you take a moment to closely examine the printed traces on something like your computer's motherboard, specifically between the memory sticks and the CPU, you'll find TONS of wiggly traces that go back and forth. Those are meanders and their sole purpose is to make the traces all exactly the same length so that the data signals arrive to the CPU's input buffers at _exactly_ the same time. You'll also see this in the differential pair traces on expansion cards like graphics cards and whatnot because PCI express is similarly timing-sensitive due to the extremely high bandwidth.
The same thing happens when he's explaining latches with the arithmetic combinators, right? It's only one tick but I believe that would still count as a meander
Coming from an embedded systems programming background it's interesting watching all of these fundamental computing concepts get built up in front of my eyes with all of these funny building blocks. Now build a RISC pipeline.
unironically probably one of the greatest tutorials on basic comp sci on yt. This is like the first semester of a comp sci degree crammed into 45 minutes of watch time, you can even follow along in factorio itself as you watch. awesome.
@@KamikazeCommie501seems like a intelligence issue, this is advanced circuit knowledge, you'll only learn something if you have watched the previous video on basic circuit knowledge.
@@KamikazeCommie501 As a firmware engineer I can say that at work this would be considered basic indeed, of course in the context of hardware/firmware engineering.
@@Hr1s7i Idk, Im an electrical engineer and Im sure I wouldn't be if I was asked to explain whats happening in this video. Sounds more like CS to me, and sadly looks much cooler than what I do for a living.
@@NONAME-ey6qs Eh, I might be slightly off with this one. At the local uni, this kind of digital schematics and logic is told as part of electronics engineering course (the uni has separate diploma for electronics in the form of embedded systems and the like, while electrical engineering is a high voltage set of courses), automation course and CS course. I assumed it's the same everywhere else. My bad >.
No single part of this video is insanely complicated, but the perfect monotone and insane information density makes it very hard to follow 100% of the time. I found it best to watch it at 75% speed. Definitely learnt some tricks I never thought of in the first 8 minutes of the video
Well he just started explaining the printer itself and I am entirely lost. I'm just watching pretty pixels go across the screen 🫡 might have something to do with the fact that it's almost 4:00 a.m.
I've always found that learning how mechanics work, especially with programming/electronics, is way way easier to do when you have a project you are working towards. Learning concepts without any application is like learning to row while the boat is still on the shore. TY so much for this video, would love to see any of the other crazy stuff you do in your spare time. Next up, creating a computer monitor in factorio lol
I think I've learnt more in this video than reading the wiki page tbh. Keep going Dosh, I hope I don't beat Seablock before you because your ideas usually help me haha
This was like a software engineering textbook stood up and started giving me a lecture. My brain is fizzing and I want to cry, thank you please make more
YAY, now THIS is the only tutorial that I've really ever needed, and I intend to fully watch it. I don't need all these tips & tricks, I already know them! But this beast is something else. thank you for making this
Ive built a nuclear power plant that would play All-Star by Smash Mouth whenever Uranium was successfully enriched without knowing any of the fundamentals of this video. Circuits are really fun and useful even if you don't know computer science.
@@thefool8224 Seems to me you could make something resembling that with a massive grid-shaped version of the 7-segment display Dosh displayed in this video, combined with a very large one of those ring buffers. Seems like all you need to do from there is "write a program" (aka create a clock circuit that outputs specific variables at specific times) that tells a bunch of the lights to turn on in a specific sequence.
I started playing factorio recently and got a whole new perspective on just how good at this game you are. I was getting bottlenecked constantly literally everywhere, my factory was an eldritch horror of belt lines, and my oil production was all fucked up. Massive respect, guess that's why I'm a geographer and not an engineer
ok so i am a trained electrician from germany, focus on automisation. half of my training (3,5 years long) was literally logic and how to make working and efficient software, machines and assembly lines. i somehow understood next to nothing even though you wonderfully explained everything, ngl. the fact you got this to a point you built that printer, honestly, hats off to you, beautiful stuff. great vid as well.
As someone who has never played nor will likely play Factorio or really any automation game, this was still super interesting to watch. The fact that you were able to break it down enough that I figure I could follow along in-game is highly impressive
For filtering out many signals at once there is actually a small-ish way to do so. To achieve this we multiply the signals of each wire together. This is done as follows: Let all signals on red be "r" and all on the green line "g". Then if we compute o = (r+g)^2 (which we can since addition & pow are valid AC operations) we obtain an interesting output signal: If we were to expand it we see that we get: o = r^2 + 2rg + g^2. If we now subtract the r^2 and g^2 from o we are left with 2rg, which after dividing by 2 is a element wise multiplication of each signal. In the end, if we were to assign "roles" to the different wires, such as red carrying the data, and green carrying the signals you wish to extract (either 0 or 1), then we end up with filtered line filtering an arbritrary amount of signals with only 7 ACs in total.
Written a little more succintly for clarity, this would be - RG = [(R+G)^2 - R^2 - G^2]/2 It's important to know that this is very flawed. The exponentiation will make this overflow pretty easily. The biggest number you can work with is +/-46340. In factorio terms, that's not really all that big. It's less than 6 cargo wagon loads of green circuits for instance.
@@ColonelSandersLite I'm aware of the overflow. However since we here have integer arithmatic, we are basically computing the entire thing mod 2^32, which in this case causes the overflow to occur in "both directions" e.g. when also computing the r^2 we have the same type of overflow. As I'm currently too lazy to prove the actual mathematical formulation for which numbers the above equation works I wrote a simple c++ script to just check all the possible combinations in the int32 type. This yields the smallest range of values which work to be [-1073741825, 1073741824] which is a lot larger than the estimate you've given. If intrested, the script was: ```cpp #include #include #include int main() { int32_t lower = std::numeric_limits::min(); int32_t upper = std::numeric_limits::max(); for (int32_t i = std::numeric_limits::min(); i < std::numeric_limits::max(); ++i) { int32_t a = (i + 1) * (i + 1); // (r + 1)^2 int32_t b = i * i; // r^2 int32_t c = a - b - 1; // (r + 1)^2 - r^2 - 1 = 2r int32_t d = c / 2; // r, should be equal to i if (d != i) { if (i < 0) { lower = i; } else { upper = i; break; } } } std::cout
However, I've recently also come up with a bit perfect way to extract any amount of signals, keeping the entire range of bits available (by doing a sort of vectorized AND operation) If we have our "data" signals given on the red line, and want to extract all the signals from it which are given on the green line, the "filter" line proceed as follows: 1. The filter signals you want to extract should all be set to a value of -1 (or in hex 0xffff_ffff) 2. Compute the following for both signals: a. "each" >> 1 -> "each" AND 0x5555_5555 b. "each" AND 0x5555_5555 3. Then add the results for the red and green signals on both the a. and b. branches, i.e. (red a. + green a.) and (red b. + green b.). This can be done by connecting them to the same next stage combinators. (Now if both signals have a 1 in the corresponding bit's place, it carries over to the next bit's place) 4. Extract all the carried bits: a. (red a. + green a.) -> "each" AND 0xAAAA_AAAA b. (red b. + green b.) -> "each" AND 0xAAAA_AAAA -> "each" >> 1 5. Now finally recombine the extracted carry bits by re-adding them, simply by connecting the outputs of both stages to the same line (e.g. red) The idea behind this is we extract every 2nd bit from the original integers, setting all others to 0. Then when we add the resulting numbers only if both signals were 1 in that bit's position will it carry over to the next bit position (where the carry propagation stops, as it is guaranteed to be 0). I.e. this means we have the result of the AND operation 1 bit higher. The other stuff is just for splitting it into the 2 un-interleaved values, and recombining the 2 paths lateron. (0x5 = 0b0101 and 0xA = 0b1010) What's even cooler is that this entire thing can be done in 3 game ticks, with 9 combinators iirc. As a side note: This algorithm also contains a way to do vectorized bitwise XOR, if instead of the carry bit, we look at the original bit positions.
As someone who just got their undergraduate degree in computer engineering a few months ago, I really can appreciate all the effort that went in to making this. I think I can understand how this works for the most part, but I might have to download the blueprint and see. Awesome content, keep it up.
I'm a huge fan of in-game logic systems being used to make things completely unrelated to the gameplay loop. From Doom in Factorio to advanced calculators in Minecraft, this stuff rules. Awesome video, would love to see more like it.
This guide is very similar to engineering textbooks as in it doesn't make sence at first look but once you go around and play with the concepts it becomes super clear
High quality content, indeed. But there are several other streamers I enjoy, delivering in various formats. I would say don't stop with Dosh. Michael Hendriks insane difficulty and insight, BoldViking's ginormous builds, JDplays' soothing voice, Krydax' control, YamaKara's professional pasta, Nefrums and AntiElitz et al speedruns, and Ryan Brown has a good, compressed format, too. Not affiliated, just find that Dosh is a superb addition to the solid Factorio content factory.
You made this in a perfect time for me. I just got back into Factorio after about 6 months. Right now I'm working on a "smart" train dispatch computer, where any compatible train can go to any compatible station. All tracked via resource, station and train IDs. Which can also be dynamically assigned, bypassing the need to input a lot of values via constant combinators. My latest version is fully "analog" in a sense it processes each resource separately and is based on constant signals and processing of the same. The version I am working on right now has "digital" memory, task assignment and such all while keeping track of train length/config/wagons in order not to send a fluid train for an ore task or a 6 long train for a 2 wagon train task. I managed to assemble (still optimizing it) an addressable memory cell where (in a pulse) "I" signal determines the "ID" or the memory position while the rest of the signals (excluding R) get stored. On the other side you can send a pulse of Q=some_id and you recieve the signal set as a pulse on the next tick. R=some_id erases given memory position and frees ub the memory cells for new values (since we a re working with the space limit of how many memory cells are in a single module). I've already got a working POC of train dispatching with 1 frame delay. 3 trains with exactly the same schedule going to 3 identical stops (only difference is the id). From a perspective of a single train. On the same tick, the train recives the signal to go and the specific station I need the train to go to is enabled (with 1 train limit). The destination station stays enabled via latch until a train arrives. The train will "take" the single position in the station on the same tick, allowing you to send other trains via the same mechanism. The only issue I am currently trying to solve on the conceptual level is what to do about low-power states. I still need to test what happens with an electronic circuit when it works at 10% of power or if it completely loses signals if power is completely lost.
Just make it run of a battery that charges periodically from the main network with a switch. You could pipe steam into tons of tanks to act as a higher capacity battery too.
I have an idea: have a low power mode. No trains run on low power mode, except fuel trains. Have the network turn off if you lose power entirely, and only reactivate by hand. Make turning it on also reset the dynamic trains, so new trains can be assigned to new stops dynamically from zero.
This video was exactly what I wanted, last time I played Factorio. I tend to get lost in the sauce, trying to figure out my own uses for translating functions into game mechanics, but it takes a long stare to come up with these designs... Then, I forget what I did and stare at it for another 30 minutes; trying to remember why you connect X to Y. I'm just glad to have it all in one great reference video.
This is the second time this week I learned about bit shifting, probably a coincidence but it's funny that it happened twice. The other was about how OpenTTD generates its random town names. Also this is probably one of the best explanations of how circuits work so far.
After two minutes in, I forgot how understanding works. There were words thrown at me but I couldn't process them. It just felt like I was beaten up with computer science in my favourite video game. Great video. I love it
this is genuinely one of the most interesting videos ive seen on factorio and taught me a lot. i was considering complementing my programming degree with a computer science degree and now i am Very Heavily considering it
I'm watching this after Space Age has released, and I'm extremely excited by how much of this video is obsolete. Seeing the 10-wide decider combinator at 7:00 and realizing that you can do all of that with one combinator now feels freeing.
Love the vid Dosh, I have previous looked into how memory cells and clocks work with circuits, but could never get my head around why they worked. This was exactly what I needed.
Oh my, a big video about circuits from dosh. You're actually right on time for me with this one: My Seablock base outgrew its own rail network and i need circuit fuckery to accelerate the existing junctions near the depot... I also wanted to dabble with Recursive Blueprints for extending the island automatically and need a programmable control unit for the deployer... Very much appreciated, dosh!
IIRC you can single-step combinators by pulsing power to them. Useful for debug. (IIRC: a combinator with insufficient power in its internal buffer to update will simply not update that tick.) I wonder if you can use this for banked shift registers or memory cells. Definitely has its disadvantages, but may be interesting in some applications.
A small detail, but I think the OR gate condition at 7:09 should be "checkmark > 0" rather than "checkmark > 1". Doesn't matter much as it goes by fast, but it could confuse someone. (>= would also work).
i can't even express how awesome this is, last time I was this much excited when I saw someone played Portal's still alive song in factorio by using circuits and speakers, and now you made a practical printer inside the game, and boy isn't it majestic. please make this kind of awesome things more
I finally got around to watching this and it made me go back and look at the brain of my nuclear plant. It doesn't use a memory cell. Its clock doesn't work like Dosh's clock. It loops back into itself through multiple combinators and resets by deducting a flat number from its count. I'm not sure exactly how it works. It does work though. It detects when steam is low, and inserts one fuel into each reactor every 200 seconds until steam isn't low, and it can detect a sudden spike in power demand and insert fuel if steam drops past a preset point. Well-done past me. Whatever you did.
I decided to modernize the blueprint. The new design is half the size. It uses a normal clock that only runs when steam is low, instantly inserting fuel when activated. This made the latching system to detect demand spikes obsolete. I have some mixed feelings about that, given how much effort it took to develop it. It all seems so easy now.
This was amazing. It's also a good insight into how Factorio processes data, which appears to be some cursed combination of digital and analog logic in a way that it keeps the most annoying components of each while somehow being even more cursed. Having to combine signal timing, additive values, and a relatively low ceiling for integer values is something I was not aware I'd have to do, seeing as I've never built anything this complex before. I have to ask if the end of the video was really when your randomizer went off, or if you had that timed to activate when you were done. I can't see you actually building this in that specific an amount of time, or being willing to accept a random explosion taking out your work-in-progress...?
Dayum, mad respect to you sir. Came here to learn a bit on Factorio logic programming, left with an insatiable thirst for mad advanced Factorio experience. I enjoyed every minutes.
I love this. It seems immensely complicated and the speed that you explain it along with the sped up gameplay feels like you are shooting information into my brain and very little is getting in. Your channel is amazing, and I appreciate you making long form videos. Thank you!
This is the kind of content I love. Building some highly-specific contraption for an incredibly mundane and not particularly practical use in the name of fun.
Holy fudge, this was amazing! I made it to the end and will now never be able look at something seemingly magic in Factorio again and take for granted that it works. And I feel like at this point I understood about 40% which given I had little to no idea about combinators etc. but only most of the theorhetic concepts behind I find to be a good percentage. The first half of the video was better, deeper, more comprehensible than any other tutorial, blueprint, trial and giveup I have ever watched, reverse engineered and nuked respectively. All of that complex stuff explained in a halfway bored and halfway sarcastic voice was the icing on the cake. Amazing this is available for free for me to consume and break my mind over. Thank you!
Currently making a fully automated loader/unloader train stop, which is turning out to be more complex circuitry than I've done before. Your data sanitization section gave me what I needed to make it work, ty ty. Such a simple concept, ultimately, but it's hard as fuck to figure it out when you're just experimenting around with combinators.
This is gonna be a video I need to watch a few times to fully absorb everything, but it will probably be more effective than the last 3 years of me trying to understand circuits.
When I first got into Factorio and discovered the circuit system I immediately went to go make a clock. Somehow, my minutes kept doubling while everything before that was fine, so now i'm here to see what went wrong. Thank you
Thank you so much Dosh for tutorials like this. At times my lack of coding background (although I do know some logic) limits my ability to use the right terminology when asking for the answer to a question, this gives me a solid floor to at least start on, much appreciated.
I'm happy to see I figured out a few of the trick there by myself. I always thank that the clock was a monstrosity to do in factorio and never actually tried to use it. Thanks to prove me wrong!
I'm really graceful anyway for you showing basics of Factorio combinators. I'm unlikely to start a new playthrough soon, but I feel that these ideas are kinda universal, and should have applications beyond Factorio
I absolutly hate myself for watching AND enjoying this video. I have no idea what most of these magic words mean but I'm happy to see it work. Great video.
Chapeau! I am in awe how you manage to move from simple to complicated at an even pace this video while integrating previously introduced concepts into more complex systems. Many lecturers I had in university were significantly worse at this that you.
Thank you, this video helped me simplify my multiple ore input demand controlled smelting array logic. Seriously, it's way more helpful than the wiki page.
I'm learning. The wrinkles are forming! I also enjoy that you did this with a printer instead of problems you'd see in normal gameplay. I want the tools to solve my self-imposed problems, not the 'ideal' solution. That would take the fun out of it.
I'll be honest, I loved watching this video to listen to you talk. I will probably be using none of this in my factorio builds and can't even be sure my tiny brain absorbed any information at all.
This video has me deeply concerned for my liver, as my drinking game for this channel involves drinking everytime I hear the phrases 'constant', 'combinator', or 'constant combinator'.
Finally. After watching the space exploration 3x, krastorio 2 3x and the bean madness 2x, a new video! (usually I watch doing something else, so its easy to re-watch wout getting bored)
As a programmer with (hobbyist) experience working in vhdl and circuit design, this is fucking fascinating. I love seeing how the specifics of factorio circuits influence implementations of normal computer engineering concepts.
There is a trick to coloring lamps withouth extra filters. When you input negative value color into the lamp, it does satisfy activation condition, but color precedence prefers positive value over negative. I.e. if you want your lamp to be red, but you also have blue color in your circuit, you just have to make it negative for the lamp to be red. This is useful for flashing different colors.
This is the kind of knowledge i hope to have one day, if i can ever finish my engineering degree instead of taking constant breaks to work all year round lol.
as a programmer, I can confirm that holy crapola. that algo can rithm. honestly glad to see just how the circuitry works and might end up tinkering with said circuitry in factorio.
I've played for years. I love the game. I don't understand circuits in the least. This video explained everything slowly and easily. I still don't understand anything about circuits still but I enjoyed the video.
Now _that_ was a good tutorial followed by a fun project. I think I now sufficiently understand Factorio circuits to start doing some (less) cool things of my own.
This is a bit of a weird one. I'll get to finishing up Seablock now
The sandbox is the Editor Extensions mod.
(At 11:35 I mistakenly say modulo it by 10,000 when it should've been 100.)
You motherfucker. I was right about to sleep. Now I absolutely can’t for almost an hour now.
Bastard. Make worse content.
After watching, a lot of what you mentioned about memory handling, reminded of TIS, how you usually had a bunch of nothing cicles just to get the timing right. Actually, most things I can relate to Zachtronics games, hummmmmmmm I wonder why
Did you hopefully enjoy it at least? 😁 I mean it's wonderful. I'd make this a university class homework over the semester. 😇
I mean, you can just go into the editor and then overwrite the current plane of existence with lab tiles to get the same result.
Space Exploration Sea Block when? xD
just kidding, I don't think that'd work in any way...
Its crazy how this man explained everything so well and I understood none of it.
literally me frfr
Can't be caught liking this
People say there's no such thing as a bad student, only a bad teacher. This video proves that's bullshit.
100% agree !
Some things are simply too complex for one explaination to cut it.
I've made a bit based resource encoder for Space Exploration, so multiple planets could request or provide resources via cannons on a single data line.
Because back then I didn't feel like figuring out how to set up a time encoder instead. (turned out to be easy enough /after/ I tried, 200 hours into the save)
And I /still/ only understood 1/4 of the printer : /
At 23:55 the technique that you employ with the belts is a similar technique used in PCB design for timing-sensitive signals: meandering. For anyone else reading with a desktop PC, if you take a moment to closely examine the printed traces on something like your computer's motherboard, specifically between the memory sticks and the CPU, you'll find TONS of wiggly traces that go back and forth. Those are meanders and their sole purpose is to make the traces all exactly the same length so that the data signals arrive to the CPU's input buffers at _exactly_ the same time. You'll also see this in the differential pair traces on expansion cards like graphics cards and whatnot because PCI express is similarly timing-sensitive due to the extremely high bandwidth.
I took a look on the pcb for my mobo and it's true, cool :)
I was wondering about those! Thought the engineers must be getting bored, drawing wiggles on their PCBs :p
The same thing happens when he's explaining latches with the arithmetic combinators, right? It's only one tick but I believe that would still count as a meander
Coming from an embedded systems programming background it's interesting watching all of these fundamental computing concepts get built up in front of my eyes with all of these funny building blocks.
Now build a RISC pipeline.
How would one program it? Putting items in boxes would be neat
Make a whole base risc pipelined
... now I want a warehousing mod, but for logic operations. 😂
@@dogefort8410 THIS!
There are some proof-of-concept compilers for VHDL to factorio combinators out there.
Time to watch an entire video about a game I don't play and enjoy every second of it. 🗿
just like minecraft :)
Yes. Live vicariously through Dosh’s misery.
500h in 3 months here 🫠
I can't recommend this one enough. It's a steep learning curve, but many people turn out with an addiction.
Uh oh. I've been recognised.
unironically probably one of the greatest tutorials on basic comp sci on yt. This is like the first semester of a comp sci degree crammed into 45 minutes of watch time, you can even follow along in factorio itself as you watch. awesome.
This isn't 'basic'. The only people that understood anything in this video are people that already understood it before clicking it.
@@KamikazeCommie501there are alot of concepts in this video I didn't understand yet that I now do because of this video
Well, I didn't cover any of this in my Comp Sci coursework; I would have to assume it's for an electrical engineering degree, not a programming one.
@@KamikazeCommie501seems like a intelligence issue, this is advanced circuit knowledge, you'll only learn something if you have watched the previous video on basic circuit knowledge.
@@KamikazeCommie501 As a firmware engineer I can say that at work this would be considered basic indeed, of course in the context of hardware/firmware engineering.
You're on a different plane of existence and I am thankful I can absorb some of this knowledge
You won't be allowed to graduate electronics at any uni if you don't know this stuff.
@@Hr1s7i Idk, Im an electrical engineer and Im sure I wouldn't be if I was asked to explain whats happening in this video. Sounds more like CS to me, and sadly looks much cooler than what I do for a living.
@@NONAME-ey6qs Eh, I might be slightly off with this one. At the local uni, this kind of digital schematics and logic is told as part of electronics engineering course (the uni has separate diploma for electronics in the form of embedded systems and the like, while electrical engineering is a high voltage set of courses), automation course and CS course. I assumed it's the same everywhere else. My bad >.
@@NONAME-ey6qs the only CS part I could recognize is the bit related stuff.
@@NONAME-ey6qsAt least at my alma mater, CS focused on the algorithms. Digital design (which this very much is) is the realm of electrical engineers.
As an EE and Factorio lover. This is one of the most amazing projects I have ever seen.
What is EE?
@@jmatyaelectrical engineer
Google Factorio Sandman. But this is the best explanation so far :) Really good project!
I love that he had True Nukes installed while doing this
No single part of this video is insanely complicated, but the perfect monotone and insane information density makes it very hard to follow 100% of the time. I found it best to watch it at 75% speed. Definitely learnt some tricks I never thought of in the first 8 minutes of the video
Well he just started explaining the printer itself and I am entirely lost. I'm just watching pretty pixels go across the screen 🫡 might have something to do with the fact that it's almost 4:00 a.m.
I've always found that learning how mechanics work, especially with programming/electronics, is way way easier to do when you have a project you are working towards. Learning concepts without any application is like learning to row while the boat is still on the shore. TY so much for this video, would love to see any of the other crazy stuff you do in your spare time. Next up, creating a computer monitor in factorio lol
This video feels like my brain is being slowly microwaved while funkytown plays muffled in the distance
10/10 factorio content
This is a perfect description
the fact that some will read this comment without knowing is insane to me
Not funkytown… 😐 🔪 💀
I love being a rival cartel member, ooh they are so nice they are giving me an IV
I think I've learnt more in this video than reading the wiki page tbh. Keep going Dosh, I hope I don't beat Seablock before you because your ideas usually help me haha
This was like a software engineering textbook stood up and started giving me a lecture. My brain is fizzing and I want to cry, thank you please make more
Trying to add proper kerning to what is more or less a multi-color dot matrix printer is exactly the sort of madness I expect from this channel.
YAY, now THIS is the only tutorial that I've really ever needed, and I intend to fully watch it.
I don't need all these tips & tricks, I already know them! But this beast is something else.
thank you for making this
I never bothered learning circuits in Factorio, but these videos have made me consider making my own hardly-working garbage.
Ive built a nuclear power plant that would play All-Star by Smash Mouth whenever Uranium was successfully enriched without knowing any of the fundamentals of this video. Circuits are really fun and useful even if you don't know computer science.
@@Dschonathan someone made a darude sandstorm video inside factorio using this stuff. i dont even know how
at least make a sushi belt for science, they really look sooooo good and its satisfying to make it yourself
@@thefool8224 Seems to me you could make something resembling that with a massive grid-shaped version of the 7-segment display Dosh displayed in this video, combined with a very large one of those ring buffers. Seems like all you need to do from there is "write a program" (aka create a clock circuit that outputs specific variables at specific times) that tells a bunch of the lights to turn on in a specific sequence.
@@LtDan-fy7lc i didnt do enough programming to go beyond a calculator
I started playing factorio recently and got a whole new perspective on just how good at this game you are. I was getting bottlenecked constantly literally everywhere, my factory was an eldritch horror of belt lines, and my oil production was all fucked up. Massive respect, guess that's why I'm a geographer and not an engineer
I'm sitting here in a combination of entertained, awestruck, and inspired.
ok so i am a trained electrician from germany, focus on automisation. half of my training (3,5 years long) was literally logic and how to make working and efficient software, machines and assembly lines. i somehow understood next to nothing even though you wonderfully explained everything, ngl. the fact you got this to a point you built that printer, honestly, hats off to you, beautiful stuff. great vid as well.
As someone who has never played nor will likely play Factorio or really any automation game, this was still super interesting to watch. The fact that you were able to break it down enough that I figure I could follow along in-game is highly impressive
For filtering out many signals at once there is actually a small-ish way to do so. To achieve this we multiply the signals of each wire together. This is done as follows:
Let all signals on red be "r" and all on the green line "g". Then if we compute o = (r+g)^2 (which we can since addition & pow are valid AC operations) we obtain an interesting output signal:
If we were to expand it we see that we get: o = r^2 + 2rg + g^2. If we now subtract the r^2 and g^2 from o we are left with 2rg, which after dividing by 2 is a element wise multiplication of each signal. In the end, if we were to assign "roles" to the different wires, such as red carrying the data, and green carrying the signals you wish to extract (either 0 or 1), then we end up with filtered line filtering an arbritrary amount of signals with only 7 ACs in total.
Yeah I was thinking something like this would have been possible when he was talking about it
Written a little more succintly for clarity, this would be -
RG = [(R+G)^2 - R^2 - G^2]/2
It's important to know that this is very flawed. The exponentiation will make this overflow pretty easily. The biggest number you can work with is +/-46340. In factorio terms, that's not really all that big. It's less than 6 cargo wagon loads of green circuits for instance.
@@ColonelSandersLite I'm aware of the overflow. However since we here have integer arithmatic, we are basically computing the entire thing mod 2^32, which in this case causes the overflow to occur in "both directions" e.g. when also computing the r^2 we have the same type of overflow.
As I'm currently too lazy to prove the actual mathematical formulation for which numbers the above equation works I wrote a simple c++ script to just check all the possible combinations in the int32 type. This yields the smallest range of values which work to be [-1073741825, 1073741824] which is a lot larger than the estimate you've given.
If intrested, the script was:
```cpp
#include
#include
#include
int main()
{
int32_t lower = std::numeric_limits::min();
int32_t upper = std::numeric_limits::max();
for (int32_t i = std::numeric_limits::min(); i < std::numeric_limits::max(); ++i) {
int32_t a = (i + 1) * (i + 1); // (r + 1)^2
int32_t b = i * i; // r^2
int32_t c = a - b - 1; // (r + 1)^2 - r^2 - 1 = 2r
int32_t d = c / 2; // r, should be equal to i
if (d != i) {
if (i < 0) {
lower = i;
} else {
upper = i;
break;
}
}
}
std::cout
However, I've recently also come up with a bit perfect way to extract any amount of signals, keeping the entire range of bits available (by doing a sort of vectorized AND operation)
If we have our "data" signals given on the red line, and want to extract all the signals from it which are given on the green line, the "filter" line proceed as follows:
1. The filter signals you want to extract should all be set to a value of -1 (or in hex 0xffff_ffff)
2. Compute the following for both signals:
a. "each" >> 1 -> "each" AND 0x5555_5555
b. "each" AND 0x5555_5555
3. Then add the results for the red and green signals on both the a. and b. branches, i.e. (red a. + green a.) and (red b. + green b.). This can be done by connecting them to the same next stage combinators. (Now if both signals have a 1 in the corresponding bit's place, it carries over to the next bit's place)
4. Extract all the carried bits:
a. (red a. + green a.) -> "each" AND 0xAAAA_AAAA
b. (red b. + green b.) -> "each" AND 0xAAAA_AAAA -> "each" >> 1
5. Now finally recombine the extracted carry bits by re-adding them, simply by connecting the outputs of both stages to the same line (e.g. red)
The idea behind this is we extract every 2nd bit from the original integers, setting all others to 0. Then when we add the resulting numbers only if both signals were 1 in that bit's position will it carry over to the next bit position (where the carry propagation stops, as it is guaranteed to be 0). I.e. this means we have the result of the AND operation 1 bit higher. The other stuff is just for splitting it into the 2 un-interleaved values, and recombining the 2 paths lateron. (0x5 = 0b0101 and 0xA = 0b1010)
What's even cooler is that this entire thing can be done in 3 game ticks, with 9 combinators iirc.
As a side note: This algorithm also contains a way to do vectorized bitwise XOR, if instead of the carry bit, we look at the original bit positions.
Wow this guy seems super smart, he should be an engineer :)
engineer gaming.
the engineer is enginear your location.
Engineer? Yeah, he's engiNEAR HIS FUCKING LIMIT!
@@holl7w the engineer is engideer
He is, and he have degree to prove it
As someone who just got their undergraduate degree in computer engineering a few months ago, I really can appreciate all the effort that went in to making this. I think I can understand how this works for the most part, but I might have to download the blueprint and see. Awesome content, keep it up.
I'm a huge fan of in-game logic systems being used to make things completely unrelated to the gameplay loop. From Doom in Factorio to advanced calculators in Minecraft, this stuff rules. Awesome video, would love to see more like it.
I like how with this printer, refilling the ink is actually the easiest part.
I see circuits and Todd Howard and I know it’s gonna be a good time
You mean Hodd Toward?
Todd Coward
This guide is very similar to engineering textbooks as in it doesn't make sence at first look but once you go around and play with the concepts it becomes super clear
But in all honesty this is the only guy who I have notifications on for and I have watched basically all his videos way to many times
High quality content, indeed. But there are several other streamers I enjoy, delivering in various formats. I would say don't stop with Dosh. Michael Hendriks insane difficulty and insight, BoldViking's ginormous builds, JDplays' soothing voice, Krydax' control, YamaKara's professional pasta, Nefrums and AntiElitz et al speedruns, and Ryan Brown has a good, compressed format, too.
Not affiliated, just find that Dosh is a superb addition to the solid Factorio content factory.
@@leduke79thanks for the recommendations I'll look into them
This is hands down the best and most follow-able advanced circuits video I have seen. Cheers for some amazing work and an impressive printer!
You made this in a perfect time for me. I just got back into Factorio after about 6 months.
Right now I'm working on a "smart" train dispatch computer, where any compatible train can go to any compatible station. All tracked via resource, station and train IDs. Which can also be dynamically assigned, bypassing the need to input a lot of values via constant combinators.
My latest version is fully "analog" in a sense it processes each resource separately and is based on constant signals and processing of the same. The version I am working on right now has "digital" memory, task assignment and such all while keeping track of train length/config/wagons in order not to send a fluid train for an ore task or a 6 long train for a 2 wagon train task.
I managed to assemble (still optimizing it) an addressable memory cell where (in a pulse) "I" signal determines the "ID" or the memory position while the rest of the signals (excluding R) get stored. On the other side you can send a pulse of Q=some_id and you recieve the signal set as a pulse on the next tick. R=some_id erases given memory position and frees ub the memory cells for new values (since we a re working with the space limit of how many memory cells are in a single module).
I've already got a working POC of train dispatching with 1 frame delay. 3 trains with exactly the same schedule going to 3 identical stops (only difference is the id). From a perspective of a single train. On the same tick, the train recives the signal to go and the specific station I need the train to go to is enabled (with 1 train limit). The destination station stays enabled via latch until a train arrives. The train will "take" the single position in the station on the same tick, allowing you to send other trains via the same mechanism.
The only issue I am currently trying to solve on the conceptual level is what to do about low-power states. I still need to test what happens with an electronic circuit when it works at 10% of power or if it completely loses signals if power is completely lost.
Just make it run of a battery that charges periodically from the main network with a switch. You could pipe steam into tons of tanks to act as a higher capacity battery too.
I have an idea: have a low power mode. No trains run on low power mode, except fuel trains. Have the network turn off if you lose power entirely, and only reactivate by hand. Make turning it on also reset the dynamic trains, so new trains can be assigned to new stops dynamically from zero.
The fact this video contains the word simple is truly a crime
Well, everything is relative... The use at 6:25 is quite justified imo. ^^
I actually really love these tutorial type videos. genuine concepts and factorio knowledge packed into a madness fueled project.
This video was exactly what I wanted, last time I played Factorio. I tend to get lost in the sauce, trying to figure out my own uses for translating functions into game mechanics, but it takes a long stare to come up with these designs... Then, I forget what I did and stare at it for another 30 minutes; trying to remember why you connect X to Y. I'm just glad to have it all in one great reference video.
This is the second time this week I learned about bit shifting, probably a coincidence but it's funny that it happened twice.
The other was about how OpenTTD generates its random town names.
Also this is probably one of the best explanations of how circuits work so far.
That's an interesting tidbit of data, I didn't know they used bit-shifting to generate it's random town names.
The detailed explanation of how to create a digit display in vanilla the brute force way and how to optimize it was very educational. Great work!
Chekhov's nuke was a great addition, I kept wondering when it would crop up again
Huh, missed it. When did he planted the nuke?
@@romanzhed7220 In the pseudo-random part, at 10:12
@@nadarith1044 thanks!
After two minutes in, I forgot how understanding works. There were words thrown at me but I couldn't process them. It just felt like I was beaten up with computer science in my favourite video game. Great video. I love it
Love this kind of content, but as a computer engineering major just getting back to classes I feel like I could just as well be doing homework 😂
But this is fun homework!
or you could do your homework in factorio!
As soon as i read circuits. My brain melted and i went to sleep:)
this is genuinely one of the most interesting videos ive seen on factorio and taught me a lot. i was considering complementing my programming degree with a computer science degree and now i am Very Heavily considering it
I'm watching this after Space Age has released, and I'm extremely excited by how much of this video is obsolete. Seeing the 10-wide decider combinator at 7:00 and realizing that you can do all of that with one combinator now feels freeing.
I feel like I just had a 6 hour seminar on computer logistics...
that 40mins packs a year worth of CS course concepts. Nice
Love the vid Dosh, I have previous looked into how memory cells and clocks work with circuits, but could never get my head around why they worked. This was exactly what I needed.
Oh my, a big video about circuits from dosh.
You're actually right on time for me with this one: My Seablock base outgrew its own rail network and i need circuit fuckery to accelerate the existing junctions near the depot...
I also wanted to dabble with Recursive Blueprints for extending the island automatically and need a programmable control unit for the deployer...
Very much appreciated, dosh!
IIRC you can single-step combinators by pulsing power to them. Useful for debug.
(IIRC: a combinator with insufficient power in its internal buffer to update will simply not update that tick.)
I wonder if you can use this for banked shift registers or memory cells. Definitely has its disadvantages, but may be interesting in some applications.
Every time I get the urge to try this game I watch one of your vids and the feeling swiftly goes away.
A small detail, but I think the OR gate condition at 7:09 should be "checkmark > 0" rather than "checkmark > 1". Doesn't matter much as it goes by fast, but it could confuse someone. (>= would also work).
Yep - @dosh please pin this comment!
i can't even express how awesome this is, last time I was this much excited when I saw someone played Portal's still alive song in factorio by using circuits and speakers, and now you made a practical printer inside the game, and boy isn't it majestic. please make this kind of awesome things more
Who else voluntarily turned this 40 minute video into a 3-hour study session?
Suprising that a machine like this one becomes so managable after being skillfully explained. Well done.
Everytime Dosh says "but thats easy" I think no, no its not..😢
Dude, I work in cybersecurity and this vid legit helped me understand technical aspects of my job. Wtf is this.
I am ungodly early to this video but I've been waiting for this
a little vine boom sound effect plays in my brain every time you mention something I've studied as an ee major
I am only 12 minutes in and my brain hurts.
Train the brain, train it hard! if don't skip brain day it will eventually stop hurting
I finally got around to watching this and it made me go back and look at the brain of my nuclear plant. It doesn't use a memory cell. Its clock doesn't work like Dosh's clock. It loops back into itself through multiple combinators and resets by deducting a flat number from its count. I'm not sure exactly how it works.
It does work though.
It detects when steam is low, and inserts one fuel into each reactor every 200 seconds until steam isn't low, and it can detect a sudden spike in power demand and insert fuel if steam drops past a preset point.
Well-done past me. Whatever you did.
I decided to modernize the blueprint.
The new design is half the size. It uses a normal clock that only runs when steam is low, instantly inserting fuel when activated. This made the latching system to detect demand spikes obsolete.
I have some mixed feelings about that, given how much effort it took to develop it. It all seems so easy now.
This was amazing. It's also a good insight into how Factorio processes data, which appears to be some cursed combination of digital and analog logic in a way that it keeps the most annoying components of each while somehow being even more cursed. Having to combine signal timing, additive values, and a relatively low ceiling for integer values is something I was not aware I'd have to do, seeing as I've never built anything this complex before.
I have to ask if the end of the video was really when your randomizer went off, or if you had that timed to activate when you were done. I can't see you actually building this in that specific an amount of time, or being willing to accept a random explosion taking out your work-in-progress...?
I stood around waiting for it to go off naturally, but it crashing the game was unexpected
Dayum, mad respect to you sir.
Came here to learn a bit on Factorio logic programming, left with an insatiable thirst for mad advanced Factorio experience.
I enjoyed every minutes.
I feel threatened by this man.
I love this. It seems immensely complicated and the speed that you explain it along with the sped up gameplay feels like you are shooting information into my brain and very little is getting in. Your channel is amazing, and I appreciate you making long form videos. Thank you!
HOW TO CIRCUIT: BASICS
This is the kind of content I love. Building some highly-specific contraption for an incredibly mundane and not particularly practical use in the name of fun.
LET'S GOOOO
Holy fudge, this was amazing! I made it to the end and will now never be able look at something seemingly magic in Factorio again and take for granted that it works. And I feel like at this point I understood about 40% which given I had little to no idea about combinators etc. but only most of the theorhetic concepts behind I find to be a good percentage. The first half of the video was better, deeper, more comprehensible than any other tutorial, blueprint, trial and giveup I have ever watched, reverse engineered and nuked respectively. All of that complex stuff explained in a halfway bored and halfway sarcastic voice was the icing on the cake. Amazing this is available for free for me to consume and break my mind over. Thank you!
NOT THE ORPHAN OXEGEN SUPPLY!!
Currently making a fully automated loader/unloader train stop, which is turning out to be more complex circuitry than I've done before. Your data sanitization section gave me what I needed to make it work, ty ty. Such a simple concept, ultimately, but it's hard as fuck to figure it out when you're just experimenting around with combinators.
To work with 16 colors, can you add 16 to every values with a constant combinator and add 16 to the "request" of every inserter ?
The biggest problem with that is you have to do more math each step of the way.
O k. I'm giving up on trying to understand this wizardry.
Literally the most brain melting Factorio content for me throughout my 1000h of playing.
This is gonna be a video I need to watch a few times to fully absorb everything, but it will probably be more effective than the last 3 years of me trying to understand circuits.
When I first got into Factorio and discovered the circuit system I immediately went to go make a clock. Somehow, my minutes kept doubling while everything before that was fine, so now i'm here to see what went wrong. Thank you
i probably won't get noticed but i really liked this tutorial, thank you dosh (your printer is awesome(
Our friend just gave you like 4 college courses worth of info. Gratitude.
Thank you so much Dosh for tutorials like this. At times my lack of coding background (although I do know some logic) limits my ability to use the right terminology when asking for the answer to a question, this gives me a solid floor to at least start on, much appreciated.
I was waiting for a biter invasion the entire time. Was shocked by the explosion that followed... Great video
I'm happy to see I figured out a few of the trick there by myself. I always thank that the clock was a monstrosity to do in factorio and never actually tried to use it. Thanks to prove me wrong!
I'm really graceful anyway for you showing basics of Factorio combinators. I'm unlikely to start a new playthrough soon, but I feel that these ideas are kinda universal, and should have applications beyond Factorio
Logged in just to comment a big thanks. Explaining how the ticks behaved really helped. Good luck with the things.
I absolutly hate myself for watching AND enjoying this video. I have no idea what most of these magic words mean but I'm happy to see it work.
Great video.
Have to admit, this is one of the nicer ways of getting the feeling that my brain is flowing out through my ears.
I'd have a lot of trouble remembering what all these things did during the building process even if I knew circuits inside and out. Impressive build!
Chapeau!
I am in awe how you manage to move from simple to complicated at an even pace this video while integrating previously introduced concepts into more complex systems.
Many lecturers I had in university were significantly worse at this that you.
Thank you, this video helped me simplify my multiple ore input demand controlled smelting array logic. Seriously, it's way more helpful than the wiki page.
I'm learning. The wrinkles are forming!
I also enjoy that you did this with a printer instead of problems you'd see in normal gameplay. I want the tools to solve my self-imposed problems, not the 'ideal' solution. That would take the fun out of it.
Is this like Electronic Engineering class disguised as a Factorio guide? I understood nothing but I love it.
I'll be honest, I loved watching this video to listen to you talk. I will probably be using none of this in my factorio builds and can't even be sure my tiny brain absorbed any information at all.
Wow this popped up when I was rewatching space exploration (all three videos) for the fifth time, great timing!
This video has me deeply concerned for my liver, as my drinking game for this channel involves drinking everytime I hear the phrases 'constant', 'combinator', or 'constant combinator'.
33:57 One crossed wire, one wayward pinch of potassium chloride, one errant twitch... And kablooie!
Finally. After watching the space exploration 3x, krastorio 2 3x and the bean madness 2x, a new video!
(usually I watch doing something else, so its easy to re-watch wout getting bored)
Get ready to rewatch everything again 😂
As a programmer with (hobbyist) experience working in vhdl and circuit design, this is fucking fascinating. I love seeing how the specifics of factorio circuits influence implementations of normal computer engineering concepts.
There is a trick to coloring lamps withouth extra filters. When you input negative value color into the lamp, it does satisfy activation condition, but color precedence prefers positive value over negative. I.e. if you want your lamp to be red, but you also have blue color in your circuit, you just have to make it negative for the lamp to be red. This is useful for flashing different colors.
Watched the whole video despite not doing this kind of stuff with the game because as a Physicist, I just enjoy listening to it. Good work on it all.
This is the kind of knowledge i hope to have one day, if i can ever finish my engineering degree instead of taking constant breaks to work all year round lol.
That was amazing to see what you and a few Factorio circuits can make. Got to love the power of binary math.
You made me actually cackle aloud with that brick drop at the end, bravo
as a programmer, I can confirm that holy crapola. that algo can rithm.
honestly glad to see just how the circuitry works and might end up tinkering with said circuitry in factorio.
I've played for years. I love the game. I don't understand circuits in the least. This video explained everything slowly and easily.
I still don't understand anything about circuits still but I enjoyed the video.
Now _that_ was a good tutorial followed by a fun project. I think I now sufficiently understand Factorio circuits to start doing some (less) cool things of my own.