Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funnel system to work as intended #773

Closed
CarsonBurke opened this issue Jan 30, 2024 · 1 comment
Closed

Funnel system to work as intended #773

CarsonBurke opened this issue Jan 30, 2024 · 1 comment
Assignees
Labels
Help wanted ideas, code or feeedback is requested from other contributors Improvement Presumably positive changes to existing functionality priority this issue should be resolved ASAP

Comments

@CarsonBurke
Copy link
Member

CarsonBurke commented Jan 30, 2024

  • 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 CarsonBurke added the Improvement Presumably positive changes to existing functionality label Jan 30, 2024
@CarsonBurke CarsonBurke self-assigned this Jan 30, 2024
@CarsonBurke CarsonBurke added priority this issue should be resolved ASAP Help wanted ideas, code or feeedback is requested from other contributors labels Jan 30, 2024
@CarsonBurke
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted ideas, code or feeedback is requested from other contributors Improvement Presumably positive changes to existing functionality priority this issue should be resolved ASAP
Projects
None yet
Development

No branches or pull requests

1 participant