Page 1 of 1

Quality combinators calculate multiple times per tick

Posted: Sat Nov 11, 2023 2:00 am
by sparr
TL;DR
Instead of one operation per tick, quality combinators could run faster.
What ?
Currently every combinator runs one operation per tick. My idea is for combinators with higher than normal quality to run multiple iterations of their assigned operation. Adding a single such combinator would have no effect (unless its own input/output are wired together), but if you put multiple such combinators together you could do more complex calculations faster.
Why ?
The new quality system touches many parts of the game, but ignores combinators, and this seems to do them a disservice. This idea would include them.

It's often difficult to use high-latency circuits; a calculation that takes 10+ ticks to run can be problematic to integrate into a system that needs to make decisions without that delay. This change would allow speeding up time-critical calculations. e.g. my circuit to convert item counts to stack counts (which will be obsolete in 2.0 anyway) takes 7 ticks to run, but could run in 1 tick with this idea.
How ?
There was some concern on Discord that this couldn't be done in a consistent way. This not-pseudo-but-also-not-C++ code might better illustrate the idea in an achievable way:
Now:

Code: Select all

function tick()
    update_all_control_behaviors()
    update_all_circuit_networks()
end
Idea:

Code: Select all

function tick()
    update_all_control_behaviors()
    update_all_circuit_networks()
    for n=1..15 do
        update_legendary_control_behaviors()
        if n%2==0 then update_epic_control_behaviors() end
        if n%4==0 then update_rare_control_behaviors() end
        if n%8==0 then update_uncommon_control_behaviors() end
        update_circuit_networks_connected_to_updated_control_behaviors()
    end
end
PS: boskid already said this was a non starter on Discord, both because the functionality would be obscure and because it would have too high performance impact. I don't expect this suggestion to get implemented, I'm just writing it here for posterity and to reference in another post I'm making next.

Re: Quality combinators calculate multiple times per tick

Posted: Sat Nov 11, 2023 2:48 am
by Illiander42
Please no.

Some of us depend on the per-tick behaviour.

Clocks wouldn't work without it, for instance.

Re: Quality combinators calculate multiple times per tick

Posted: Sat Nov 11, 2023 10:22 am
by boskid
No