Fix Transformers Being Worse Than Accumulators #5985
Merged
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.
Currently, transformers do not limit energy flowing through them at all. This makes them strictly worse than accumulators as the player has no way of preventing overflow through transformers and thus is likely to burn wires.
This PR aims to fix that, registering transformers as limiting connections within the wire network, limited to the throughput of their lowest wire. This makes transformers better than accumulators as they can handle ~8 times the throughput in a block that costs roughly the same to set up, and in minimal excess space.
Their limiting may be a little messy in some edge cases because the more performant setup I developed does not factor loss into the limit, assuming the limit is at the source and not nebulously some way past the source, but it will make transformers more useful for stepping down.
Chaining transformers works, as well, the lowest transformer on a path will be used as the limit.
Fixes #5894, Fixes #5574