Vanilla LTN - Distribution center "unloading delay" causing overfill requests

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
tarragon
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Oct 03, 2020 8:25 pm
Contact:

Vanilla LTN - Distribution center "unloading delay" causing overfill requests

Post by tarragon »

Hi all!

Decided to learn basics of circuits by designing somewhat of a LTN in Vanilla, hugely inspired by player Ellipticality. But the problem appeared with erasing memory and "unloading delay" at a buffer station, I will explain a bit how the current system works:
(I'm honestly struggling so much for so long with this, I hope some of you can help move me to right direction :roll: )


What I have is a buffer station (distribution center) which requests goods based on my constant combinator values. I can input 100k green circuits into it, and green circuit station will start delivering trains until the buffer amount is close to my request from constant combinator.
Works in a way that we take request R (i.e. 100k), we take current amount in buffer B (i.e. 50k), we take possible full train load T (2 wagons, 40 stacks each, 200circuits per stack = 16,000) -> and then calculate how many trains X to request -> X = ( R - B ) / T (this will result in a request of 3 trains). Just for reference, lets call this shortage decider.

Train station receives this signal, checks if any train is stopped at the station, checks is the train is full and if the content matches the request. If that's the case, station will dispatch the train into the buffer station and also sends signal that train is coming to the memory at shortage decider. Memory in this case is very important, without it we would keep requesting something that already may be on its way, thus, creating huge overflow in a buffer.

Train arrives to the station and starts unloading, but also sends a negative signal to the memory to erase its previous input. And this is where the whole problem lies, because the memory does no longer exist and the unloading just started, shortage decider (very dummy fellow, like his parent) decide that we again don't have enough goods at buffer and request additional train, even though we have enough, it just sits on train for now.

This won't cause trouble for such items that are delivered only by one station and one train.
But in case of green circuits, if we have 6 stations and 2 trains per each, and if we have 6 unloading stations at buffer, and somehow we are suddenly short of 6 trains at buffer, we will send 6 trains, which is fine and expected so far, but in case they arrive at the same time and all of them erase their input from memory, we will request 6 additional deliveries. At least until the trains are unloaded. This can basically cause overflow of 96,000 green circuits. Calculate it for every product coming to buffer and suddenly I need double the amount of buffer chests to take care of such overflow/overfill (sorry, don't know which word is correct).

Video for demonstration here:
I had few ideas, but so far none of them were good ideas :roll:
I cant force the pulse signal erasing memory after the train is done with unloading, because then I will lose signal of its content.
I cant put constant delay to the signal, because some trains with of 200/stack are unloading for 25 seconds but others with nuclear fuel are unloading for 3 seconds.
Maybe I could delay the signal until the content of train reaches specific constant number?
Maybe I could somehow connect the buffer contents and also train contents together and input those into shortage decider?

No matter what idea comes to my mind, none of them seem ideal or even slightly elegant and I would like to hear how more experienced players would approach such problem? And yes, after three days I hate myself for deciding to learn circuits on such a project...
tarragon
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Oct 03, 2020 8:25 pm
Contact:

Re: Vanilla LTN - Distribution center "unloading delay" causing overfill requests

Post by tarragon »

Ok, maybe unnecessary post because I managed to solve it in a way I am satisfied with and in a way that shouldn't cause any overfill.
In the end I actually used the idea described in the post that I thought of while writing it, and that it connecting train content together with buffer and input it together to "shortage decider".
This indeed solves the problem of requesting extra trains, but also causes new insignificant issue. When train arrives, shortage decider checks buffer content, train content and also memory, but because both buffer content and train content is instant and memory has delay few ticks, the train causes the shortage decider to request 1 less train that it should, but only for a few ticks (delay from combinators 1per each and also delay from our fish inserter pulse generator at station).
I cant think of any issues at all that this can cause. It is not perfect, but hey, it works :D

Without writing in this forum I wouldnt come up with the idea, so still thank you ;)
Post Reply

Return to “Gameplay Help”