Telkine2018 / compaktcircuit

3 stars 5 forks source link

Smarter wire network reconstruction #24

Open SunSerega opened 3 months ago

SunSerega commented 3 months ago

Remote interfaces allow packed custom combinators to be nil, but wires going past them were deleted:

Basically this: image Turned into: image Because pushbuttons don't have a packed representation in this PR.

Creating an empty constant combinator, instead of returning nil is an option, but an unintuitive one (given that otherwise nil values work) and also just a horrible hotfix.


This PR adds a new rewiring system, to connect things that have non-nil packed representation with an equivalent (yet different and simpler than the unpacked version) wire network.

In essence, the setup from above will turn into: image

And something more complex like this: image

Will be packed into something like: image (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:

image (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...

SunSerega commented 3 months ago

I also need to add display lamps the same way as IO polls, for checking which networks are used in packed representation.

Are there any other special entities like that?