The-International-Open-Source icon indicating copy to clipboard operation
The-International-Open-Source copied to clipboard

Funnel system to work as intended

Open CarsonBurke opened this issue 1 year ago • 1 comments

  • distinction between independent funnel want and dependant funnel want

  • from start to end: if previous room independently wants funneled, then then the consecutive one will dependently want funneled. From end to start: if the previous room wants independently funneled, then the following one will register as dependent. else if the previous room wants dependently funneled, the room will register dependently funneled.

  • Problem

    • when the first room reaches its funnel threshold only when other rooms have already done so (let's say alternative rooms incidentally have higher energy incomes or priorities) then the funneling will always end up split between multiple rooms
    • problem example
      • if the first room wants to be funneled but
  • Solution

    • the start must be contiguous, and dependent
    • n = no, i = independent want, d = dependent want, o = overdrive want
    • pre state: {n, n, n, n, n, i, n}
    • post state: {d, n, n, n, n, n, n}
    • final state: {f, n, n, n, n, n, n}
    • the independent want of any funnel target triggers the independent and actionable want of the first room while disregarding the want of the actuator

psuedocode

if (the first target wants independent funnel) then set it so and continue to next target(s) to potentially create a contiguous set of wanters if (any independent funnel wanter) then set first funnel target to override funnel want

  • {n, n, n, n, y, n}
  • {y, y, y, y, y, n}
  • {s, n, n, s, s, n}
  • {f, f, n, n, n, n}

calculate the difference between how much the room could upgrade purely based on energy in storing structures. Subtract the actual limit (capped by link throughput, etc.) and add that to the total amount that can be funneled.

Say this adds up to 200, then there is 200e/tick to distribute to funnel targets. Give it from most preferred funnel targets until they are full, or until the amount to distribute runs out.

CarsonBurke avatar Jan 30 '24 17:01 CarsonBurke

If anyone has ideas on how to do this system well, ideas are much welcome. Thanks.

CarsonBurke avatar Jan 30 '24 20:01 CarsonBurke