-
Notifications
You must be signed in to change notification settings - Fork 23
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
Partial network rewrite #96
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Things noted: At least naming has been wrong, added FIXME note to unit tests about |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Update network utils, globalstep use networks, update switch ABM Removing switching stations from network
Add fake get_modpath for busted
Cleanup network.lua Add minetest vector.lua Add tests for network constructor
… already Comment out debug prints Network node place/dig, simple remove_network test Luacheck warnings Fix network check Fix overridden global table
Fix few cable place/dig issues Tests for machine build/dig Fix machine build/dig bugs Fix test for machine building Fix machines acting like cables when placed Inline fixtures for building/digging tests fix ignored luacheck warnings (#105) fix long lines (#105) Add more tests for bugs found Fix tests, add minetest.get_us_time (implement using socket.gettime)
Remove rest of SP_nodes from code, it does not contain anything Reset switch infotext, export machine_tiers Add tests for cable building between active networks Remove all networks when cable is placed between networks Fix SC connectivity issues
…lace Fix on_construct/on_destruct registration
Check network table before attempting to use it
Cleaned up and merging to master, users test rest best in production right |
TESTING REQUIRED
ANY OLD BUGS THAT ALSO APPEAR BEFORE THIS PR SHOULD NOT BE FIXED IN THIS BRANCH
Found new bugs so far:
actually they do seem to work but keeps blinking infotext between "no network" and actual supply info.
Tests added ✔️
Tests added ✔️
Tests added ✔️
Digging machines should not affect other machines at all, machine here behaves like cable and it should not.
Tests added ✔️
While placing machine should not affect unconnected cables it should still check for cables connected to another network and cause overload immediately, better sooner than later.
This invalid network part is lost when cache is built again, only affects placement. Can be annoying for sure if you don't know how it behaves.
Tests added ✔️
Tests added ✔️
Tests added ✔️
No tests added ❌
Tests added ✔️
No tests added ❌
Tests added ✔️
Tests added ✔️
Just for the record actual changed LoC is not as bad as it looks like. Excluding test related stuff which causes 16 files changed, 2434 insertions(+), actual code changes are:
9 files changed, 982 insertions(+), 745 deletions(-)
Might be possible to optimize that bit but not sure if it is worth it here, there's other upcoming updates planned anyway.
#96 (comment)
Partial power network rewrite. Testing required, WIP, back off if you fear bugs
Opening PR for partially rewritten power network handler. Breaks compatibility if some other mod depends on SS metadata, however for special cases where it cannot be easily fixed on other mod it is very easy to add metadata back and update it with ABM.
Performance
Performance seems to be slightly better that what it was, with worst case network (built badly, multiple switching stations etc.) performance boost during testing (averages for more than 8k measurements) was over 50%. With "normal" networks not that much but still better. Didn't find any case where performance would be worse than before.
Help wanted
Most probably there will be bugs, for that reason I added label "Help wanted" hoping that someone would have time to test things and write/post screenshots about problems found. maybe even fix problems.
Highlights / most important stuff
Most important improvements:
It is still needed as it does add heart beat signal for network (resets network TTL countdown).
Removed metadata from switching station (moved values to network hash):
Metadata cleanup
Added LBM (hardcoded disable) to remove metadata from technic machines, contains metadata keys for this PR and previous merged PR's:
"LV_EU_timeout", "MV_EU_timeout", "HV_EU_timeout", "LV_network", "MV_network", "HV_network", "active_pos", "supply", "demand", "battery_count", "battery_charge", "battery_charge_max", "active"