Quick tip regarding the global circuit signals. You can hook the circuits into a radar, and it will transmit the circuit signals globally to every other radar. In case you want to do this without the city blocks.
@@ScorpioneOrzionyes, I personally place one in each depot group then connect each station in that particular depot to that radar. Preferably through electric pole for easier debugging
What are the chances that your last video was 2 years ago and now you release this brilliant factorio tutorial right when I'm searching for it? Thank you so much, this was a great video with really understandable examples and explanations.
This video made me realize why the wait 5 secs condition in LTN exists. Great video and i'm going to see if I can implement that 5 sec wait time for the depots.
Thanks for a great tutorial! Here are couple of things to look at: 1. It looks like that it's possible that a train of 1 wagon will go to the station that requires 4 wagons (or you have to setup different interrupts for trains of different sizes). So, in the scenario of multiple train sizes, actually all the trains must be of the same size, only size of stations will differ. 2. Instead of detecting when train is full in a circuit condition inside the train, it seems more convinient to setup the same circuit condition in all the interrupts (smth like F > 0) and set up the combinator logic to check when the train is full on the station. This way, the station decides when the trains leave, not the train. 3. You can use the new parametrised blueprints to calculate capacity of trains and stations - this way once you place a blueprint, it will ask the user to choose the item and the constants will be calculated automatically
Love the way you clearly explain things, I usually walk away from logistics video more confused than I started, but your explaination is perfect, thank you!
Perfect! This was exactly what I was looking for. I was having trouble finding the right signal to listen to when dispatching trains, to avoid sending multiple trains.
Edit: 1 tick timers don't work, use 2 tick ones, a.k.a one combinator has "== 1" condition, second one has "== 3", then "== 5", and so on. If you use odd numbers like me, ensure the clock's max tick is also always 1 higher than the highest depot station value, so that when the clock resets, there is a tick gap between the highest and lowest depot stations. With that, 300 trains will cycle through in 10 seconds. +++++++++++++++ One more thing: I used a one second timer for cycling between active trains, but realistically you should be able to achieve it with a 1 tick or 2 tick timer, which lets you cycle through 60 trains a second. For large megabases that have hundreds of trains, this will allow you to cycle through 600 trains within 10 seconds. The only downside is having to set up the decider combinators manually for each depot station. You have to keep track of what the last decider combinator conditions were set to so you can set new ones appropriately. I'll leave it to you guys to figure out a good way to do that :D
This is the guide I have been looking for! Ive been wanting to finally set up my first City Block factory and I wondered how much more possible it was in Space Age / 2.0. Thank You!
Just as a point of clarification - I used hardcoded train limits of 1 for demonstration purposes on the provider stations. As long as you have stackers at the provider stations, you can increase the limit to a maximum of however many trains can wait at the station at a given time. Then, as long as you take the train count (C signal in the video) and output a corresponding amount of positive signals, the trains will cancel out the correct amount of negative resource signals on the global network. This allows multiple requesters to be serviced by a single provider, which improves throughput overall as providers generally are supposed to service multiple requesters each before you need to add more providers.
You don't need a combinator to activate a train. You could just divide the counter by the delay you want, and write a condition in each train and check if the current pulse is equal to that train's specific value. Set the reset value to the number of trains multiplied by delay and that's it. Easy to expand indefinitely, with as many depots as you want, though require a bit of manual labor numerating each train, but you'd have to do the same with combinators anyway. Or, if you want to ensure that there's some delay between activations, you could assign train values by 2. And the counter also by 2, so by train number, by delay and by 2. So, the counter, will send signal 1, 2, 3, 4, 5, 6, 7, 8 each once per second (if divider is 60), then your first train's value is 1, second's train value is 3, etc. Or slightly more elaborate timer that does something like 1 for 10 ticks, 2 for 1 tick, 3 for 10 ticks, 4 for 1 tick and so on, so with only 1 delay between each even tick. Anyway, the idea is - you don't have to have any combinators beside the clock generator.
Upd.: I ended up with a circuit that just sends the train number for 8 ticks and then 0 for 2 ticks. So, 1 (8t), 0 (2t), 2(8t), 0(2t), 3(8t), 0(2t) etc, so I just numerate trains incrementally, instead of all even or all odd. The circuitry isn't that hard. Also, I read random request from the global line and send it to depot, so trains can process requests randomly, instead of every one going to whatever request having the highest demand, as that might oversaturate that request while leaving other requests starving.
Great video. Thank you for walking through the logic. When it is built rather than just shown the info is much better retained for me. Cheers! I think you could have described a little better why the resource numbers going into the network were negative rather than positive. Really well done though.
I had a blast reading all the FFFs about trains and having them for real is even more insane and amazing, can't wait for all the videos that are coming just like this one! Btw i feel like it can all be simpler because the interrupts were specifically designed with wildcard signals, lots of conditions and genericness. I don't fully understand here the difference between your system and the intended simpler way in terms of what effect it has on the trains, but if you just wanted to do something cool i respect it!
Great explanation! You’ve inspired me to implement such design as you proposed in my game. However, I consider using selector combinator to make interrupts more abstract from items. I think, we can add signal condition to trains “number of active routes need to serve” instead of each condition for provider/requester stations separately. Active routes to “serve” is min(active providers, active requests)
@@farazsth98 In the menu where you select an icon for your interrupt name, there is a section with a box and a "?" symbol on it. In it, there are multiple variable parameters that can be used in such way. I believe that using signal parameter in place of a regular resource icon accomplishes just that allowing you to have a single interrupt rule covering all of the possible resources. I'm not sure that even any other changes are needed, changing just that in your save file made all trains work the same way as with multiple interrupts. Which makes sense, since it's basically the same thing as you were doing for each resource manually, but instead the game logic dynamically plugs in the requested resource icon when needed.
@@farazsth98 I think this guy did sort of this: th-cam.com/video/ZoEOg0GisiI/w-d-xo.html&ab_channel=DocJade However, his solution is pretty hard to edit and customize for yourself. So I think to use his design of "generic trains" and "item random selector" in your layout as its straightforward enough.
@@skullcrabster thats really awesome, dude. I thought really hard how they are doing parametrized provider/requester station. Now everything is so clear due to you!!!
This is eeriely similar to a design I had (nearly) complete in 1.0. I had supplier stations requisition empty trains that then sat at depos waiting for requests. Each item type was only allowed a set number of filled trains at a time. The pros were fast request fulfilment, the cons were massive amounts of combinators at each station, and huge train yards that each had a "logic hub" of a huge amount of combinators handling timing and request dispatching.....I'll recreate in SA some day, and maybe make a vid too!
Great vid! Btw, it's not a big deal, but since the refuel station shares the way to it with the coal requester station, you could have up to 6 trains going to that block, not 5. Refuels should be fast anyways, but there could be a short jamming sometimes. The new rails should help adding extra lanes on the same space, though, so it should be easy to fix (if you don't want to lower the train limit).
Hello! I tried to dl your save file and Factorio said it may have been an older file. Maybe it's just from the hotfixes but it is functional so far. Thanks for the good work!
I like having a signal for both how many requester stations are ready and how many providers are. It helps with setting up a dashboard to understand what is broken or deadlocked or backed up or missing.
@@mrpocock I used the green channel for both the requester signal, and the provider signal that cancels out the requester. You should be able to use the red channel for a dashboard, just need to set it up a bit differently so the two colors don't clash, that's all.
Yes! It is possible, I made another video to showcase how you can do that. You'd need one interrupt for items, and one interrupt for fluids, but its possible! 😄
The only issue I see with this system is when you start plopping depots down all over your map, you'll start quickly having 100, 200+ stations. Even if you change the clock to 15 ticks, 4 per second, we're still talking 50 seconds until the last depot gets another chance to run again. That's a long time for an entire area of the map to have downtime. Could the tick maybe go down to like... 1? The logic would still update fast enough, no? Say odds buffer, evens run. Set O = 1 when K = 2, 4, 6, 8, 10, etc. This would allow for 30 stations to update per second, and at worst you'll be waiting 6.6 seconds for the 200th station. Still doesn't really solve the issue of not selecting a "nearby" train, but I saw what you were saying in another comment to just make independent systems for far away resources. Edit: Funny, you say almost exactly the same things in your follow up video, haha.
@@twelvethirtyfour Yes haha, I covered this in the follow up, I wish there was an easier way to dynamically edit TH-cam videos to make the follow up video more visible to viewers 😂
The provider could just add C count to the copper count as well, I think that's even more simple and it would also work when you have a train limit of more than 1.
@@daniel29263 Yep! I've implemented this, but haven't made a video about it. If you take a look at the pinned comment in my follow up video, I linked a blueprint book that contains a provider station blueprint with this setup. It requires a bit more logic than just naively using the C count, because you want to also be able to control the actual max train limit (otherwise you can have like 7 or 8 train limit, which is a lot), but yeah it does work.
Funny you've come up with a very similar system to my own except I haven't used signals, just interrupts. I fear signals in this game so much, they just beg to add overcomplication and technical debt to my many factory inefficiencies 😂
There's nothing wrong with trains sleeping on loading stations. In fact I'd argue it's the optimal situation because when an unloading station opens up there is a train ready to fulfill.
@@northo9583 Sure, that's one way to look at it. However, this doesn't scale well, because you'll need to always ensure you have the same amount of trains as provider stations, and then you have to ensure that you have enough trains to cover the number of requests that come through. Effectively, it forces each train to only fulfill requests for a specific resource type, even if you make them generic, as soon as a train shows up and starts sleeping at a provider station, that train is now locked into providing that specific resource until it fulfills a request. Yes, as long as you have enough trains, it works out, but I personally prefer having the minimal amount of trains moving around, and only adding more as needed. Especially for megabases, it reduces the number of provider stations you'll need (assuming you don't have depots at that point and the trains are built to go back to providers and just wait there, you'll need enough stations for all the trains to wait at)
How does this handle further afield Requester stations, mixed with more central ones? Ive been playing with your save file, and if you put an additional copper plate requester station to the right of your coal provider, you can get a situation whereby this new station gets starved. The closer copper requester stations effectively 'stealing' the requests from en route trains. We can play with priority on that further out station, but unsure the effects of that over longer periods
@yourundoing12 I think if you run into that scenario, it means you have less trains than you should have. If the closer copper requester needs so much copper that -- by the time a train fills up at a provider for the farther requester, the closer one has already emptied out, you'll want the buffer at the closer one to be bigger, plus maybe you'll want to add another provider, along with a requester station near the closer one. You're right in that this doesn't specify which train station the requester is, it just looks for the closest open station, but I haven't really run into this issue, as having enough stations + trains means the problem solves itself
Thnx for this clear explanation. One thing I can't figure out though...how can I increase the train limit of a provider/requester station? Is it a value I have to change or just turn off train limit and set it manualy? Thnx
@@dadillegaming1563 You have to add additional logic to the circuits in order to account for higher train limits. If you look at the pinned comment in my most recent video, I have some blueprints in there where the provider stations can accept higher train limits (I haven't implemented this for requesters yet, because I haven't needed it). Essentially, instead of sending a +1 signal when the train heads to the provider, you send a +C signal, where C is the number of incoming trains to the provider. That's the high level quick explanation but there's a bit more to it than that.
Hey guys, I have watched both Faith videos. I understand the clock solution for 1 Active Requestor and many Active Providers issue, but do you maybe have some other ideas on how to handle it without the clock?
I was banging my head on how to decrease the demand when a train was dispatched but didn't think to also use a C signal on the provider stations... However, if you want to use a stacker on your stations (i.e. allow more than 1 train inbound), I think you may still end up in a situation where once a train arrives at a requester station and is unloading, demand drops by 2 instead of 1, because you'd reduce it once for a stopped train and once more for when a resource buffer fills up a bit (assuming you lower your train limit as your buffer space decreases), and end up with some trains stuck at provider station due to lowered train limit. But once the train leaves, it should be fine. It could be solved with another interrupt with an intermediate stop, but if this shunting yard is too far, your requester may schedule another train before the stuck one reaches the yard and can start trying to go to the requester, because it won't be counted for C. I think in the end a more complex solution would be needed for a completely clean operation. As for doing multiple resources, you can use another clock and the new combinator to iterate over items on the wire and spread them out across trains, but maybe that's not needed at all.
@@sergei2039 I've only been using hard set limit of 1 at requesters, so I haven't ran into that issue yet. I have implemented the stackers at providers already though, and that's been working really well so far! It's just a bit more circuit logic to allow that to work (needed to ensure that the train limit on the provider doesn't exceed a max, because I don't necessarily want 6 trains to end up waiting at one provider if there are others that are free). I also implemented some logic at providers to decrease their priority by 1 per incoming train. This allows trains to split up between providers evenly, rather than all of them going to the closest provider and stacking to fill it up before the others are used, although I'm not sure how impactful of a change that is yet, time will tell 😄
@farazsth98 that's a part of the solution. I usually decrease my requester limit if I can't fit another full train's worth of cargo into a buffer. So I can see in my head a scenario where you have, let's say, a deficit of 2001, and a train carries 1000 of something. So your requester puts out a -2 signal, sets a limit to 2, and your depot schedules two trains. Then, the first train arrives, so we lower the request and the limit by 1, because we have a train in and we don't want a third train accidentally (somehow) going to this station. It starts unloading, and we reach a deficit of 1999. Now, our requester lowers the limit again, because we can't have another full train in, but we have already lowered our limit once before, and end up with a train limit of 0. But the second train that we've dispatched just finished loading at the provider station, and now it's stuck until that first train leaves the requester station and limit goes back up to 1. Now, you might say, let's not lower the limit based on incoming trains. I think it's not needed anyways because they are already counted towards the limit? However, there is still a problem. Imagine the same scenario. First train comes in, we add 1 to the global signal. But now our buffer space goes down to 1999, so we lower our negative signal as well. Now we have a deficit of -1 trains, but 2 trains incoming and/or stopped. We end up with a positive 1 on the wire, and this prevents another requester station of the same type from getting 1 train dispatched to it, because this positive 1 cancels out one negative one. Now that I write that, I realize that we can make sure that a total signal outputted by a requester station never goes above 0, which is a bit of circuits, but would prevent that scenario. Rubber ducking my problems right here in youtube commentary :) Yeah, I think your setup is fine, especially since you've updated it in the second video to be generic.
@@sergei2039 just a short point about how a train waiting at the provider will prevent it from dispatching to the next requester of the same resource: it shouldn't happen, because the train at the provider is just going to be waiting until a requester opens up, which should happen regardless of whether it's negative signal is cancelled out or not (since the buffer amount dictates train limit, not whether a negative signal is out in the network or not). Other than that, nice work on the multiple trains for the same requester setup!
@@farazsth98 I implemented in my design removing the demand based on the amount of trains inbound to both the provider and requester station. It works fine, there isn't a gap as the signal appears immediately. There is a small problem, however, I think you'd be interested in hearing this. There is a period of time while both stations report that the same train in this signal C. While train is leaving the 1st station, until it leaves the rail signal block in which the train stop is located, it is still counted as a stopped train in that station, but also counted as an inbound train to the 2nd. I solved it by removing 1 from my signal C if the rail signal behind the station is red and the signal immediately after it is yellow or red. I needed a noop combinator from the train station to delay the C signal by 1 tick, but with that, once the train starts heading to the 2nd station, it is immediately not counted anymore in the 1st station, and thus we don't get an extra phantom train. Hope my explanation was clear.
This will grab a random train, which can happen to be at some remote depo. Somewhat important LTN and such can find the closest train and can accepts orders when going back to depo. Configuring each combinator to react for the specific tick is very cumbersome. Good ideas here, but I wonder if there is a better way than a timer.
@@lchaos3741 This is a great point, and is something I hadn't considered this.. Honestly I've thought about it for a bit but it doesn't sound like it might be solvable in vanilla, since there is no way to specify "regions" or "train can only go X tiles out" or any limits like that.. For the counter thing, you are right, but I think there are a few potential ways (using a global counter that auto tracks how many depot stations are there + a memory cell setup at each depot stop that auto sets itself to the correct tick when it is placed down, for example) to automatically set the tick condition at each depot stop when they're placed down, so that problem is solvable with some effort (that I admittedly haven't put in yet). But yeah the remote depot thing is a problem.. I can't think of a way to fix this issue at all in vanilla, it might actually not be possible. Maybe someone smarter than me can find a solution though!
@@lchaos3741 Actually I have an idea. First, very remote depots only occur for specific resources, right? For example, you run out of nearby ore, so you need to go find a new ore patch and set up an outpost. It could potentially be worth it to set up one (or a few) trains that only go back and forth between the ore patch and your smelting columns? These would not be part of the logistics train network, the trains would have their schedule set like this, and you would use circuits at the smelting columns to open and close the station depending on how much ore is in the buffer chests (that might not even be necessary). If for some reason (say a massive megabase) you do need a very remote factory, you could do this same thing? You have a station thats much closer to your base whose sole purpose is to stock up on the resource the remote factory provides, and you always ensure that it has a specific amount of that resource in a buffer chest. You set up dedicated trains to bring the resource closer to your base, and then make this closer station part of your logistics network? What do you think?
I love the new interrupting system. Your soultion is so much more flexibel! Btw. what Mod are you using for this Sandbox-style environment? seems like an ideal place to brainstorm some blueprints! Thx in advance!
Hey! Thanks for the kind words! The sandbox environment is a scenario introduced by the Editor Extensions mod. Once you download it, start a new world and it'll be an option under the scenarios list.
First of all - thank you for detailed explanation. And second - for a short period of time, when train leaving provider station the overall resource signal is greater by 1 (because both provider and requester station train count include this train). Do you plan to somehow fix this?
@@RadicalCrab It's difficult to fix this because it looks like an intended game mechanic, the provider station does not consider itself "empty" until the train has completely cleared the station, while the requester sees it as incoming instantly. I guess one way around it is to read the incoming train contents and use that as the "check" for when to start and stop providing the positive signal. I'll try play around with it and see if I can solve it in a nice way!
@@Black_ghost_off I've considered this, but unfortunately the train ID is not controllable, and the problem is that you need to wait at least 1 tick between active trains. For example, lets say on clock tick 5, one active train sees that there is a copper request and dispatches. If there is a train with ID 6 (and there is a provider station open) then on the very next tick (clock tick 6), that train will also dispatch, because on tick 6 is when the provider outputs the +1 resource signal. The train will require at least 1 more tick to realize that the +1 and -1 resource signals are cancelling each other out. As I understand it, a signal has to be in the network for at least 1 tick before it interacts with other signals (or at least its something like that).
@@Black_ghost_off I see yes that does work, but at least in my normal save, I have placed and deleted locomotives many times, and it seems like every time you place the locomotive, the unique ID goes up, so you can place the same locomotive and get, say, ID 63. Then delete this locomotive and place it again, and it will get ID 64 The problem is I have locomotives with ID starting at 30... So multiplying by 2 or 3 or etc will cause the "tick" between them to be too large, it will take too long to cycle to an active train. My current locomotive unique ID is at 70. Do you have a solution that might work in this case? You're making me consider something similar... I can use a constant combinator to assign a unique ID to each depot train stop instead? Maybe can even do it automatically using a counter so each depot automatically increases in ID, and then I can compare this ID with the clock? I have to experiment with this. Will see how well it goes!
Absolutely brilliant video, Im gonna use this for sure in my base :D The only small problem I see here is with the fueling station, because it might deadlock: If you set the train limit of both the refueller and the coal dropoff station to the amount of buffer slots + the train station itself (in your case the train station + 4 buffer slots) it might happen that 5 trains run out of fuel at around the same time and all go to the refuelling station. At that station every slot is now full, but the coal runs out before your first train is refueled then your coal provider has nowhere to go to drop off your coal. So shouldnt the train limits be train station + amount of buffer slots -1, or did I miss some condition that fixes this?
@@numberline8063 Hey, yeah you're right about that! I've modified this setup a while ago, but yeah I generally just continue to add more refuel stations when I create new depot stations, and didn't run into this condition even when the limit was set to 5 before. It might just be a rare circumstance but yeah you're right in that it can definitely happen. Appreciate the kind words!
Fantastic video, well done. I've implemented this system in my new city block playthrough to combat the amount of trains I had using no circuit control. I am currently running into an issue with fluid wagons, as I'm having fluid wagons showing up at item provider stations. My fix was to name all the fluid train stations specific as fluid stations, but with the interrupts my fluid trains are trying to go to a station named something like "*iron ore signal* Fluid Provider". I tried to go back through the video and see if this issue was addressed but I couldn't find it. Does this system work with fluid wagons? Thanks again, great work!
@@SinkDustinSink Thank you! Yes it does work with fluid wagons, you have to have a separate interrupt for fluids that only work with fluid stations (which are also named differently). For example, copper plate provider would be named " Provider", while a water provider would be named " Fluid Provider". Note the extra "Fluid" in the name, that's how you differentiate between the two station types. Fluid wagon trains would only get interrupts that then work with stations named " Fluid Provider". This way, fluid trains never show up to the item stations, and item trains never show up to fluid stations. Btw, the follow up video generalizes the interrupts even further, so would recommend that if you haven't watched it yet!
@@farazsth98 Just fyi (maybe a lil boost to the algorithm w/ more comments too lol) I figured out my issue: Had my fluid provider deciders set to less than instead of greater than from a silly copy/paste mistake (as well as other small things). Thanks again for the great video :)
It's not working if you have uneven number of loaders and unloaders (for example 2 loaders and 9 unloaders). Some trains always get "Destination is blocked"
@@a.m.7307 It works fine, are you getting "Destination is full" for the loaders? If so, that's normal, you have a train limit of 1 on your loaders and you're trying to feed 9 unloaders, which means 2 trains will go to the loaders while 7 will wait with "Destination is full" until the loaders are open. The solution is to add more loaders, or increase the train limit at the loaders (which requires a bit more circuitry to achieve).
This is amazing stuff! Have you thought about how it might be possible to have one station request multiple different resources? For example: I want both copper and iron plates in a station, request both until either is satisfied. I haven't been able to figure out how to dynamically request things from a specific station. For as far as I know it's not possible to dynamically change the name of the station without mods, which would be a requirement I think.
@@pindab0ter Yeah I think that's a limitation unfortunately. What I'm doing instead is to just add on two stations next to the existing one (I figured out it's possible to fit 3 on one side, if you look at my requester station layout). It's not as clean as LTN or Cybersyn, but yeah without mods I don't think it'll be possible.
Couldn't you just change the interrupt to add a Depo stop before going to the requester station that way it will go to the Depo and wait till a requester station is available.
@@urstaxfetish1206 Do you mean that trains will be waiting at depots with full cargo in them waiting for a request to come through? If so, the issue with that is that the trains can't predict what request will be coming through in the near future. Let's say for example you have 5 trains, and for one reason or another, the next 5 requests will all be for iron. How can you tell all 5 trains to go pick up iron and come back to the depot to wait? How do you prevent the trains from picking up copper, steel, green circuits, etc instead?
I'm very confused I've set it up and everything seems to work except the depot station. There is one station where the train will react on the interupt but that same train doesnt move when at any of the other 13 stations. All stations receive the correct signals I'm just very lost on why the train doesn't move on the other stations
@@larsbroekhof8049 Have you made sure that depot train stops themselves are connected to the pulsating decider combinators? The train stops transmit the signal to the trains so if they aren't connected, the train won't be getting the signal. You can click the train stop and hover the red or green number on the top right to see what signals that stop is getting.
@larsbroekhof8049 What about your trains? They're all set to automatic with the interrupts appropriately? you should be able to set the pulsing O signal in the interrupt screen when the train is stopped like in the video, for example
@@larsbroekhof8049 Additionally, could you try going through each interrupt condition, and checking why they may not be being met when you expect them to? For example, can you double check that the provider station is open, requester is open, the train stop name are correct, train interrupt screen shows it receiving the O1 signal, etc?
What actually is the point of such a system compared to the goods dedicated trains running on a schedule? Only thing I can think of is either this or loitering to conserve fuel: you have 5 trains you need 3.5 to move all smelted plates consistently you need 1.5 trains to move all plastic consistently so instead of using 6 trains, I can use 5 instead?
@@crystalcastleyoshi It's just an exercise in minimizing the amount of trains you need in your train network, that's about it. The good old dedicated train system still works just fine even for megabases, so there's no reason to design or use such a system other than for the experience.
@@Liwet. Yes! I made a follow up video with that improvement made. This video was more made to demonstrate the concepts so that they're easier to grasp for players new to the circuit network.
uuhm make train groups. that way you dont have to manualy input the interupts the interupts will be the same to the whole group. hehe the rest of the tutorial was preaty good. i needed the clock information to make my interupts work so thx for that XD i could not figure that out.
@@hayzersolar If you download the zip file, and then put it in %appdata%/Factorio/saves, you can load it up as a save game in game. I haven't provided any blueprints here, you can find some station blueprints in a pinned comment on the follow up video though!
Isn't this way too much complicated? I would rather turn off station where it's unable to fulfill its role (load full train/unload whole train). Also, every station has hard limit of 1 incoming train. In my case, I use this interrupt setup: Condition: Ore Provider is not occupied Targets: Ore Provider - 3s Inactivity Ore Requester - Train is empty From my testing, I see trains driving smoothly, only sometimes there's train waiting on Ore Provider (which I don't understand as bad thing - when Ore Requester gets free, full train is prepared to deliver...
@@jigorkij Sure it's more complex than a simpler system, but it allows each train to do more than one thing. In fact, I use dedicated trains without interrupts to move ore to smelters, because ore usually comes from very far away, and I don't want the depot trains to have to travel long distances just to move some ore, so having a dedicated train for that works well. However, when it comes to the intermediate resources, they usually need to be transported to multiple locations, and your system will need 1 train per resource type per factory. My goal here was to prevent the need for 1 train for every resource type for every station. Think about it like this for example: Your green circuit factory is a provider that will have at least 3 requesters - your mall, red circuit factory, and blue circuit factory. In your example, each of the 3 requester factories will need 1 train setup to go to the green circuit provider and back when necessary. Why? Because if you only have 1 train thats going between green circuit provider and all 3 (or more) requesters, if all three requesters request at the same time, it will become very slow as the train has to go back and forth 3 times. However, with this generic setup, the trains aren't connected to factories. A train that just supplied steel to the mall can be used to supply green circuit to the red circuit factory, etc. In this case, you can do with less trains overall, as every train is capable of handling every request, rather than then waiting at a certain provider station with full cargo ready to go to only specific requesters. This is the reason LTN was so popular, it allows you to have less trains, and less downtime for those trains. My goal was to build a system to do that in vanilla.
@@farazsth98 If I may take some more of your time, I would love to hear your insight 🙂 "In your example, each of the 3 requester factories will need 1 train setup to go to the green circuit provider and back when necessary. Why? Because if you only have 1 train thats going between green circuit provider and all 3 (or more) requesters, if all three requesters request at the same time, it will become very slow as the train has to go back and forth 3 times." First thing, all three requesters would be named "(icon: Green Circuits) requester". I would handle whole situation by adding one simple interrupt: Condition: (Green Circuit) Provider is not occupied Targets: (Green Circuit) Provider - 3s Inactivity (Green Circuit) Requester - Train is empty When GC Provider is able to satisfy one train, system will dispatch train to load cargo. Train then continues to free requester or occupies Provider until respective Requester is free (where I see only disadvantage as you would have lot of trains waiting for free requesters, but in that case I suppose "your" train network is just lacking sufficient amount of trains). If train is able to leave the station and station is able to load another train, logic will send it immediately. Also, icon in the name can be substitute by Item Parameter, so same interrupt will handle both ores and circuits (and more, depending on setup). This way, I would expect whole train group would be able to handle any items and you would need separate setup just for another train setup (liquid train for example).
@@jigorkij Yep, so your system works, I don't doubt that haha, it definitely works and does what you want it to do. The aim of my system was to minimize the amount of trains needed to sufficiently transport resources as needed through the network. In your example with your setup, there's two inefficiencies: 1. The train that goes to the GC provider and waits for a requester to be free is a bit inefficient. It could be fulfilling other requests in the meantime instead of waiting with a full cargo. Additionally, this means you will need more trains on the network to alleviate this. 2. Since your train station has a hard limit of 1, if you only have one GC provider, other trains cannot also come to the station to fill up ahead of time. This means if one train is waiting at the provider, and suddenly three GC requesters become free, two other trains need to come to the provider one at a time (due to train limit of 1) to fill up and leave. The 2nd point can definitely be alleviated in your setup by using a depot station in between provider and requester, and higher than 1 train limits so other trains can come and wait in line on stackers at the provider station. However, with point 1, there is no good solution. Even if you use the item parameters to make the trains generically choose which provider station to go to, at the end you will be "locking in" specific trains for specific provider stations, even though there is a real chance that the incoming future requests will not be for those resources. For this reason, you will want at least 1 train per request station per resource, in order to make sure there's enough trains to always fulfill any request that comes in. That is going to be a lot of trains, especially in a big base. That was the main thing I wanted to prevent with this system. I know it's really complex, but I wanted to be able to have the trains fulfill any request only when the request comes in. I don't want trains to be full with a resource if there is no request for it, because then the train is flexible and can only fill with resources to fulfill requests when it's needed. Essentially because not all factories run at the same speed, and with large buffers of resources at factories, it ends up needing less trains to achieve maximum throughput of trains transporting resources through the factory. Again, I just want to clarify, your system is perfectly fine and it works well, I just like to min max the setup 😄
@@farazsth98My aim is also not to say "your system is bad and complicated", I am more interested in your insight. Which I have received, so thanks for your time :-)
@@pahtriac Haha my apologies, I actually tried to go slow 😅 in fact some people have commented about me going too slow! But thankfully those comments are not the majority so hopefully even though I wasn't slow enough for some people, I hope it's still useful to you all!
hay, thanks for video. it was very usefull, however for me, as advanced logic user, there was too much talking. whant to share one tip: you may use some kind if fluffy or dense sock as popfilter for sound. it will increase quality of sound significant. it's wery annoying to constantly hear those phf pfhs pfh. wish you a luck for youtuber career ^-^
@@mutniytip2000 Omg what... I'm going to add a disclaimer in the description but, does it break factorio entirely? It could be due to the Editor Extensions mod maybe? You can try downloading the mod manually and putting it in the factorio directory manually and restarting factorio? I'm not sure
In this video the guy creates a simple circuit, where the trains go automatically at the stations, it looks fantastic th-cam.com/video/HptQwEEiEeY/w-d-xo.html
Dude you were doing great until about 3/4 of the way through then you went on steroids... When you expand the depot and made it modular... did you set them all to 0:60 or each one you added you changed the pattern cycle. EG. 0:60,60:120,120:180,180:240,240:300 or did they all just get made to be 0:60? i saw you set 4 unique ones then you just went apeshit and lost me. lol please make an entire depot and then blueprint it for us. lol I learn best by reverse engineering. lol
@@dalastjedi1768 Ah I thought I showed all the depots haha, they're all different, so 0:60, 61:120, 121:180, etc. However, in reality a whole second of cycling between trains is not ideal, so what you can instead do is just have a "K == 2", "K == 4", "K == 6", etc, essentially cycling between trains every 2 ticks. It works the same, but is just much faster. I can do up a blueprint, let me know if you really need one after reading this comment!
@@farazsth98 Please do. I can reverse engineer just about anything but putting 2 brain cells together to try to create a circuit just ends up in failure. lol
@@dalastjedi1768 Here you go, this contains all the blueprints that I'm currently using in my save. The only thing it doesn't contain is the train interrupt, which is not blueprintable, so you kind of have to just copy it over from the video. Please also see the comment in the gist as well! gist.github.com/farazsth98/2c2f378e429696b2c91313bdd9e24e4f
Your explanation would be better if you wouldn't be unsure about your explanation being bad, while explaining it. Why use many word, when few word do trick. Can still add the disclaimer to rewatch or ask after the explanation.
Follow up video with some improvements, courtesy of all of you guys here and on reddit!
th-cam.com/video/rRGAVDndFwk/w-d-xo.htmlsi=rGfTeUhN2vdSEUI1
Quick tip regarding the global circuit signals. You can hook the circuits into a radar, and it will transmit the circuit signals globally to every other radar. In case you want to do this without the city blocks.
You dropped this 👑
the only issue is radars suck with megabases so
@@CoreStarter just place 1 on every deposit or so?
I was thinking the same! Hook it up to a radar and it will be broadcasted to other radars then connect it to depot stations
@@ScorpioneOrzionyes, I personally place one in each depot group then connect each station in that particular depot to that radar. Preferably through electric pole for easier debugging
What are the chances that your last video was 2 years ago and now you release this brilliant factorio tutorial right when I'm searching for it? Thank you so much, this was a great video with really understandable examples and explanations.
OMG, man, I am just in the same situation too
This video made me realize why the wait 5 secs condition in LTN exists. Great video and i'm going to see if I can implement that 5 sec wait time for the depots.
So you simply explained how to implement Threading and task scheduling. I just love how factorio teaches you how software engineering works 😊
Can say the same thing for electrical engineering. Factorio is awesome!
Thanks for a great tutorial!
Here are couple of things to look at:
1. It looks like that it's possible that a train of 1 wagon will go to the station that requires 4 wagons (or you have to setup different interrupts for trains of different sizes). So, in the scenario of multiple train sizes, actually all the trains must be of the same size, only size of stations will differ.
2. Instead of detecting when train is full in a circuit condition inside the train, it seems more convinient to setup the same circuit condition in all the interrupts (smth like F > 0) and set up the combinator logic to check when the train is full on the station. This way, the station decides when the trains leave, not the train.
3. You can use the new parametrised blueprints to calculate capacity of trains and stations - this way once you place a blueprint, it will ask the user to choose the item and the constants will be calculated automatically
Love the way you clearly explain things, I usually walk away from logistics video more confused than I started, but your explaination is perfect, thank you!
@@Jcastria_ Thank you for the kind words! I appreciate it a lot!
Perfect! This was exactly what I was looking for. I was having trouble finding the right signal to listen to when dispatching trains, to avoid sending multiple trains.
Edit: 1 tick timers don't work, use 2 tick ones, a.k.a one combinator has "== 1" condition, second one has "== 3", then "== 5", and so on. If you use odd numbers like me, ensure the clock's max tick is also always 1 higher than the highest depot station value, so that when the clock resets, there is a tick gap between the highest and lowest depot stations.
With that, 300 trains will cycle through in 10 seconds.
+++++++++++++++
One more thing: I used a one second timer for cycling between active trains, but realistically you should be able to achieve it with a 1 tick or 2 tick timer, which lets you cycle through 60 trains a second.
For large megabases that have hundreds of trains, this will allow you to cycle through 600 trains within 10 seconds.
The only downside is having to set up the decider combinators manually for each depot station. You have to keep track of what the last decider combinator conditions were set to so you can set new ones appropriately.
I'll leave it to you guys to figure out a good way to do that :D
Slow down the clock by dividing the clock time by 4 or 3 and outputting the result. Then train IDs can be in sequence 1,2,3,4,5.. etc
This is the guide I have been looking for! Ive been wanting to finally set up my first City Block factory and I wondered how much more possible it was in Space Age / 2.0. Thank You!
Just as a point of clarification - I used hardcoded train limits of 1 for demonstration purposes on the provider stations.
As long as you have stackers at the provider stations, you can increase the limit to a maximum of however many trains can wait at the station at a given time.
Then, as long as you take the train count (C signal in the video) and output a corresponding amount of positive signals, the trains will cancel out the correct amount of negative resource signals on the global network.
This allows multiple requesters to be serviced by a single provider, which improves throughput overall as providers generally are supposed to service multiple requesters each before you need to add more providers.
You don't need a combinator to activate a train. You could just divide the counter by the delay you want, and write a condition in each train and check if the current pulse is equal to that train's specific value. Set the reset value to the number of trains multiplied by delay and that's it. Easy to expand indefinitely, with as many depots as you want, though require a bit of manual labor numerating each train, but you'd have to do the same with combinators anyway. Or, if you want to ensure that there's some delay between activations, you could assign train values by 2. And the counter also by 2, so by train number, by delay and by 2. So, the counter, will send signal 1, 2, 3, 4, 5, 6, 7, 8 each once per second (if divider is 60), then your first train's value is 1, second's train value is 3, etc. Or slightly more elaborate timer that does something like 1 for 10 ticks, 2 for 1 tick, 3 for 10 ticks, 4 for 1 tick and so on, so with only 1 delay between each even tick. Anyway, the idea is - you don't have to have any combinators beside the clock generator.
Upd.: I ended up with a circuit that just sends the train number for 8 ticks and then 0 for 2 ticks. So, 1 (8t), 0 (2t), 2(8t), 0(2t), 3(8t), 0(2t) etc, so I just numerate trains incrementally, instead of all even or all odd. The circuitry isn't that hard. Also, I read random request from the global line and send it to depot, so trains can process requests randomly, instead of every one going to whatever request having the highest demand, as that might oversaturate that request while leaving other requests starving.
Very nice of you to show the whole evolution of the system and not just the final state. +1
Oh this is awesome. I honestly didn’t think of using interrupts on this way. I’m gonna do that when I get home tomorrow hehe
This is a fantastic resource for the new interrupts I’d only managed to figure out a refueling method with it before.
Thanks for this. I've fiddled with this by myself and was lacking some insights which I've gained from this video.
Funny I stumbled upon this. When I first understood interrupts this was precisely one of the ideas I had.
Great video. Thank you for walking through the logic. When it is built rather than just shown the info is much better retained for me. Cheers!
I think you could have described a little better why the resource numbers going into the network were negative rather than positive.
Really well done though.
I had a blast reading all the FFFs about trains and having them for real is even more insane and amazing, can't wait for all the videos that are coming just like this one!
Btw i feel like it can all be simpler because the interrupts were specifically designed with wildcard signals, lots of conditions and genericness. I don't fully understand here the difference between your system and the intended simpler way in terms of what effect it has on the trains, but if you just wanted to do something cool i respect it!
Great explanation! You’ve inspired me to implement such design as you proposed in my game.
However, I consider using selector combinator to make interrupts more abstract from items. I think, we can add signal condition to trains “number of active routes need to serve” instead of each condition for provider/requester stations separately. Active routes to “serve” is min(active providers, active requests)
Oh interesting! Could you clarify this a bit further? Sounds like it allows you to have a single interrupt for every provider -> requester loop?
@@farazsth98 That sounds like an awesome addition to this great idea of yours 😊
@@farazsth98 In the menu where you select an icon for your interrupt name, there is a section with a box and a "?" symbol on it. In it, there are multiple variable parameters that can be used in such way. I believe that using signal parameter in place of a regular resource icon accomplishes just that allowing you to have a single interrupt rule covering all of the possible resources. I'm not sure that even any other changes are needed, changing just that in your save file made all trains work the same way as with multiple interrupts. Which makes sense, since it's basically the same thing as you were doing for each resource manually, but instead the game logic dynamically plugs in the requested resource icon when needed.
@@farazsth98 I think this guy did sort of this:
th-cam.com/video/ZoEOg0GisiI/w-d-xo.html&ab_channel=DocJade
However, his solution is pretty hard to edit and customize for yourself. So I think to use his design of "generic trains" and "item random selector" in your layout as its straightforward enough.
@@skullcrabster thats really awesome, dude. I thought really hard how they are doing parametrized provider/requester station. Now everything is so clear due to you!!!
it was awesome when you said have a good day or night bc it's 00:59am at the moment
this guy's kinda nice wit it
Excellent tutorial, thank you!
Thank you for the video, it was extremely helpful!
This is eeriely similar to a design I had (nearly) complete in 1.0. I had supplier stations requisition empty trains that then sat at depos waiting for requests. Each item type was only allowed a set number of filled trains at a time. The pros were fast request fulfilment, the cons were massive amounts of combinators at each station, and huge train yards that each had a "logic hub" of a huge amount of combinators handling timing and request dispatching.....I'll recreate in SA some day, and maybe make a vid too!
Great vid!
Btw, it's not a big deal, but since the refuel station shares the way to it with the coal requester station, you could have up to 6 trains going to that block, not 5. Refuels should be fast anyways, but there could be a short jamming sometimes. The new rails should help adding extra lanes on the same space, though, so it should be easy to fix (if you don't want to lower the train limit).
You explain perfectly!
That is beautiful.
what a great video, thank you for the tutorial
damn! best tutorial!
this just helped me a lot!
Cool video! And you can make every depot station broadcasts D1 and the clock counts how many depots to know when to cycle back to zero.
You should consider being a teacher. Superb explanation.
Hello!
I tried to dl your save file and Factorio said it may have been an older file. Maybe it's just from the hotfixes but it is functional so far. Thanks for the good work!
@@ZergYinYang Yes there have been a few hotfixes since i made the save, but its nothing game breaking. Happy to hear it's working well!
I like having a signal for both how many requester stations are ready and how many providers are. It helps with setting up a dashboard to understand what is broken or deadlocked or backed up or missing.
@@mrpocock I used the green channel for both the requester signal, and the provider signal that cancels out the requester. You should be able to use the red channel for a dashboard, just need to set it up a bit differently so the two colors don't clash, that's all.
Can you create a single loop with a parametized interupt? And pick any material using your standart station names? Seems possible imo
Yes! It is possible, I made another video to showcase how you can do that. You'd need one interrupt for items, and one interrupt for fluids, but its possible! 😄
genius
The only issue I see with this system is when you start plopping depots down all over your map, you'll start quickly having 100, 200+ stations. Even if you change the clock to 15 ticks, 4 per second, we're still talking 50 seconds until the last depot gets another chance to run again. That's a long time for an entire area of the map to have downtime.
Could the tick maybe go down to like... 1? The logic would still update fast enough, no? Say odds buffer, evens run. Set O = 1 when K = 2, 4, 6, 8, 10, etc. This would allow for 30 stations to update per second, and at worst you'll be waiting 6.6 seconds for the 200th station.
Still doesn't really solve the issue of not selecting a "nearby" train, but I saw what you were saying in another comment to just make independent systems for far away resources.
Edit: Funny, you say almost exactly the same things in your follow up video, haha.
@@twelvethirtyfour Yes haha, I covered this in the follow up, I wish there was an easier way to dynamically edit TH-cam videos to make the follow up video more visible to viewers 😂
The provider could just add C count to the copper count as well, I think that's even more simple and it would also work when you have a train limit of more than 1.
@@daniel29263 Yep! I've implemented this, but haven't made a video about it. If you take a look at the pinned comment in my follow up video, I linked a blueprint book that contains a provider station blueprint with this setup.
It requires a bit more logic than just naively using the C count, because you want to also be able to control the actual max train limit (otherwise you can have like 7 or 8 train limit, which is a lot), but yeah it does work.
Funny you've come up with a very similar system to my own except I haven't used signals, just interrupts. I fear signals in this game so much, they just beg to add overcomplication and technical debt to my many factory inefficiencies 😂
There's nothing wrong with trains sleeping on loading stations. In fact I'd argue it's the optimal situation because when an unloading station opens up there is a train ready to fulfill.
@@northo9583 Sure, that's one way to look at it. However, this doesn't scale well, because you'll need to always ensure you have the same amount of trains as provider stations, and then you have to ensure that you have enough trains to cover the number of requests that come through.
Effectively, it forces each train to only fulfill requests for a specific resource type, even if you make them generic, as soon as a train shows up and starts sleeping at a provider station, that train is now locked into providing that specific resource until it fulfills a request.
Yes, as long as you have enough trains, it works out, but I personally prefer having the minimal amount of trains moving around, and only adding more as needed. Especially for megabases, it reduces the number of provider stations you'll need (assuming you don't have depots at that point and the trains are built to go back to providers and just wait there, you'll need enough stations for all the trains to wait at)
nice vid!
How does this handle further afield Requester stations, mixed with more central ones? Ive been playing with your save file, and if you put an additional copper plate requester station to the right of your coal provider, you can get a situation whereby this new station gets starved. The closer copper requester stations effectively 'stealing' the requests from en route trains. We can play with priority on that further out station, but unsure the effects of that over longer periods
@yourundoing12 I think if you run into that scenario, it means you have less trains than you should have. If the closer copper requester needs so much copper that -- by the time a train fills up at a provider for the farther requester, the closer one has already emptied out, you'll want the buffer at the closer one to be bigger, plus maybe you'll want to add another provider, along with a requester station near the closer one.
You're right in that this doesn't specify which train station the requester is, it just looks for the closest open station, but I haven't really run into this issue, as having enough stations + trains means the problem solves itself
Thnx for this clear explanation. One thing I can't figure out though...how can I increase the train limit of a provider/requester station? Is it a value I have to change or just turn off train limit and set it manualy? Thnx
@@dadillegaming1563 You have to add additional logic to the circuits in order to account for higher train limits. If you look at the pinned comment in my most recent video, I have some blueprints in there where the provider stations can accept higher train limits (I haven't implemented this for requesters yet, because I haven't needed it). Essentially, instead of sending a +1 signal when the train heads to the provider, you send a +C signal, where C is the number of incoming trains to the provider. That's the high level quick explanation but there's a bit more to it than that.
Hey guys, I have watched both Faith videos. I understand the clock solution for 1 Active Requestor and many Active Providers issue, but do you maybe have some other ideas on how to handle it without the clock?
I was banging my head on how to decrease the demand when a train was dispatched but didn't think to also use a C signal on the provider stations...
However, if you want to use a stacker on your stations (i.e. allow more than 1 train inbound), I think you may still end up in a situation where once a train arrives at a requester station and is unloading, demand drops by 2 instead of 1, because you'd reduce it once for a stopped train and once more for when a resource buffer fills up a bit (assuming you lower your train limit as your buffer space decreases), and end up with some trains stuck at provider station due to lowered train limit. But once the train leaves, it should be fine. It could be solved with another interrupt with an intermediate stop, but if this shunting yard is too far, your requester may schedule another train before the stuck one reaches the yard and can start trying to go to the requester, because it won't be counted for C. I think in the end a more complex solution would be needed for a completely clean operation.
As for doing multiple resources, you can use another clock and the new combinator to iterate over items on the wire and spread them out across trains, but maybe that's not needed at all.
@@sergei2039 I've only been using hard set limit of 1 at requesters, so I haven't ran into that issue yet. I have implemented the stackers at providers already though, and that's been working really well so far! It's just a bit more circuit logic to allow that to work (needed to ensure that the train limit on the provider doesn't exceed a max, because I don't necessarily want 6 trains to end up waiting at one provider if there are others that are free).
I also implemented some logic at providers to decrease their priority by 1 per incoming train. This allows trains to split up between providers evenly, rather than all of them going to the closest provider and stacking to fill it up before the others are used, although I'm not sure how impactful of a change that is yet, time will tell 😄
@farazsth98 that's a part of the solution. I usually decrease my requester limit if I can't fit another full train's worth of cargo into a buffer. So I can see in my head a scenario where you have, let's say, a deficit of 2001, and a train carries 1000 of something. So your requester puts out a -2 signal, sets a limit to 2, and your depot schedules two trains. Then, the first train arrives, so we lower the request and the limit by 1, because we have a train in and we don't want a third train accidentally (somehow) going to this station. It starts unloading, and we reach a deficit of 1999. Now, our requester lowers the limit again, because we can't have another full train in, but we have already lowered our limit once before, and end up with a train limit of 0. But the second train that we've dispatched just finished loading at the provider station, and now it's stuck until that first train leaves the requester station and limit goes back up to 1.
Now, you might say, let's not lower the limit based on incoming trains. I think it's not needed anyways because they are already counted towards the limit? However, there is still a problem. Imagine the same scenario. First train comes in, we add 1 to the global signal. But now our buffer space goes down to 1999, so we lower our negative signal as well. Now we have a deficit of -1 trains, but 2 trains incoming and/or stopped. We end up with a positive 1 on the wire, and this prevents another requester station of the same type from getting 1 train dispatched to it, because this positive 1 cancels out one negative one.
Now that I write that, I realize that we can make sure that a total signal outputted by a requester station never goes above 0, which is a bit of circuits, but would prevent that scenario. Rubber ducking my problems right here in youtube commentary :)
Yeah, I think your setup is fine, especially since you've updated it in the second video to be generic.
@@sergei2039 just a short point about how a train waiting at the provider will prevent it from dispatching to the next requester of the same resource: it shouldn't happen, because the train at the provider is just going to be waiting until a requester opens up, which should happen regardless of whether it's negative signal is cancelled out or not (since the buffer amount dictates train limit, not whether a negative signal is out in the network or not).
Other than that, nice work on the multiple trains for the same requester setup!
@@farazsth98 I implemented in my design removing the demand based on the amount of trains inbound to both the provider and requester station. It works fine, there isn't a gap as the signal appears immediately. There is a small problem, however, I think you'd be interested in hearing this.
There is a period of time while both stations report that the same train in this signal C. While train is leaving the 1st station, until it leaves the rail signal block in which the train stop is located, it is still counted as a stopped train in that station, but also counted as an inbound train to the 2nd. I solved it by removing 1 from my signal C if the rail signal behind the station is red and the signal immediately after it is yellow or red. I needed a noop combinator from the train station to delay the C signal by 1 tick, but with that, once the train starts heading to the 2nd station, it is immediately not counted anymore in the 1st station, and thus we don't get an extra phantom train. Hope my explanation was clear.
@@sergei2039 Huh... did you have a rail signal right next to where the train stop is?
Hey, have you tried to use the wildcard signals? I'm testing your setup without the clock and using those.
@@rafaelpereiradias2567 Hey, yes, they work very well! I have a follow up video going through that + some more improvements if you're curious
This will grab a random train, which can happen to be at some remote depo. Somewhat important LTN and such can find the closest train and can accepts orders when going back to depo. Configuring each combinator to react for the specific tick is very cumbersome. Good ideas here, but I wonder if there is a better way than a timer.
@@lchaos3741 This is a great point, and is something I hadn't considered this.. Honestly I've thought about it for a bit but it doesn't sound like it might be solvable in vanilla, since there is no way to specify "regions" or "train can only go X tiles out" or any limits like that..
For the counter thing, you are right, but I think there are a few potential ways (using a global counter that auto tracks how many depot stations are there + a memory cell setup at each depot stop that auto sets itself to the correct tick when it is placed down, for example) to automatically set the tick condition at each depot stop when they're placed down, so that problem is solvable with some effort (that I admittedly haven't put in yet).
But yeah the remote depot thing is a problem.. I can't think of a way to fix this issue at all in vanilla, it might actually not be possible. Maybe someone smarter than me can find a solution though!
@@lchaos3741 Actually I have an idea.
First, very remote depots only occur for specific resources, right? For example, you run out of nearby ore, so you need to go find a new ore patch and set up an outpost. It could potentially be worth it to set up one (or a few) trains that only go back and forth between the ore patch and your smelting columns? These would not be part of the logistics train network, the trains would have their schedule set like this, and you would use circuits at the smelting columns to open and close the station depending on how much ore is in the buffer chests (that might not even be necessary).
If for some reason (say a massive megabase) you do need a very remote factory, you could do this same thing? You have a station thats much closer to your base whose sole purpose is to stock up on the resource the remote factory provides, and you always ensure that it has a specific amount of that resource in a buffer chest. You set up dedicated trains to bring the resource closer to your base, and then make this closer station part of your logistics network?
What do you think?
I love the new interrupting system. Your soultion is so much more flexibel!
Btw. what Mod are you using for this Sandbox-style environment? seems like an ideal place to brainstorm some blueprints!
Thx in advance!
Hey! Thanks for the kind words!
The sandbox environment is a scenario introduced by the Editor Extensions mod. Once you download it, start a new world and it'll be an option under the scenarios list.
First of all - thank you for detailed explanation. And second - for a short period of time, when train leaving provider station the overall resource signal is greater by 1 (because both provider and requester station train count include this train). Do you plan to somehow fix this?
@@RadicalCrab It's difficult to fix this because it looks like an intended game mechanic, the provider station does not consider itself "empty" until the train has completely cleared the station, while the requester sees it as incoming instantly.
I guess one way around it is to read the incoming train contents and use that as the "check" for when to start and stop providing the positive signal. I'll try play around with it and see if I can solve it in a nice way!
You can use unique id of train to compare it with clock to allow them run into Provider if any resource
@@Black_ghost_off I've considered this, but unfortunately the train ID is not controllable, and the problem is that you need to wait at least 1 tick between active trains.
For example, lets say on clock tick 5, one active train sees that there is a copper request and dispatches. If there is a train with ID 6 (and there is a provider station open) then on the very next tick (clock tick 6), that train will also dispatch, because on tick 6 is when the provider outputs the +1 resource signal.
The train will require at least 1 more tick to realize that the +1 and -1 resource signals are cancelling each other out. As I understand it, a signal has to be in the network for at least 1 tick before it interacts with other signals (or at least its something like that).
If it was possible to cause train IDs to jump 1 number each time, then this would be an amazing solution though!
@@farazsth98 i test it. You can make some manipulation with id and compare it between id*3 and (id+1)*3 (3 it`s just for example in my case)
@@Black_ghost_off I see yes that does work, but at least in my normal save, I have placed and deleted locomotives many times, and it seems like every time you place the locomotive, the unique ID goes up, so you can place the same locomotive and get, say, ID 63. Then delete this locomotive and place it again, and it will get ID 64
The problem is I have locomotives with ID starting at 30... So multiplying by 2 or 3 or etc will cause the "tick" between them to be too large, it will take too long to cycle to an active train. My current locomotive unique ID is at 70. Do you have a solution that might work in this case?
You're making me consider something similar... I can use a constant combinator to assign a unique ID to each depot train stop instead? Maybe can even do it automatically using a counter so each depot automatically increases in ID, and then I can compare this ID with the clock?
I have to experiment with this. Will see how well it goes!
@@farazsth98 hmmm... I far away from PC. But, maybe stations have id?
"Hardcode" id create problems when we need to scale it.
Bro, I swear that was my idea
Absolutely brilliant video, Im gonna use this for sure in my base :D The only small problem I see here is with the fueling station, because it might deadlock:
If you set the train limit of both the refueller and the coal dropoff station to the amount of buffer slots + the train station itself (in your case the train station + 4 buffer slots) it might happen that 5 trains run out of fuel at around the same time and all go to the refuelling station. At that station every slot is now full, but the coal runs out before your first train is refueled then your coal provider has nowhere to go to drop off your coal. So shouldnt the train limits be train station + amount of buffer slots -1, or did I miss some condition that fixes this?
@@numberline8063 Hey, yeah you're right about that! I've modified this setup a while ago, but yeah I generally just continue to add more refuel stations when I create new depot stations, and didn't run into this condition even when the limit was set to 5 before. It might just be a rare circumstance but yeah you're right in that it can definitely happen.
Appreciate the kind words!
Fantastic video, well done. I've implemented this system in my new city block playthrough to combat the amount of trains I had using no circuit control. I am currently running into an issue with fluid wagons, as I'm having fluid wagons showing up at item provider stations. My fix was to name all the fluid train stations specific as fluid stations, but with the interrupts my fluid trains are trying to go to a station named something like "*iron ore signal* Fluid Provider". I tried to go back through the video and see if this issue was addressed but I couldn't find it. Does this system work with fluid wagons? Thanks again, great work!
@@SinkDustinSink Thank you! Yes it does work with fluid wagons, you have to have a separate interrupt for fluids that only work with fluid stations (which are also named differently).
For example, copper plate provider would be named " Provider", while a water provider would be named " Fluid Provider". Note the extra "Fluid" in the name, that's how you differentiate between the two station types.
Fluid wagon trains would only get interrupts that then work with stations named " Fluid Provider". This way, fluid trains never show up to the item stations, and item trains never show up to fluid stations.
Btw, the follow up video generalizes the interrupts even further, so would recommend that if you haven't watched it yet!
@ thanks so much for the reply
@@farazsth98 Just fyi (maybe a lil boost to the algorithm w/ more comments too lol) I figured out my issue: Had my fluid provider deciders set to less than instead of greater than from a silly copy/paste mistake (as well as other small things). Thanks again for the great video :)
It's not working if you have uneven number of loaders and unloaders (for example 2 loaders and 9 unloaders). Some trains always get "Destination is blocked"
@@a.m.7307 It works fine, are you getting "Destination is full" for the loaders? If so, that's normal, you have a train limit of 1 on your loaders and you're trying to feed 9 unloaders, which means 2 trains will go to the loaders while 7 will wait with "Destination is full" until the loaders are open.
The solution is to add more loaders, or increase the train limit at the loaders (which requires a bit more circuitry to achieve).
This is amazing stuff! Have you thought about how it might be possible to have one station request multiple different resources? For example: I want both copper and iron plates in a station, request both until either is satisfied. I haven't been able to figure out how to dynamically request things from a specific station.
For as far as I know it's not possible to dynamically change the name of the station without mods, which would be a requirement I think.
@@pindab0ter Yeah I think that's a limitation unfortunately. What I'm doing instead is to just add on two stations next to the existing one (I figured out it's possible to fit 3 on one side, if you look at my requester station layout).
It's not as clean as LTN or Cybersyn, but yeah without mods I don't think it'll be possible.
@@farazsth98 Thank you for your reply. Appreciate it! Again, very well done on both the setup and the videos!
Couldn't you just change the interrupt to add a Depo stop before going to the requester station that way it will go to the Depo and wait till a requester station is available.
@@urstaxfetish1206 Do you mean that trains will be waiting at depots with full cargo in them waiting for a request to come through?
If so, the issue with that is that the trains can't predict what request will be coming through in the near future. Let's say for example you have 5 trains, and for one reason or another, the next 5 requests will all be for iron. How can you tell all 5 trains to go pick up iron and come back to the depot to wait? How do you prevent the trains from picking up copper, steel, green circuits, etc instead?
I'm very confused I've set it up and everything seems to work except the depot station. There is one station where the train will react on the interupt but that same train doesnt move when at any of the other 13 stations. All stations receive the correct signals I'm just very lost on why the train doesn't move on the other stations
@@larsbroekhof8049 Have you made sure that depot train stops themselves are connected to the pulsating decider combinators? The train stops transmit the signal to the trains so if they aren't connected, the train won't be getting the signal. You can click the train stop and hover the red or green number on the top right to see what signals that stop is getting.
@@farazsth98all stations are receiving both the pulsing O signal and the -1 resource signal
@larsbroekhof8049 What about your trains? They're all set to automatic with the interrupts appropriately? you should be able to set the pulsing O signal in the interrupt screen when the train is stopped like in the video, for example
@@larsbroekhof8049 Additionally, could you try going through each interrupt condition, and checking why they may not be being met when you expect them to? For example, can you double check that the provider station is open, requester is open, the train stop name are correct, train interrupt screen shows it receiving the O1 signal, etc?
They all heve the same interupt with 0 in the interupt
What actually is the point of such a system compared to the goods dedicated trains running on a schedule? Only thing I can think of is either this or loitering to conserve fuel:
you have 5 trains
you need 3.5 to move all smelted plates consistently
you need 1.5 trains to move all plastic consistently
so instead of using 6 trains, I can use 5 instead?
@@crystalcastleyoshi It's just an exercise in minimizing the amount of trains you need in your train network, that's about it. The good old dedicated train system still works just fine even for megabases, so there's no reason to design or use such a system other than for the experience.
26:54 Couldn't you just have a K= amount? You only need 1 tick to trigger the train if all the other circuit conditions are correct.
@@Liwet. Yes! I made a follow up video with that improvement made. This video was more made to demonstrate the concepts so that they're easier to grasp for players new to the circuit network.
uuhm make train groups. that way you dont have to manualy input the interupts the interupts will be the same to the whole group.
hehe the rest of the tutorial was preaty good. i needed the clock information to make my interupts work so thx for that XD i could not figure that out.
Shouldn't your refueler only allow 4 trains? If 5 trains need fuel but the refueler is out of fuel, you'll lock everything up.
how do you get this in my game. the link is nothing but a file so not a blueprint.
@@hayzersolar If you download the zip file, and then put it in %appdata%/Factorio/saves, you can load it up as a save game in game.
I haven't provided any blueprints here, you can find some station blueprints in a pinned comment on the follow up video though!
@@farazsth98 thank you not to smart on this stuff.
How did you get this sandbox mode? Is it a mod?
@@PatrickKohan91 It's a scenario added by the Editor Extensions mod
Isn't this way too much complicated?
I would rather turn off station where it's unable to fulfill its role (load full train/unload whole train). Also, every station has hard limit of 1 incoming train.
In my case, I use this interrupt setup:
Condition:
Ore Provider is not occupied
Targets:
Ore Provider
- 3s Inactivity
Ore Requester
- Train is empty
From my testing, I see trains driving smoothly, only sometimes there's train waiting on Ore Provider (which I don't understand as bad thing - when Ore Requester gets free, full train is prepared to deliver...
@@jigorkij Sure it's more complex than a simpler system, but it allows each train to do more than one thing.
In fact, I use dedicated trains without interrupts to move ore to smelters, because ore usually comes from very far away, and I don't want the depot trains to have to travel long distances just to move some ore, so having a dedicated train for that works well.
However, when it comes to the intermediate resources, they usually need to be transported to multiple locations, and your system will need 1 train per resource type per factory.
My goal here was to prevent the need for 1 train for every resource type for every station. Think about it like this for example: Your green circuit factory is a provider that will have at least 3 requesters - your mall, red circuit factory, and blue circuit factory.
In your example, each of the 3 requester factories will need 1 train setup to go to the green circuit provider and back when necessary. Why? Because if you only have 1 train thats going between green circuit provider and all 3 (or more) requesters, if all three requesters request at the same time, it will become very slow as the train has to go back and forth 3 times.
However, with this generic setup, the trains aren't connected to factories. A train that just supplied steel to the mall can be used to supply green circuit to the red circuit factory, etc.
In this case, you can do with less trains overall, as every train is capable of handling every request, rather than then waiting at a certain provider station with full cargo ready to go to only specific requesters.
This is the reason LTN was so popular, it allows you to have less trains, and less downtime for those trains. My goal was to build a system to do that in vanilla.
Also, it's only the initial setup that's complicated. Once you do it and make the blueprints, you just set the blueprint down and it just works out.
@@farazsth98 If I may take some more of your time, I would love to hear your insight 🙂
"In your example, each of the 3 requester factories will need 1 train setup to go to the green circuit provider and back when necessary. Why? Because if you only have 1 train thats going between green circuit provider and all 3 (or more) requesters, if all three requesters request at the same time, it will become very slow as the train has to go back and forth 3 times."
First thing, all three requesters would be named "(icon: Green Circuits) requester". I would handle whole situation by adding one simple interrupt:
Condition:
(Green Circuit) Provider is not occupied
Targets:
(Green Circuit) Provider
- 3s Inactivity
(Green Circuit) Requester
- Train is empty
When GC Provider is able to satisfy one train, system will dispatch train to load cargo. Train then continues to free requester or occupies Provider until respective Requester is free (where I see only disadvantage as you would have lot of trains waiting for free requesters, but in that case I suppose "your" train network is just lacking sufficient amount of trains). If train is able to leave the station and station is able to load another train, logic will send it immediately.
Also, icon in the name can be substitute by Item Parameter, so same interrupt will handle both ores and circuits (and more, depending on setup). This way, I would expect whole train group would be able to handle any items and you would need separate setup just for another train setup (liquid train for example).
@@jigorkij Yep, so your system works, I don't doubt that haha, it definitely works and does what you want it to do.
The aim of my system was to minimize the amount of trains needed to sufficiently transport resources as needed through the network.
In your example with your setup, there's two inefficiencies:
1. The train that goes to the GC provider and waits for a requester to be free is a bit inefficient. It could be fulfilling other requests in the meantime instead of waiting with a full cargo. Additionally, this means you will need more trains on the network to alleviate this.
2. Since your train station has a hard limit of 1, if you only have one GC provider, other trains cannot also come to the station to fill up ahead of time. This means if one train is waiting at the provider, and suddenly three GC requesters become free, two other trains need to come to the provider one at a time (due to train limit of 1) to fill up and leave.
The 2nd point can definitely be alleviated in your setup by using a depot station in between provider and requester, and higher than 1 train limits so other trains can come and wait in line on stackers at the provider station.
However, with point 1, there is no good solution. Even if you use the item parameters to make the trains generically choose which provider station to go to, at the end you will be "locking in" specific trains for specific provider stations, even though there is a real chance that the incoming future requests will not be for those resources.
For this reason, you will want at least 1 train per request station per resource, in order to make sure there's enough trains to always fulfill any request that comes in. That is going to be a lot of trains, especially in a big base.
That was the main thing I wanted to prevent with this system. I know it's really complex, but I wanted to be able to have the trains fulfill any request only when the request comes in. I don't want trains to be full with a resource if there is no request for it, because then the train is flexible and can only fill with resources to fulfill requests when it's needed.
Essentially because not all factories run at the same speed, and with large buffers of resources at factories, it ends up needing less trains to achieve maximum throughput of trains transporting resources through the factory.
Again, I just want to clarify, your system is perfectly fine and it works well, I just like to min max the setup 😄
@@farazsth98My aim is also not to say "your system is bad and complicated", I am more interested in your insight.
Which I have received, so thanks for your time :-)
For some reason, LTN, is like, easier. Didn't need a 54 minute tutorial.
this video is best viewed @ 0.75 % speed... bloody h.... u eat accelerators for breakfast?
@@pahtriac Haha my apologies, I actually tried to go slow 😅 in fact some people have commented about me going too slow! But thankfully those comments are not the majority so hopefully even though I wasn't slow enough for some people, I hope it's still useful to you all!
@@farazsth98 it got me uptosnuff in absence of LTN..
hay, thanks for video. it was very usefull, however for me, as advanced logic user, there was too much talking.
whant to share one tip: you may use some kind if fluffy or dense sock as popfilter for sound. it will increase quality of sound significant. it's wery annoying to constantly hear those phf pfhs pfh.
wish you a luck for youtuber career ^-^
Bro your save breakes vanilla space age on linux! reinstall factorio and drop saves even in cloud does not help wtf
@@mutniytip2000 Omg what... I'm going to add a disclaimer in the description but, does it break factorio entirely?
It could be due to the Editor Extensions mod maybe? You can try downloading the mod manually and putting it in the factorio directory manually and restarting factorio? I'm not sure
@farazsth98 i fixed it by deleting everything related from pc
@@farazsth98 could you please make a blueprints? or i will do it tomorrow anyway
This video could have been 20 min if you just planned it a bit and didn't just go unscripted
In this video the guy creates a simple circuit, where the trains go automatically at the stations, it looks fantastic th-cam.com/video/HptQwEEiEeY/w-d-xo.html
Dude you were doing great until about 3/4 of the way through then you went on steroids...
When you expand the depot and made it modular... did you set them all to 0:60 or each one you added you changed the pattern cycle. EG. 0:60,60:120,120:180,180:240,240:300 or did they all just get made to be 0:60? i saw you set 4 unique ones then you just went apeshit and lost me. lol please make an entire depot and then blueprint it for us. lol
I learn best by reverse engineering. lol
@@dalastjedi1768 Ah I thought I showed all the depots haha, they're all different, so 0:60, 61:120, 121:180, etc.
However, in reality a whole second of cycling between trains is not ideal, so what you can instead do is just have a "K == 2", "K == 4", "K == 6", etc, essentially cycling between trains every 2 ticks. It works the same, but is just much faster.
I can do up a blueprint, let me know if you really need one after reading this comment!
@@farazsth98 Please do. I can reverse engineer just about anything but putting 2 brain cells together to try to create a circuit just ends up in failure. lol
@@dalastjedi1768 Here you go, this contains all the blueprints that I'm currently using in my save. The only thing it doesn't contain is the train interrupt, which is not blueprintable, so you kind of have to just copy it over from the video.
Please also see the comment in the gist as well!
gist.github.com/farazsth98/2c2f378e429696b2c91313bdd9e24e4f
Your explanation would be better if you wouldn't be unsure about your explanation being bad, while explaining it.
Why use many word, when few word do trick.
Can still add the disclaimer to rewatch or ask after the explanation.