[0.13] Don't start unloading if wait-condition fulfilled

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

gHoST INFERNO
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Sun Nov 15, 2015 11:06 pm
Contact:

[0.13] Don't start unloading if wait-condition fulfilled

Post by gHoST INFERNO »

Hi,

tl;dr - Could locomotives evaluate their wait-condition once just before letting the train start unloading, such that no unloading happens if the wait-condition is fulfilled from the start?

I'd like to build a "generic unload station", supporting unloading copper ore, iron ore, coal, stone, and crude oil barrels, so I can share the unload stations for everything. One problem I have to solve for this is to make trains not unload if I already have too much of a particular resource in the system. For example, if there is back-push on coal, I'd like to make trains not unload. In 0.13 I can send the data from a circuit network to the locomotive and configure a condition there that should make it leave immediately (if I don't want to unload more). The problem is that even if that condition is true from the start, the train always goes through a single "unload cycle" of all inserters. This is obviously a small amount of resources, but it may accumulate over time, until my system gets stuck (unless I build something where I reload it later).

Another solution I was considering was that I could disable the inserters first and only enable them e.g. 1 second after the train arrived, but that means I'd need to detect when a train arrives, something the train station doesn't expose. I could build this in a hacky way by building a gate across the train tracks (using the gate as a "sensor"), but then I'd have to be super careful to never trigger that myself, which seems annoying ..

EDIT: This topic started out as a suggestion, but then in my post below I noticed that it seems to actually be non-deterministic behavior, so this became more of a bug. I also updated the subject of this thread to reflect this slightly better.
Last edited by gHoST INFERNO on Tue Jul 26, 2016 7:48 am, edited 2 times in total.
gHoST INFERNO
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Sun Nov 15, 2015 11:06 pm
Contact:

Re: [0.13] Suggestion: Evaluate train-wait-condition earlier

Post by gHoST INFERNO »

Actually, I kept this loop running for a while longer, and it looks like this is non-deterministic. Originally I would always do a single unload-cycle and then leave, but now it seems to have switched modality (no unloading), without me changing anything. Note that I'm currently connecting a constant combinator to the train station and using that as the signal for the wait-condition of the train, so I should have any flip-flopping signals on the circuit network.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: [0.13] Suggestion: Evaluate train-wait-condition earlier

Post by ssilk »

Hm. I dunno, if I can see that as suggestion. Currently it is to unspecific. I mean it's clear what you want in end-effect - but when I read your description I think you make something wrong. Sorry, just a feeling. Maybe you can explain what you are doing, and why (some screenshots...)?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
gHoST INFERNO
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Sun Nov 15, 2015 11:06 pm
Contact:

Re: [0.13] Suggestion: Evaluate train-wait-condition earlier

Post by gHoST INFERNO »

My setup couldn't be any simpler:

* train stop is connected to a constant combinator
* constant combinator is turned off, so outputting the implicit 0 for everything
* the wait-condition on the train is to "wait until metal=0" (which is immediately true)
* there are normal stack inserters to unload the wagon into chests.

That's it :-)

So as mentioned, initially it looked like the inserters always went through one unload-cycle before the train left, and so what I had here seemed more like a suggestion / feature request. However, afterwards (after running for a while) it seemed to change modality and not unload anymore, so it seems a little non-deterministic, so I guess this now becomes more of a bug:
1) Bug: Please make behavior more deterministic (i.e. make either one or the other observed behavior always be the outcome).
2) Suggestion / request: When fixing that bug, personally I'd prefer if it would always evaluate the condition before starting to unload, such that it wouldn't unload anything if the condition is true from the start.

-> ssilk I agree, this is now probably more of a bug than a suggestion / idea -> could you move it into the bug-board?

Thanks!
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: [0.13] Suggestion: Evaluate train-wait-condition earlier

Post by ssilk »

Moved from Suggestions to Bugs.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
gHoST INFERNO
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Sun Nov 15, 2015 11:06 pm
Contact:

Re: [0.13] Evaluation of train-wait-condition non-deterministic?

Post by gHoST INFERNO »

Thanks! Adjusted subject of thread and put in a small note.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14819
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.13] Don't start unloading if wait-condition fulfilled

Post by Rseding91 »

Trains and inserters have a specific order they run updates in which can cause the train to never unload a single item or to unload items when it stops depending on what order the entities are updated in. It may seem random but there is an order to it else Multiplayer would desync instantly any time anyone used trains.

This isn't a bug but a suggestion. Not a bad one either.. maybe for 0.14.
If you want to get ahold of me I'm almost always on Discord.
bennygenel
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Sep 30, 2016 10:53 pm
Contact:

Re: [0.13] Don't start unloading if wait-condition fulfilled

Post by bennygenel »

I also had a similar problem. I solved it with this reddit.com/r/factorio/comments/3drrfu/a_simple_timer_using_the_new_combinators/ct82l1s
I wired it to a signal at the end of the station, looked for red signal and then made inserters wait 5 seconds. Timing I guess depends on the station design.

Hope it helps.
Post Reply

Return to “Ideas and Suggestions”