Factorio

Factorio

View Stats:
zingo2 Jun 13, 2016 @ 6:46am
Smart Train Loader
Hello All!

Need some help setting up Smart train Loader in logistic circuit network.

http://steamcommunity.com/sharedfiles/filedetails/?id=703011395]

As you see each requester chest is set to 1k resource- totalling 48K.
Resources are brought in from Factory Complex with bots.

Requester chests and smart inserters are linked up with wire and a signal is crossed to a poll.

I want the inserters to load the whole train with 5000 resources disregarding any other conditions. Just a fixed amount and only when the train has been loaded 5000 units it can leave.

*) I want to set up multiple Train Loaders with this condition.

For now I have set Smart inserters to [Item]<[5000] But it only works partially. Sometimes the Loader fills each wagon with 5000 sometimes Whole train and sometimes it does nothing.

It can be done with combinator So Any smart people out there who might shed some light how to do it?

The idea is in future you can change that "5000" number to what you need.
Last edited by zingo2; Jun 13, 2016 @ 6:51am
< >
Showing 1-14 of 14 comments
AlexMBrennan Jun 13, 2016 @ 7:01am 
only when the train has been loaded 5000 units it can leave.
That's flat out impossible, you cannot change a train's timetable using circuit logic. 0.13 will probably make this easier.

For now I have set Smart inserters to [Item]<[5000] But it only works partially. Sometimes the Loader fills each wagon with 5000 sometimes Whole train and sometimes it does nothing.
The problem is that you cannot use the train's current cargo as a signal, so there is no way to work out how much more needs to be loaded. 0.13 will probably make this easier.

In theory it is possible to work around and get fairly close to what you want: Use combinators to toggle a flag when [item]>5000, and again when [item]=0. Switch on smart inserters loading the train after [item]>5000 until [item]=0, and switch on inserters refilling the crates when [item]=0 until [item]>5000.

You'll still be out by inserter capacity * n but it's near the the goal.
Last edited by AlexMBrennan; Jun 13, 2016 @ 7:02am
zingo2 Jun 13, 2016 @ 7:12am 
So use 2 combinators?

First combinator counts them to 5000
and second one activates smart inserters and counts them down to 0?

If i have 2 trains- each train is set for 15 sec(lets say) wouldnt it interfere with the second train?

Like load 1k for the first train- then it leaves- and start loading the second train where it left off?
AlexMBrennan Jun 13, 2016 @ 7:59am 
So use 2 combinators?
You need to build an SR latch https://forums.factorio.com/viewtopic.php?f=18&t=14556

If i have 2 trains- each train is set for 15 sec(lets say) wouldnt it interfere with the second train? Like load 1k for the first train- then it leaves- and start loading the second train where it left off?
Yes. Since we can't connect trains to the circuit network at all we need to make certain assumptions to get it to work at all - like, in this case, that you set the train timers to allow for the train to be fully loaded.
zingo2 Jun 13, 2016 @ 8:16am 
Is there another way? I know there is a mod that makes trains integrated in logistic circuit network but is this the only option for now?

Because Unloader works perfectly!

For example:

You have your refuel train aka. Coal train. You load it up to say 20k. Then in each station you set it ""[coal]"<10'000" and it will unload exactly 10'000 coal and move on. All done in 5 to 10 sec.

And you can change The Unloader just the way you like it.

Why it is so darn hard to make the LOADER....
Last edited by zingo2; Jun 13, 2016 @ 8:25am
zingo2 Jun 13, 2016 @ 12:26pm 
So Besides AlexMBrennan and the mod in factorio- noone has a better solution?

You can come to our server to test this out- by all means.

Come on- there must be a better way to do this
KatherineOfSky Jun 13, 2016 @ 12:38pm 
Well, you could wait for the 0.13 update -- I believe it will have the capacity to check train cargo values, and leave when full. (You could set cars to a limit to have 5k resources total).
zingo2 Jun 13, 2016 @ 12:54pm 
Tried that. The problem with that is if we change the 5k to something else you have to change values in wagons too. That means running and finding all trains. Which is tedious to say the least. Not only that the numbers on requester chests have to be chnaged as well- to make adjustments. Ehh Its a Nightmare in a big factory where you have multiple trains.

Hmm.
Last edited by zingo2; Jun 13, 2016 @ 12:55pm
KatherineOfSky Jun 13, 2016 @ 12:59pm 
Well, I'm curious why you need exact numbers? Why not just let the trains fill to capacity? (Or are they going to multiple unloading spots?

We dont know exactly what abilities we will have in 0.13. We may have the ability to read cargo contents, but we just have to see.
zingo2 Jun 13, 2016 @ 5:35pm 
I was this close to getting the smart mod train or logistic train mod but there is no guarantee 0.13 wont brake those mods. And if we integrate the mod in our railway network and if it brakes its a recipe for disaster.

Yes The Trains are heading to multiple destinations. Like there is a huge Green chip factory for example and thats making only green chips. Then trains come in in several loading stations- pick up certain amount and leave. Thats why that is not an option to fill them fully as that would starve other huge factories that are dependent on regular green chip supplies.

