Smarter wire network reconstruction #24
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remote interfaces allow packed custom combinators to be
nil, but wires going past them were deleted:Basically this:


Turned into:
Because pushbuttons don't have a packed representation in this PR.
Creating an empty constant combinator, instead of returning
nilis an option, but an unintuitive one (given that otherwisenilvalues work) and also just a horrible hotfix.This PR adds a new rewiring system, to connect things that have non-
nilpacked representation with an equivalent (yet different and simpler than the unpacked version) wire network.In essence, the setup from above will turn into:

And something more complex like this:

Will be packed into something like:

(probably with different entities being chosen to be connection origins)
To be clear, none of this will be visible to the user, because unpacked representation is restored from a blueprint.
I've wired things manually to make these screenshots, just as a demo.
Since the wire networks are already computed, it was trivial to also warn the user when something is not connected to processor IO polls:
(I unchecked and immediately checked the "Packed mode" field to get these messages)
The current warning system is very rudimentary, so I didn't even bother displaying combinators' translated names.
To improve next:
This system also allows us to stop replacing many default entities (like power polls) with constant combinators.
But I don't want to touch that until a better system for default entities (similar to
remote_name_map) is implemented...