Read the amount of entities connected to a circuit wire

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Tertius
Filter Inserter
Filter Inserter
Posts: 936
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Read the amount of entities connected to a circuit wire

Post by Tertius »

What:
I'd like to know the amount of the entities connected to some circuit wire.

More specific: the number of outputs connected. Power poles don't count, combinators who are connected with their input only don't count as well. Chests count, combinator outputs count, inserter hands count, etc.

Example:
If there are 32 chests, 32 inserters with "read hand content", 2 blue belts with "read content", 1 constant combinator and 1 decider combinator output connected with green wire, I'd like to have this information available at the output of the device whose input is connected to this green wire.

I have this in mind as option for the selector combinator announced for 2.0, since this is in spirit similar to the stack size option - it's meta info about the environment and the things handled.

Why:
It enables the player to determine amount of entities dynamically instead of hardcode numbers into circuit entities and conditions. Determine averages automatically.

Use cases:
Enhances circuit support of all kinds of production lines that have a large number of similar entities.
  • fully automate calculations around train stations
    • With the amount of chests from this new functionality and the item stack size from the selector combinator, it's possible to compute the station capacity, so train limits can be calculated dynamically without anything to hardcode
    • With the amount of chests the average chest content can be calculated, which is often used for active balancing
  • calculate fuel requirement of a nuclear power plant by counting all nuclear reactors (since we're not able to wire reactors, we will count the inserters used for inserting fuel)
  • determine the number of "tiles" if someone uses tileable blueprints
  • Provide more ammo the larger the perimeter defense grows.
  • in general: count the size of something to adapt to growth.
Post Reply

Return to “Ideas and Suggestions”