Energized Redstone

Energized Redstone

264 Downloads

Any plans for 1.20.1?

WarmIceCream opened this issue ยท 2 comments

commented

I like the idea of this mod and I'd love to see it in the newer version :)

I've never seen a mod concept like this before

commented

Thanks! I'm planning on reviving this mod sometime in the future, but it basically needs a full rewrite before then.
I made the bulk of the mod in like three days, and it is heavily based off of Vanilla's Redstone (in part for compatibility and in part because I am lazy). The problem is, Vanilla Redstone has atrocious performance.

From Alternate Current:

Redstone wire updates recursively and each wire calculates its power level in isolation rather than in the context of the network it is a part of. This means a wire in a grid can change its power level over half a dozen times before settling on its final value. [...]

In addition to this, a wire emits 42 block updates and up to 22 shape updates each time it changes its power level.

Of those 42 block updates, 6 are to itself, which are thus not only redundant, but a big source of lag, since those cause the wire to unnecessarily re-calculate its power level. A block only has 24 neighbors within a Manhattan distance of 2, meaning 12 of the remaining 36 block updates are duplicates and thus also redundant.

Of the 22 shape updates, only 6 are strictly necessary. The other 16 are sent to blocks diagonally above and below. These are necessary if a wire changes its connections, but not when it changes its power level.

Now imagine instead of recursing over 16 states, you double that. Not to mention the memory overhead of adding an additional 2,592 blockstates (Vanilla Redstone has 1,296)

commented

Oh Jesus, I had no idea how bad redstone was for performance :/

Sounds like it might be worth making alternate current a dependency when you do rewrite the mod