Disconnect Circuit Network


Adds a selection tool to disconnect circuit network connections of selected entities

Content
1 year, 2 months ago
1.1 - 2.0
428
Circuit network

i Interface for compatibility

20 days ago

Hello! Could you add an interface for mods that would allow filtering behavior when wires are cut?
For example, fCPU has a lot of hidden wires that should not be cut.
This would be very convenient for players.

Here is an example of a problem that users of your mod reported to me https://gitlab.com/konstg/fcpu/-/issues/21 .

19 days ago

I am not sure an interface would be a good way to solve this. It would slow down the mod since a call would have to be made for every mod that cares about wire removal for every single wire that is supposed to be cut, which would certainly be gated behind a mod setting to avoid the slow down of possibly having to do thousands of calls.
In fact I am not even sure right now (without looking into it) if and how it would even be possible to do this, short of providing an interface for other mods to "blacklist" certain connections from being disconnected and doing all the bookkeeping that comes with that.
Another option of solving this would be to simply raise an event when the mod disconnects wires of an entity. At least that way mods that have internal wiring that must be maintained can act accordingly and recreate any wiring they might need. Possibly not ideal as the wires will have been cut, although the other mod would run within the same tick and as such at the end of it nothing will have been disconnected at the end of the tick.

19 days ago

I would consider any of the following solutions to be good:
- the ability to specify a one-time blacklist of entity types when the map is launched, via an interface, so that your mod skips them when cut wiring
- the ability to specify a delegate for an entity class (working in a similar way), which would be more flexible

I doubt that cutting wiring even in the largest factory could have any noticeable impact on performance.

18 days ago

Happy to see you still maintaining this mod! I have to invoke it most days.

Yeah, it seems like anybody would be willing to wait a few seconds in those ultra-rare cases where we're cutting 100,000 wires at once. How many times in one run can we really have that many to cut? And how far did you have to zoom out to select them all? Past the game's zoom limits? For me it's usually more like a dozen, and I'd never notice even if there was a delay. But I suppose there is multiplayer sync to think about, and how the timing would affect that.

18 days ago

In multiplayer mode, each client executes the same commands locally (the server is only nominal and provides map sync), so no additional data is transmitted (except the selection command)

18 days ago

so everybody will wait a few seconds for the slowest PC to complete the cut before proceeding to the next tick with no complaints by the game engine? that would be fine.

18 days ago

I have been thinking about this some more, and assuming we're talking about Factorio >= 2.0 only, the proper solution might actually be to use scripted connections instead, which would seem to have been made for cases like this where you'd want to distinguish between internal script required wire connections and player connections.
The only thing that would not be ideal for is probably debugging scenarios where you might want to see your internal connections as well.
Other than that I would have to find some time to actually add a blacklist interface and exclude them. Of course that would require mods to not blacklist the player visible entity as otherwise it would interfere with the players ability to cut their wires from an fCPU (other other respective mods' entities) using this mod.

New response