In the end We just limited Loader requester chests to 5 seconds train intake. Whilst far from perfect trains now deliver a minimum amount of resources to all destinations.
Last edited by zingo2; Jun 13, 2016 @ 5:36pm
luggage Jun 14, 2016 @ 6:02pm 
Why not move the checking a step back and limit the amount of material entering the chests to be loaded onto a single train to around 5000?

Note that there will be slight variance due to carry numbers ... since you have 48 chests, and 5000/48 = 104.17, but inserters will insert their load size, so if it is at max, it will be 5 items at a time, so you will (I am assuming) end up with 105 items in each chest in this instance.
Since you are using bots, you would need more space with the requestor chests feeding smart chests linked which count the amount of materials in all of them.

Material flow would be:

Flying Bots -> Requestor Chest -> Chest Inserter -> Smart Chest -> Train Inserter -> (Train)


Steps would go like:
1. Lock the train inserters to prevent loading a train. At the same time, unlock the chest inserters to load the smart chests.
2. When the amount of material in all the chests is > 5000, lock the chest inserters and unlock the train inserters.
3. When the amount of materials in the chest reaches 0, lock the train inserters and unlock the chest inserters.

Note that this assumes that you always have enough materials for 5,000 items to be loaded evenly across the train wagons. It also assumes that each train can hold the amount of items from the chests totally, else you end up with the next train carrying the leftovers.
You will need to ensure that your train delay can allow for it to arrive just after loading the smart chests has started, and stay until the smart chests have emptied themselves onto the train, else if the train leaves before loading the train has finished, it and the next train will end up with partial loads.

In any case, with 0.13 version, it should be easier, so it might pay to wait until that comes out and then adjust the solution to the new tools available.
Mazian Jun 14, 2016 @ 6:07pm 
Originally posted by luggage:
Why not move the checking a step back and limit the amount of material entering the chests to be loaded onto a single train to around 5000?

This works fine as long as you're guaranteed to always be able to offload 100% of the wagon at the destination, otherwise there is an input condition not accounted for in your logic and the system breaks.

I've been playing around with this. A lot.

I've also played around with trying to load multiple items from a single chest.

Or setting content filters so that you can only load certain items into the wagon.

But for now, there are just no satisfactory answers that I've been able to find... and as you say,

Originally posted by luggage:
In any case, with 0.13 version, it should be easier, so it might pay to wait until that comes out and then adjust the solution to the new tools available.

I plan to pick this topic up again post v0.13 and see if I can come up with something that would work better than what I've come up with so far.
zingo2 Jun 14, 2016 @ 8:24pm 
Thats right!

It was the very first solution I tried what luggage proposed.

And As Mazian said- it works until a point somewhere in the sytem there is 1% left in the wagon. Especially on a multiplayer server with multiple people common human errors do happen. Down the road its like domino and the whole system brakes as everything is linked together. First trains get uneven then supply demands dwindle and the next thing- Your wondering:

Why in the hell Im overproducing one thing and Im being starved at others.

Keep in mind guys- We are talking about Multiple "Specialized" factories here for example- steel, copper, blue, green, red, module, rocket etc production factories or Cells That require a constant number to be delivered(in a big map of course).

Also The system utilizes more than 40+ trains So thats why- the mod solution is very tempting But it would be nightmare to get it back if it brakes.

Im hoping v0.13 presents more "solutions" than problems in this matter.
Last edited by zingo2; Jun 14, 2016 @ 8:26pm
luggage Jun 15, 2016 @ 5:00am 
You could test when a train arrives by being able to grab a piece of fuel from the engine and place it in a chest (when chest is not empty, train has arrived). Then set a flag that a train is in the station, and a countdown timer for the delay that the train will stay in the station.

You can then do decisions as to whether load the train, load the train partially and stop and reset just before the train leaves, or not load the train at all.

Why are you trying to load a train with exactly X amount of items anyway? Perhaps there is a better solution by loading each train full of the same item, and limiting the number of items taken out from the train?
Mazian Jun 15, 2016 @ 5:02pm 
Originally posted by luggage:
You could test when a train arrives by being able to grab a piece of fuel from the engine and place it in a chest (when chest is not empty, train has arrived). Then set a flag that a train is in the station, and a countdown timer for the delay that the train will stay in the station.

This works if you configure all trains that arrive at the station to the exactly same settings but this allows for no variance in train behavior. Depending on your end goal, this is certainly viable, but it brings with it certain limitations in planning. If you can accept those limitations when you're good to go.

Originally posted by luggage:
Why are you trying to load a train with exactly X amount of items anyway? Perhaps there is a better solution by loading each train full of the same item, and limiting the number of items taken out from the train?

I think this is the best question.


For me, my end goal is to get my factories to the point where they can specifically request items, and have those items delivered in the quantity requested.

The whole point of that endeavor (for me) is to convert over from a Main Bus design-- where there are tons of items on the belt (Main Bus) that aren't being consumed, pollution generated simply to fill the main bus-- to a Just In Time production design. The motivation behind that is to improve maximize pollution control. (i.e., minimize pollution to only that which is required in order to meet the immediate needs, and no more.)
< >
Showing 1-14 of 14 comments
Per page: 1530 50

Date Posted: Jun 13, 2016 @ 6:46am
Posts: 14