branchrust_reboot/main/hackweek_iorewritecancel
131 Commits over 92 Days - 0.06cph!
Drain pass optimisation, evaluators now set what kind of update (input, state or persistent state) can set the drain as dirty
Fixed save load path registeringcomponents twice
Updated all IO tests to the new syntax
IOTestFixture, helpers for IO2 automated tests
Updated AND switch tests
Converted more stuff: seismic sensor, some audio entities, fuse box
Converted door controller: had to set the monument door controller prefab inputs as main power slots, will need some S2P
Converted most lights, fridge and car lift
Converted sam site, rf devices cleanup
Converted igniter and tesla coil, fixed some flag stuff
Battery tick optims: merge the drain and charge into one loop
Circuit rebuild pass optims, we have a collection of dirty circuits instead of looping all circuits to check a bool, much better at scale
Evaluation pass optims, use buffers instead of pooling collections every tick
Converted ceiling light, smart switch, fuse
Cleanup, remove legacy IO code of already converted entities
Converted NeonSign to the new IO system
Removed the legacy electricity IO queue
Lazy create the IOCircuitSystem when registering the first io entity
Converted computer station, digital clock and command block
PressButton merge, compile fix
Blocker evaluator micro optims
IOCircuitSystem indentation fix
Allow root combiners to be connected to non root entities. Renamed it to 'combiner'
Prevent feedback loops by discarding power from back edge wires
Some fixes, refactoring and new evaluators. Cache consumption amount at register time so we don't rely on entities anymore
Fixed signs registering themselves in circuits
Started removing old IO code to IO entities code
Reduced the amount of flags OR AND and XOR switches are setting
Reduced the amount of TryGetComponentRecord calls
Circuit merge do not set the whole circuit as dirty + eval pass micro optims
No allocations when running the flood fill when rebuilding circuits
Updated all SimpleLight prefabs to use the HasPower flag instead of On
Simple light don't switch the ON flag anymore, we can just use HasPower and save a setflag when turning a light on/off (they're batched but that saves some overhead)
Added a max flag flip per tick per circuit budget too (too many flag changes can stall the client)
Circuit budgeting: all circuits share a 0.25ms budget per frame to evaluate. When the budget is depleted mid circuit, we save where we stopped and continue later. The starting circuit is never the same so a single circuit can't eat the whole budget and clog everything
Also moved the drain pass to the 1hz battery tick, it doesnt have to run on every tick
Optimised the evaluation pass. we now starts from the dirty components specifically instead of evaluating the entire circuit from start to finish
When evaluating, if a component output didnt change, we stop there
switch out batched packet send storage for HashSet to avoid multiple sends from an entity within a circuit tick
Ceiling lights just use the HasPower flag instead of On
moved SendBufferedFlagChanges outside of circuit loop
More io entities using the new flag update
Auto turret is not sending full network update when turned on or off
using HasSubscribers method instead of manual check
skip sending batched packets to groups with no subscribers
SimpleLight sends on/off flags through batched system