Skip to content

Conversation

@SunSerega
Copy link

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)

  • [6] tells me about a combinator I forgot to wire for the previous screenshots
  • [7] tells me that the red network is no longer connected to the IO polls (since I removed it)
  • [8] tells me that the green network (that was connected to the red network) is also no longer connected now

The current warning system is very rudimentary, so I didn't even bother displaying combinators' translated names.

To improve next:

  • Actually, the green network in the screenshot above was never connected to the IO polls through the red wire. But to check for that, we need to properly walk the networks Input=>Output, and then Output=>Input;
  • Nested processors are treated as black boxes, so they can't be optimized (based on parent processor's connections) and every nested IO poll is treated as connected to every other (of the same nested processor);
  • Some kind of in-game visual to display for the entities that are not connected, instead of chat messages?

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

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

This commit adds new rewiring system, to connect things that have non-`nil` packed representation with an equivalent (yet different and simpler than unpacked version) wire network
@SunSerega
Copy link
Author

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?

@SunSerega SunSerega marked this pull request as draft June 20, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant