0.18, bus, orphan trains.

Post all other topics which do not belong to any other category.
Post Reply
Durentis
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Jun 27, 2016 3:55 pm
Contact:

0.18, bus, orphan trains.

Post by Durentis »

I wanted to see all the fancy new changes so I started over on a rail world and figured that, while I was at it, I might as well try to revisit some old problems and presumptions.

The polish that has gone into 0.18 is amazing. I'm loving the new assets and UX, though I fear for the beacons in some ways.

I remembered (too late?) that I needed to enable the research queue at at the beginning so that was annoying throughout - I missed that queue.

Fish are still awesome. Fish+Armour with Shotgun/Submachine -> Fish+Armour with grenades (for spawners and biters) and rockets (for worms) -> Fish+Armour with Destroyer capsules. I have forgotten how to laser turret. And who needs a tank when you have fish?

Have not been disappointed. Factorio is every bit as awesome as it was when I first started playing, so thanks for all the hard work on this!

My base is still only using about 1/3 of my 1.5GW of power, so it's pretty small yet and many things are still in design review, but I'll share a couple early lessons learned from this play-through and associated blueprints in the spoilers below. Thoughts and suggestions appreciated, as always.
The bus
Trains
Station blueprints and images

Serenity
Smart Inserter
Smart Inserter
Posts: 1000
Joined: Fri Apr 15, 2016 6:16 am
Contact:

Re: 0.18, bus, orphan trains.

Post by Serenity »

Nobody ever said that you have to run everything through the main bus. There are plenty of streamers who provide dedicated smelters for the circuit production, and route the green circuits for the red ones outside the bus. It doesn't necessarily start that way right from the beginning, but can develop as the need for circuits increases with the higher sciences

Durentis
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Jun 27, 2016 3:55 pm
Contact:

Re: 0.18, bus, orphan trains.

Post by Durentis »

Serenity wrote:
Sun Apr 05, 2020 11:42 am
Nobody ever said that you have to run everything through the main bus. There are plenty of streamers who provide dedicated smelters for the circuit production, and route the green circuits for the red ones outside the bus. It doesn't necessarily start that way right from the beginning, but can develop as the need for circuits increases with the higher sciences
Of course.. lots of people do things differently. Haven't actually watched a Factorio stream in a long time, but back then the bus was so prominent some would make widely spaced stone paths to help as much with lane count and spacing as with mobility through the base. Blocks of space would be reserved for a dozen furnace arrays to maybe eventually fill multiple lanes, which would have indicator belts for spacing but wouldn't be completed because they cost too much at the time and would stretch for miles, etc. I just realized that each time I come back for another round though that my bus tends to end up with fewer and fewer lanes, but the base functions better overall. Could also have something to do with the change in science recipes following a more ideal production path.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: 0.18, bus, orphan trains.

Post by vanatteveldt »

[... trains ...]

With vanilla there are some things that are difficult to do with trains without very elaborate circuit network structures, timers, and triggers. However, I'm pretty happy with my current setup with one-to-many and many-to-many connections.

1. Fuel

There is one place that produces fuel, in my case the refinery. There is one dedicated fuel train, which has orders [fuel load for 10s -> fuel unload until inactive]. Evey other subfactory has a fuel unload station, which is set to activate when fuel < X (e.g. 10 for nuclear fuel). From there fuel is distributed to each load or unload station, usually by bots but you can string belts if you dislike bots. Outposts don't have fuel, the trains fuel up at the smelter.

2. One-to-one trains

Train routes are trivial if you have one-to-one connections: Dedicate X trains to the route (I often choose 2 so one is always waiting), make sure there is a buffer of X-1 right behind the load and unload stations, and set routes to something like [load until full or 30s -> unload until empty].

3. One-to-many trains

This is complicated if you have multiple stations feeding or taking from one stations, e.g. green circuits to red circuits, blue circuits, mall, science, etc. If each plant has 2 trains, you now have 8 trains that can potentially visit the green circuit factory at the same time, so you would need 8-N stacker space, which is boring and a potential bottleneck.

My current setup is to have 1 buffer behind each loading* station. The station is set to deactivate if either the buffer is full or there are not enough resources to load, and there is a chain signal before the buffer so a third train is never stuck behind the buffer but can reroute.

This is complemented by a "stacker of last resort" inspired by / copied from this reddit post by /u/Kano96. This is a stacker with many places which leads to a dead-end rail with 10 dummy stations followed by all stations which are in a one-to-many situatution. The dead-end rail is permanently closed. What happens is this:

1- If there are actual loading stations open trains will prefer them as the dummy stations make the stacker really unattractive
2- If all real stations close (probably indicating a bottleneck) trains will reroute to the stacker. They will try to reach the unreachable station of last resort and wait at the chain signal before the permanently closed signal
3- As soon as a real station opens up it is more attractive and the train will reroute to the real station
Images
This has some potential inefficiencies: sometimes a train is stuck in a buffer while another stop is open somewhere else; and if a station opens up multiple trains leave from the stacker and some will reroute back to the stacker, causing unnecessary train trips. However, the first problem is generally OK as the train should prefer a station without a red signal. The second problem is also not too bad as there is some delay between trains leaving and there shouldn't be that many trains in the stacker anyway - it's not a stacker that every train goes through on every trip, it's only a parking spot if a train has nowhere to go because of a lack of supply (which is a problem) or demand (which is fine).

