MinimalWire - Clean Power Networks


MinimalWire is a quality of life mod that eliminates spaghetti and keeps your factory wires clean by enforcing efficient connections, using Kruskal's algorithm to produce a minimum spanning tree each time a power pole is added to the network. Check out my other mod for a much more relaxed approach to this idea: OneWire

Tweaks
2 months ago
2.0
2.41K
Circuit network Power Blueprints

b Legendary substations' wires don't connect

3 months ago

For whatever reason, when you place legendary substations they don't connect to each other, unless they're really close.

3 months ago

Hey, does it say "MinimalWire: Warning: Could not determine max wire distance for pole, using default." in chat?

3 months ago

Oh actually it could be because the other substation isn't within the search radius (default 32, can change in settings). Try debug mode or increasing the radius (again in settings), I don't have much experience with the quality mechanic, but that seems plausible.

2 months ago

I'm seeing legendary big poles (wire reach: 42) failing to connect, even with search radius turned up to 50. Small scale networks also regularly fail to connect. With "Full-Network MST Generation" turned on, my Nauvis power grid was shattered into thousands of solitary big poles, all within connection distance of each other, but none of them connected. This total power failure forces me to revert to an old save and uninstall this mod.

2 months ago
(updated 2 months ago)

Placing a new legendary big pole which can connect to many nearby poles, this mod immediately disconnects it from everything, leaving it alone with a small green circle (?) rendered on top of it.

debug output:
"""
MST calculation - Poles: 21, Total edges: 4, MST edges: 3
MST stats - Total length: 24.38, Avg edge: 8.13
Scheduled tasks - Disconnections: 8, Memory est: 0.39 KB
Scheduled tasks - Connections: 0, Memory est: 0.00 KB
"""

2 months ago

I added a debug print statement when a pole's max wire distance is looked up for the first time (inside get_pole_max_wire_distance, after the cache lookup fails), and it looks like all poles are getting a max distance of their normal versions, even if they're quality poles.

2 months ago

get_max_wire_distance seems to accept a quality parameter, so I'm tinkering with that now.

2 months ago

Okay, easy fix: in control.lua, line 54, specify pole.quality as a parameter to get_max_wire_distance:

   local max_wire_distance = prototype.get_max_wire_distance(pole.quality)

... I'd increase default search radius to at least 42 (legendary big pole), and then the rest Just Works?

2 months ago

The green circles remain; any idea what's up with those? https://imgur.com/a/5m552Jd

2 months ago

Ah, looks like subnetwork rendering, which is only painted if we're in debug mode (but it persists if I turn off debug mode, until a subnetwork rebuild is triggered!).

2 months ago

I still need to disable this mod until the fix is published, as I can't expect other players in my multiplayer games to apply the fix locally, but I look forward to being able to turn it on again!

2 months ago
(updated 2 months ago)

Thanks so much for all your help durandal42, I have published an update fixing this issue.

This thread has been locked.