Page 1 of 1

Trains: Add interrupt condition "Signal from trainstop"

Posted: Tue Oct 22, 2024 10:21 pm
by mrvn
TL;DR
Allow train interrupts to react to signals "send to train" on some remote station.
What ?
When a train is stopped at a train stop the train stop can send circuit signals to the train and the trains interrupts can react to those signals. This could be expanded to allow reacting to circuit signals from other stations. This could be limited to trains at stations, i.e. whenever a train is stopped at a station it receives the remote signals but not while underway. This would be like the radar transmitting signals wireless but using the station name as a channel. So interrupts tune into specific stations and don't get the signals all jumbled together.
Why ?
The new trigger mechanism is great for sending trains to refuel. Or for station producing multiple items to deliver one of the items to a station when enough of it has been produced to fill a train. Where it does not help is to call a train when a station lacks enough of an ingredient. The circuit signals generated at the destination station do not affect the train at the source station. So it can't trigger to train to drive to the destination that needs some goods.

This leaves two options:
1) send a trigger wire via red/green wire across the map or wireless via radar.

Problem here is that for example many stations will require iron plates. Sending an "iron plate" signal would not tell the smelter where to send the train. So one has to either use some other signals to mean "send iron plates to station X" for every combination of item and station used. Or use
some form of time sharing, have a clock that counts up to the number of unique stations and whenever the station signal is broadcast the station then sends signals for the items it needs. This is not easily build nor simple to expand over time.

2) use the train limits / enable station to signal when a station needs items

Problem here is that then the station can only receive one type of item. There is no way to signal weather a station wants iron plates or copper plates by enabling it.



The suggested method would allow for example a station that builds electronic circuits to "send to train" when it's buffer of iron plates or copper plates runs low. The train stationed at the iron ore smelter than adds an interrupt: Signal from trainstop 'electronic circuit': iron-plate > 0 and adds the electronic circuit station as new temporary target to deliver iron plates.

Signals should only be received from stations on the same surface for obvious reasons. Ideally signals should only be received from stations on the same rail network if possible (there doesn't have to be a path as determining that is expensive, just rails). But that would be easy for the user to work around if not feasable, if users even have multiple train networks on a single surface using this feature.

Re: Trains: Add interrupt condition "Signal from trainstop"

Posted: Wed Oct 23, 2024 1:55 am
by sarge945
You could probably achieve something similar by setting the resupply station to train limit 0 when it's fully supplied using the circuit network, but being able to work with signals would be cool

Re: Trains: Add interrupt condition "Signal from trainstop"

Posted: Wed Oct 23, 2024 6:17 am
by mrvn
sarge945 wrote: Wed Oct 23, 2024 1:55 am You could probably achieve something similar by setting the resupply station to train limit 0 when it's fully supplied using the circuit network, but being able to work with signals would be cool
No you can't. That is option 2 in the above and only works for station requesting one item. It's annoyingly limited.

Imagine building a train system for the rocket silo with this. You need one train station each for every item you want to ship to space. Just the basic buildings you have like 20 stations, items another 20-50. I don't think it's practical to build a train station setup for the rocket silo to ship whatever is demanded this way.

Re: Trains: Add interrupt condition "Signal from trainstop"

Posted: Wed Oct 23, 2024 6:58 am
by sarge945
I thought the rocket silo was given logistics anyway for this reason?

As for trains, can't you resupply it the same way you would resupply a wall?

https://factorio.com/blog/post/fff-382

I do agree that more curcuit conditions is good, though. Don't take this as me being antagonistic. I'm just trying to figure out the problem.

Re: Trains: Add interrupt condition "Signal from trainstop"

Posted: Wed Oct 23, 2024 12:54 pm
by mrvn
sarge945 wrote: Wed Oct 23, 2024 6:58 am I thought the rocket silo was given logistics anyway for this reason?

As for trains, can't you resupply it the same way you would resupply a wall?

https://factorio.com/blog/post/fff-382

I do agree that more curcuit conditions is good, though. Don't take this as me being antagonistic. I'm just trying to figure out the problem.
The logistics of the rocket silo as I understand it is for logistic bots. Not everyone builds their whole base as one giant logistic network.

The wall system works for the destination. It tells the destination station what to unload from a train to fill up it's cache of items. It does not tell the source what to load onto the train. The only way the wall system works is because everything the wall needs will fit into a single train that you always load with a mix of items. The individual wall stations then just unload the bits that are missing leaving most items in the train.

For factory stations you want bulk goods. A whole train of iron plates, or a full train of copper plates. You don't want a train that's half iron plates and half copper plates and then only unload half of it. That's wasteful and has low throughput. For the rocket silo the wall system would basically mean you only put one stack of each item into the train. That would be very low throughput for a train.