Modern Industrialization

Modern Industrialization

4M Downloads

[suggestion] Item Gates

phebert5009 opened this issue ยท 3 comments

commented

The Idea

Someone could want to spend exactly three tin dust for bronze ingots for every tin dust turned into ingots for other stuff like cables (this is an example, the proportions listed are random.). There is currently no accurate way of managing this in an automated fashion. Enter item gates (or semaphores, if you like); featuring one output side, one input side and four "link" sides, the gate act as a container having exactly one input-only slot, with a modifiable capacity (like the other machines), once every linked gate is filled, all of them change their slot to be output-only until emptied, where it changes back to being input-only.

Implementation details (no need to do exactly this, this is simply one way to do it):

Each gate would be in one of four states: waiting, ready, set, and go, described below. given a tick counter c, if c % 4 == 0 check to see if gates in the waiting state can proceed to the ready state, if c % 4 == 1 check to see if gates in the ready state can proceed to the set state, and so on looping back to waiting.

The states

Waiting

In the waiting state, the item slot is in input-only mode, so pipes can add items but not remove. items can also be automatically grabbed from a container on the input side. if the slot is filled to capacity, then the gate can move on to the ready state.

Ready

In the ready state, the slot is locked: nothing can add or remove from it. if all adjacent gates on the link sides are in the ready or set states, then this gate can move on to the set state.

Set

In the ready state, the slot is locked: nothing can add or remove from it. if all adjacent gates on the link sides are in the set or go states, then this gate can move on to the go state.

Go

In the go state, the item slot is in output-only mode, so pipes and the user can remove items but not add them. Once the slot is empty, the gate can transition into the waiting state.

commented

Can't you already do this by reducing the slot stack size of the mixer to 3x and slot stack size of your furnace to x, and so on for each of your machines that need tin?

commented

I think this is an interesting idea ... Maybe we will implement it with some machine covers

commented

@Rakkis157, not quite, if you are splitting things by how much a recipe takes, then limiting machines works fine. Any other weighting will eventually decay into weights equal to recipe frequecy * recipe amount once everything fills to the assigned limit, so changing the limits does not work if you want something completely arbitrary.