How to request correct train at stations that accept multiple types of goods

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Roaders
Burner Inserter
Burner Inserter
Posts: 18
Joined: Mon Jan 15, 2024 1:33 pm
Contact:

How to request correct train at stations that accept multiple types of goods

Post by Roaders »

Hi All

I learning lots about factorio and have just finished setting up stations that calculate the train limit based on the number of goods in stock so that trains only visit these stations when there is enough to fill the train (and trains don't wait at nearly empty slow-producing mines). Pretty pleased with that but now onto the next challenge...

I want to setup remote defence installations. i.e. I have a mine that I want to set up an artillery gun at and have some defences. I want to have 1 station that can accept oil or ammunition or maybe logistics bots (what is being accepted doesn't really matter). How can I request that an oil train will go to my remote base when the oil gets low but an ammunition train doesn't?

Using my current knowledge the way I would set this up is I would have 2 train routes defined on a number of trains:
  • ammo factory -> holding area -> remote base -> holding area
  • oil refinery -> holding area -> remote base -> holding area
When oil for example got low I would set the train limit to 1. This would however request either an oil train or an ammo train that I don't want.

I have tried to do some research on this and have seen posts about using the logic network to control signals but I can't see how that would work...

I assume that I would get the id of the train that I wanted and only allow that train to pass the signals? How do I get the ID? what if I have 1 ammo train going to remote base 1 and I have an oil train going to remote base 2 - I would need to allow both at some signals and only 1 at other signals. How do I prevent the stopped trains from blocking the track for other trains??

I suspect that what I am trying to do might not be possible or easy without mods.

Any help much appreciated

SoShootMe
Filter Inserter
Filter Inserter
Posts: 476
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: How to request correct train at stations that accept multiple types of goods

Post by SoShootMe »

Roaders wrote:
Sun Jan 21, 2024 5:26 am
I want to have 1 station that can accept oil or ammunition or maybe logistics bots (what is being accepted doesn't really matter). How can I request that an oil train will go to my remote base when the oil gets low but an ammunition train doesn't?
The short answer is that you can't, at least not without mods. Alternative approaches (each with some hopefully obvious pros and cons) at the remote base include:
  • Use separate stops and (un)loading areas.
  • Use one (un)loading area and place separate (and separately controlled) stops right next to each other, with each train targeting one of them.
  • Use one (un)loading area and stop, served by trains that carry multiple different items/fluids.
I think the last is a common solution to resupply remote stations. Generally, the quantities of items needed per delivery are relatively low and I've found it works well. For fluids, barrelling may be useful by allowing a single wagon to hold both items and/or (multiple) fluids but it is more complex to set up than fluid wagons.
I assume that I would get the id of the train that I wanted and only allow that train to pass the signals? How do I get the ID?
I advise against this idea, for various reasons. The only time you can get the ID of a train onto the circuit network is at a train stop.

Roaders
Burner Inserter
Burner Inserter
Posts: 18
Joined: Mon Jan 15, 2024 1:33 pm
Contact:

Re: How to request correct train at stations that accept multiple types of goods

Post by Roaders »

Thanks. Pretty much as I thought then. I am sure there is a way - but too complicated and painful to implement!!! :)

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: How to request correct train at stations that accept multiple types of goods

Post by Qon »

SoShootMe wrote:
Sun Jan 21, 2024 7:14 am
The short answer is that you can't, at least not without mods.
True in the sense that it is highly unlikely that OP is able to. But it is technically possible with extraordinary effort.
Roaders wrote:
Sun Jan 21, 2024 8:01 am
Thanks. Pretty much as I thought then. I am sure there is a way - but too complicated and painful to implement!!! :)
It's not worth the effort unless implementing it is the goal itself and you have the technical ability.

SoShootMe
Filter Inserter
Filter Inserter
Posts: 476
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: How to request correct train at stations that accept multiple types of goods

Post by SoShootMe »

Qon wrote:
Sun Jan 21, 2024 9:44 am
SoShootMe wrote:
Sun Jan 21, 2024 7:14 am
The short answer is that you can't, at least not without mods.
True in the sense that it is highly unlikely that OP is able to.
I had something more fundamental in mind: at least without mods, you can't control which train will succeed in reserving a stop that "opens" when there is more than one train attempting to do so.

A slightly longer answer is that you can achieve a similar effect, for example by signaling via the circuit network so that only the train you want has its wait condition satisfied, but that is actually doing something different (controlling which train attempts to reserve the stop). I wouldn't describe this as "extraordinary effort" but I would say that it's not trivial, particularly compared to the alternatives I gave. That said, there are different ways to implement multi-item trains and they have a range of complexity.

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: How to request correct train at stations that accept multiple types of goods

Post by Qon »

SoShootMe wrote:
Sun Jan 21, 2024 1:59 pm
Qon wrote:
Sun Jan 21, 2024 9:44 am
SoShootMe wrote:
Sun Jan 21, 2024 7:14 am
Roaders wrote:
Sun Jan 21, 2024 5:26 am
I want to have 1 station that can accept oil or ammunition or maybe logistics bots (what is being accepted doesn't really matter). How can I request that an oil train will go to my remote base when the oil gets low but an ammunition train doesn't?
The short answer is that you can't, at least not without mods.
True in the sense that it is highly unlikely that OP is able to.
I had something more fundamental in mind: at least without mods, you can't control which train will succeed in reserving a stop that "opens" when there is more than one train attempting to do so.
I don't see any difference. The effect is the same. If you prevent the wrong train from attempting to reserve then isn't that a just technical point of intervention with no real difference? I suppose that the train might have been delayed by 1 tick from reserving another stop because the de-prioritization forced the train out of all reservation attempts, but I'm not sure this micro-optimization is relevant to the request of the topic and OP's question.
SoShootMe wrote:
Sun Jan 21, 2024 1:59 pm
A slightly longer answer is that you can achieve a similar effect, for example by signaling via the circuit network so that only the train you want has its wait condition satisfied, but that is actually doing something different (controlling which train attempts to reserve the stop). I wouldn't describe this as "extraordinary effort" but I would say that it's not trivial, particularly compared to the alternatives I gave. That said, there are different ways to implement multi-item trains and they have a range of complexity.
Your suggested solution is a good one which I agree wouldn't deserve the classification "extraordinary effort". I had in mind complete dynamic scheduling and maybe pathfinding with vanilla combinator circuits. Which is overkill and not actually the most helpful direction for OP to pursue. But my point about mods not technically being necessary stands.

computeraddict
Fast Inserter
Fast Inserter
Posts: 111
Joined: Sat Oct 07, 2023 6:44 am
Contact:

Re: How to request correct train at stations that accept multiple types of goods

Post by computeraddict »

You can also do the trick of one station right after another for up to three stations and control them with local circuits. There will be four tiles of overlap between the cars of each with two stations and two tiles of overlap with three. It's a bit jank but doesn't require global circuits or mods.

Tertius
Filter Inserter
Filter Inserter
Posts: 671
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: How to request correct train at stations that accept multiple types of goods

Post by Tertius »

I do have different types of dedicated trains and dedicated train stations, but one train will always load the same stuff. Loading different items into the same train depending on circumstances is a difficult challenge without mods, I don't do that at all. My trains have dedicated purpose and will always carry the same things. This is what I assume was envisioned by the devs and seems to work best with the features provided by vanilla Factorio.

- ore trains only carry their ore
- supply trains carry an assorted set of goods to support remote areas. They always load the same assortment at the base, but in the field, what to unload is specified by the unloading station configuration
- I also have an artillery train I use when I uncover new areas. It has one loading station near the mall. To use it, I first build an artillery outpost in the wild, which is actually just a train station fortified with walls and a whole lot of laser turrets. When the station is ready and connected, it pulls in the artillery train which has 3 artillery wagons and one wagon of supply (repair kits, bots and so on to keep the outpost healthy in battle). When the train arrives, it shoots down everything around it. If the area is clear, I deconstruct and move the outpost one artillery range further into the direction of exploration. If I explore external areas, I then fence in the cleaned areas.

The whole base is enclosed by a wall armed with laser turrets and stationary artillery. The whole factory is one gigantic rectangle. Nothing is outside, everything is inside, even the mines. Regular supply trains supply the walls with repair kits and artillery shells and every item used in that wall, so destroyed entities can be automatically replaced by bots. The wall is divided into sections, every section has one artillery turret and one supply station and consists of one logistic network to maintain itself.

The most easy train stuff is the ore trains. Every ore has its number of mining stations, unloading stations, depots etc. dedicated for only its material. The same with intermediate material. An iron ore train will always carry iron ore from mine to smelters, nothing else. I don't raise the train limit of mining stations from 0 to 1 or more if there is enough material any more. Instead, I have a constant train limit of 1. I fill every mining station with a train, so if there is enough material mined, it's already loaded in the train and ready to ship. No need to "request" a train, which needs time to drive to the station, then more time to load. This approach creates a different challenge: it needs to find the correct amount of trains and the correct amount of waiting area and depot space, so trains can leave stations to free them for the next train.

So my mechanics to "request" a train is only if there is demand for a supply station if its stored supply gets low. This works by setting the train limit to 0 if the station is full and 1 if its material gets low.

Post Reply

Return to “Gameplay Help”