Storage Counting

    Joined
    Oct 24, 2017
    Messages
    39
    Reaction score
    54
    A while back I made an automated factory, which worked by pulling each block into a storage container specific to that block, checking how full it was with a sensor block, and then either turning on a factory set to make that block or placing its contents back into the primary storage container if it was the quota. In this way, it could, in theory, detect and craft anything you needed automatically.

    It only mostly worked. One of the major problems I ran into was that different servers had different storage capacities, making it difficult to set a quota based on how full a storage container was. This led to it over producing in servers with crazy high storage capacity.

    I was curious if anyone could think of a better way to setup logic to count blocks, something that would be more server-setting-proofed than using sensors.
     
    Joined
    Jun 20, 2013
    Messages
    2,827
    Reaction score
    1,181
    • Video Genius
    • Legacy Citizen 4
    • Top Forum Contributor
    You can set factory limits on production in the factory itself
     
    • Like
    Reactions: Agame3
    Joined
    Jun 9, 2013
    Messages
    114
    Reaction score
    112
    • Legacy Citizen 2
    • Legacy Citizen
    Necropost, I know

    The system can be wired different way. There's an old storage checkup system via activation block wired to cargo. Wire a button to that Activation Block, then wire that activation block back to the button to make it disable (you can't directly wire a button to a cargo box). Now you have a button which triggers every 5 seconds if the cargo is not full. Now you can slave a sensor to that button meant to check the cargo's content, and use an inverter slaved to the sensor's activator to disable factory when the desired amount of content is reached. Hard to do with small amounts, but can be used to check if the box is Not Empty (slave a single disabled activator to the sensor) and limit production of the factory by the box's pull limiter.

    This way you get a factory which can stop after producing a desired amount of items even at absurdly high storage amounts and doesn't eat up power while stopped. If you use factory's own limiter only, the factory continues to eat up power even when not producing

    The box is pulling from the controlled factory, obviously. Didn't add the corresponding arrow on the scheme
    Network.png
     
    Last edited:

    DrTarDIS

    Eldrich Timelord
    Joined
    Jan 16, 2014
    Messages
    1,114
    Reaction score
    310
    Another option is to se the factory's pull to a specific amount, Then use a "not empty" sensor on the storage, shutting off the factory as long as ANYTHING is in the storage. Then you connect the dependent factories directly to the first one in a chain that self-renews whenever any of them become "empty."

    This way makes things need a bit more math, but does work-around "insane storage in a single block" server settings. A bit of extra work to connect everything to each other instead of a central stoage box, but at the same time it keeps things organised. You can then make a specific storage box in an accesible location connected to EVERYTHING that you manually input pulls to if you need them in astro hands, and connect say a shipyard to EVERYTHING to have it auto-pull as needed and have the factory refresh as needed during builds(because some people use he shipyards)
     
    Joined
    Jun 9, 2013
    Messages
    114
    Reaction score
    112
    • Legacy Citizen 2
    • Legacy Citizen
    Another option is to se the factory's pull to a specific amount, Then use a "not empty" sensor on the storage, shutting off the factory as long as ANYTHING is in the storage. Then you connect the dependent factories directly to the first one in a chain that self-renews whenever any of them become "empty."

    This way makes things need a bit more math, but does work-around "insane storage in a single block" server settings. A bit of extra work to connect everything to each other instead of a central stoage box, but at the same time it keeps things organised. You can then make a specific storage box in an accesible location connected to EVERYTHING that you manually input pulls to if you need them in astro hands, and connect say a shipyard to EVERYTHING to have it auto-pull as needed and have the factory refresh as needed during builds(because some people use he shipyards)
    still not solving power issues, since all dependent factories take power each production tick even when idling. Unfortunately nowadays power, while still better than straight after power 2.0 patch, isn't as plentiful as it used to be. Plus, having a manual pull box is a nightmare, way easier to have a central storage to keep a pre-programmed amount of everythigh you use and self-disabling factories to produce supplies (hook your shipyard there too). If the storage gets overfilled you use a sensor-controlled buffer to pull excesses from the main storage and factory-specific storages to empty the buffer. Then the main storage self-levels by pulling from factory storages. You also need to set the factory shutdown threshold to 50%-75% (or the value you need to avoid overproducing) to avoid excess production cycles while emptying the buffer.

    The buffer trigger is going to be tricky on larger-scale storage sizes, but you need only one for all your overproduction needs.

    The benefit of central storage is also that it controls everything, so you need to program limits once and set all your factories to stop when not empty.

    You could even try and build even more power-saving staged factory where factories enable in large groups, say advanced products like guns or teleporters are produced only after hull production reaching maximum desired amount or processing junk only after all raw minerals were turned into basic components.
     
    Last edited:
    • Like
    Reactions: IR0NSIGHT
    Joined
    Jan 28, 2017
    Messages
    60
    Reaction score
    107
    still not solving power issues, since all dependent factories take power each production tick even when idling. Unfortunately nowadays power, while still better than straight after power 2.0 patch, isn't as plentiful as it used to be. Plus, having a manual pull box is a nightmare, way easier to have a central storage to keep a pre-programmed amount of everythigh you use and self-disabling factories to produce supplies (hook your shipyard there too). If the storage gets overfilled you use a sensor-controlled buffer to pull excesses from the main storage and factory-specific storages to empty the buffer. Then the main storage self-levels by pulling from factory storages. You also need to set the factory shutdown threshold to 50%-75% (or the value you need to avoid overproducing) to avoid excess production cycles while emptying the buffer.

    The buffer trigger is going to be tricky on larger-scale storage sizes, but you need only one for all your overproduction needs.

    The benefit of central storage is also that it controls everything, so you need to program limits once and set all your factories to stop when not empty.

    You could even try and build even more power-saving staged factory where factories enable in large groups, say advanced products like guns or teleporters are produced only after hull production reaching maximum desired amount or processing junk only after all raw minerals were turned into basic components.

    very much the way i built my factory in Brierie. I have production trees with 1000 block factories for every important item:
    all chambers, the armour colors i use, power, shields, weapons. A main storage pulls up to 20k of each item, the block factories are limited to 1k.
    That way it autoproduces more if i take out blocks. Nice sideeffect: lots of small factories to fill my station with RP interior.
    I cant remeber if i built in an auto switch, power is rather cheap on stations.