Page 1 of 1

[1.1.67] Train on auto won't refuel even if in range

Posted: Mon Aug 22, 2022 11:56 pm
by SpoonUnit
What happened.

Received a warning that train was out of fuel. Notification takes me straight to the train, and I thought 'that's odd', as at first sight it appeared to be in the station. I then realised it wasn't quite in the station. The reason the train ran out of fuel is probably just that it never had quite long enough in the station to get a good load as the pumps do fill trains fast, and in hindsight a faster inserter would have filled it up more effectively. Anyway, the strange thing was that the train was either not quite in the station and had run out just within a meter or two of the platform. The insert could have reached the train and refilled it, but because it was on auto they didn't. The moment the train was set to manual, I guess the train was considered static, and the inserter began to fill the train with fuel.

What should have happened.

If the train runs out of fuel, this should be considered as a stopped train just as if it were manual. This would have allowed the inserter to fuel the train. I suspect most of the time, trains run out of fuel a long way from the station, but in this case it ran out of fuel within range of a loaded inserter and could have been refuelled if the logic were slightly different.

Image

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Mon Aug 22, 2022 11:59 pm
by Rseding91
Thanks for the report however this isn't a bug but a feature request.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Tue Aug 23, 2022 5:37 am
by FuryoftheStars
Iirc, setting the inactivity condition for allowing the train to leave will count fuel loading as activity. In other words, if your cars are being filled/emptied faster than the locos can be refueled, using inactivity 1 sec as one of the conditions should allow it to stick around until refueling is complete.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Tue Aug 23, 2022 2:25 pm
by SpoonUnit
Thanks. There's a bunch of things that can stop the issue from ever happening and that's a good suggestion. It just seemed odd to come to the machine, see it complaining of no fuel while there was an inserter with fuel in hand within range that just wasn't delivering it due to the train being in auto mode. The moment I switched it to manual, the inserter fed it and it was happy again.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Tue Aug 23, 2022 2:43 pm
by FuryoftheStars
Yeah, the problem here with allowing the inserters to fill the train while parked not quite at the station (in auto mode) is that the inserter doesn't actually know if that train is destined for that station or not. Once the train is fully in position, it will change states, and this is what the inserter sees as "yeah, I'm here for you" and starts working. Otherwise, for all the inserter knows, this could be a train that's parked there while waiting for space to open elsewhere.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Wed Aug 24, 2022 4:27 am
by steinio
FuryoftheStars wrote: Tue Aug 23, 2022 2:43 pm Yeah, the problem here with allowing the inserters to fill the train while parked not quite at the station (in auto mode) is that the inserter doesn't actually know if that train is destined for that station or not. Once the train is fully in position, it will change states, and this is what the inserter sees as "yeah, I'm here for you" and starts working. Otherwise, for all the inserter knows, this could be a train that's parked there while waiting for space to open elsewhere.
Additionally the inserter doesn't know it's a loco. It would also fill a wagon with fuel happily.

The inserter lock is there to protect trains from getting items not destined for it.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Fri Aug 26, 2022 12:18 am
by ssilk
I’m sure we already discussed it and came to the current solution, because of that cases.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Fri Aug 26, 2022 2:49 pm
by Koub
ssilk wrote: Fri Aug 26, 2022 12:18 am I’m sure we already discussed it and came to the current solution, because of that cases.
Actually something that has been requested several times that would solve the issue is being able to :
- read the locomotive's contents (and add conditions on it obviously). Optimally, if I also could read the energy (in Joules) in the loco's inventory, it would be terrific, but just read the contents would be invaluable.
- cherry on top, also add conditional predicaments in the train route planner (if/then/else, while, ...) so that I can check if I get low on fuel and only send the train to get a refill if it's getting low.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Fri Aug 26, 2022 7:15 pm
by aka13
Koub wrote: Fri Aug 26, 2022 2:49 pm
ssilk wrote: Fri Aug 26, 2022 12:18 am I’m sure we already discussed it and came to the current solution, because of that cases.
Actually something that has been requested several times that would solve the issue is being able to :
- read the locomotive's contents (and add conditions on it obviously). Optimally, if I also could read the energy (in Joules) in the loco's inventory, it would be terrific, but just read the contents would be invaluable.
- cherry on top, also add conditional predicaments in the train route planner (if/then/else, while, ...) so that I can check if I get low on fuel and only send the train to get a refill if it's getting low.
IMO, what you suggest are fun gameplay mechanics, but a bad solution to the said problem. I have a special fuel support structure, which provides fuel to all "consumer" stations. That way, the trains which come from "producers" are always fueled, when unloading.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Sat Aug 27, 2022 10:36 am
by Koub
aka13 wrote: Fri Aug 26, 2022 7:15 pm
Koub wrote: Fri Aug 26, 2022 2:49 pm Actually something that has been requested several times that would solve the issue is being able to :
- read the locomotive's contents (and add conditions on it obviously). Optimally, if I also could read the energy (in Joules) in the loco's inventory, it would be terrific, but just read the contents would be invaluable.
- cherry on top, also add conditional predicaments in the train route planner (if/then/else, while, ...) so that I can check if I get low on fuel and only send the train to get a refill if it's getting low.
IMO, what you suggest are fun gameplay mechanics, but a bad solution to the said problem. I have a special fuel support structure, which provides fuel to all "consumer" stations. That way, the trains which come from "producers" are always fueled, when unloading.
Having the choice would be neat. The implementation of the mechanics I described would change nothing to your play style, but would allow me to do things differently. And it would allow what I consider cleaner way to refuel at unloading stations the way you do it : a condition unload until empty AND loco full would be cleaner than unload until empty AND wait 1s AND wait until inactive for more than 1s to ensure the train actually stops to refill the loco even without anything to unload.

Re: [1.1.67] Train on auto won't refuel even if in range

Posted: Wed Aug 31, 2022 5:43 am
by ssilk
Koub wrote: Fri Aug 26, 2022 2:49 pm
ssilk wrote: Fri Aug 26, 2022 12:18 am I’m sure we already discussed it and came to the current solution, because of that cases.
Actually something that has been requested several times that would solve the issue is being able to :
- read the locomotive's contents (and add conditions on it obviously). Optimally, if I also could read the energy (in Joules) in the loco's inventory, it would be terrific, but just read the contents would be invaluable.
- cherry on top, also add conditional predicaments in the train route planner (if/then/else, while, ...) so that I can check if I get low on fuel and only send the train to get a refill if it's getting low.
Would make this current suggestion obsolete, because it could never happen. A looooong awaited feature.