Theoretically the trains can run out of fuel circling around the stacker, but a full load of nuclear or rocket fuel takes a long time to burn, so I don't think it's a real problem.

If the stacker (with a single exit point) ever becomes a problem you can split the stacker and move e.g. stone and iron ore to one stacker and circuits and plastic to the other.

I like this setup because it is vanilla, the circuit logic is very manageable, and all wires are local - there is no global state, timers, etc.

4. many-to-many:

For e.g. many iron outposts to many smelters, simply close stations on both ends if there is no supply/demand, and either empty or full trains can go to the stacker. In my case I mine directly into the train, so the outposts are never closed.

Simply repeat the above wiht

michaeln
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Apr 10, 2020 1:07 am
Contact:

Re: 0.18, bus, orphan trains.

Post by michaeln »

So it seems like even with the one place buffer in front of loading stations you are subject to the Thundering Herd problem (lots of trains all head for one enabled station; one or two get there disabling it; rest of Herd charges off to next enabled station, probably on other side of map; rinse, repeat). If you can wire up a global circuit network you can probably release trains in a controlled way, but I don’t understand how to get a nice solution absent global circuits.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: 0.18, bus, orphan trains.

Post by vanatteveldt »

michaeln wrote:
Fri Apr 10, 2020 1:30 am
So it seems like even with the one place buffer in front of loading stations you are subject to the Thundering Herd problem (lots of trains all head for one enabled station; one or two get there disabling it; rest of Herd charges off to next enabled station, probably on other side of map; rinse, repeat). If you can wire up a global circuit network you can probably release trains in a controlled way, but I don’t understand how to get a nice solution absent global circuits.
No indeed, I don't think it is possible since if you have N identical trains, I don't see how to convince 1 train to go and the other N-1 not to go. At least the stacker has a single exit point, so the herd is paced at least a little bit.

The other thing mitigating is is that in normal use the stackers should not be used that much. You want enough trains to fill all stations + single station-buffers, and not too many more. Also, by placing multiple stackers close to the point of use, the time between the first train leaving the stacker and arriving at the station is limited. Trains should always go to the closest stacker if they have nowhere to go, so in principle should spread somewhat evenly depending on usage patterns.

Durentis
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Jun 27, 2016 3:55 pm
Contact:

Re: 0.18, bus, orphan trains.

Post by Durentis »

I have made a bit more progress on my base, which now has just over 4GW of available power, and I have noted a few more things.

Not a big fan of dummy stations, and I'm not sure they're needed now that trains will return to their unload stacker if loading stations are all disabled.

I don't recall trains ever skipping a station when it gets disabled though. This was awesome to see, as it means they go back to the unloader's stacker and wait for a loading station to open up. This effectively kills the orphan train problem, provided I don't have more trains scheduled for a loading station than it can support in its stacker.

Somewhat amusingly, I encountered the Thundering Herd problem again though with my early setup of these new stations. It doesn't seem to be too much of a problem for me currently, since they calmed down after I got more supply and some unloading stations backed up, but it may be down the road. My only real thought on this is to segregate rails and/or dedicate certain load-unload sets to minimize the amount of times trains trip over themselves. Don't necessarily need one big connected rail network anymore than I need one big connected bot network.

This new(?) "feature" of trains skipping disabled stations seems to have an odd bug/side-effect attached to them though. If I have 5 trains in a loading station's stacker with the first one draining the chests below a set threshold, the station will become disabled. Even if the station recovers and is re-enabled before the other trains pass the station, they will all leave and return to the unload station empty. Then they'll race for the loading station they just left and one will fill up, disabling the station, and forcing the other trains to return. They sorta looped for a while like this until I got another loading station set up and then settled down. It would be nice if they could re-check the station before passing through it and stop for their cargo.. I mean, they got the memo about it getting disabled, why not enabled?

Fuel is still a pain. I also just fuel at unload stations, because they tend to be more central, but this still means that I have a bot network that is far more extensive than I would like. I suspect that I will have to cave in and add a single-lane bidirectional track for a fuel provider train. Perhaps I can multi-purpose this train or make a similar one for any other items (ammo, repairs, etc) that may be needed at some point on the fringes of the base. Would still prefer a train condition that would have it suspend its schedule and go get its own fuel though.

The station I posted above has proven itself to be my favourite yet, in concept, but it is a serious pain getting belts out and the space savings by cutting the corners isn't that useful. So, as I suggested, I squared it up. This new version allows not just to easily get belts out in any of four directions but to easily extend the top or side to accept larger trains or a parallel (un)loading station within the surrounding serial stacker.

The logic to "convince 1 train to go and the other N-1 not to go" can be found in my orphan trains "solution" in my sig. The caveat is that it only works if you have the trains originating from a single central stacker. If you want to have multiple central stackers, it gets more complicated because you'd need something like a shift register to rotate between stackers that have trains ready to go. Without this, each stacker would release one train. Still better than all trains being released, but not what you're after. And I have to admit, other than setting up the prototype, I haven't used it in practice - just too annoying to set up for what it does. It may give you some ideas though or you can improve upon it. (I'll probably remove that link from my sig before long as the target seems to have moved somewhat.)

New squared station image and blueprint

Post Reply

Return to “General discussion”