Alternate Current is an efficient and non-locational redstone dust implementation. Its main focus lies in reducing the lag caused by redstone dust, by optimizing the power calculations and reducing the number of shape and block updates emitted. As a side effect of these changes the block update order of redstone dust networks is predictable and intuitive rather than locational and chaotic.
Performance
MSPT contributions of redstone dust are up to 20 times lower with Alternate Current, all the while maintaining a high level of Vanilla parity. Its low number of code modifications make it minimally invasive, so it's an easy drop-in replacement for Vanilla redstone dust.
Check out the GitHub page for a detailed explanation of Alternate Current's improvements.
Why is redstone so laggy?
There are two main reasons why redstone is laggy: unnecessary updates and unnecessary calculations, both of which are caused by the fact that redstone dust updates recursively. A redstone wire can update its power level over half a dozen times before settling on the final value, doing expensive calculations and emitting copious amounts of shape and block updates each time. On top of that, many shape and block updates are completely redundant.
How does Alternate Current fix that?
Alternate Current fixes these issues by doing power calculations of the entire network before updating the power levels. Each wire will check power from non-wire components just once and power from other wires just twice. Power sources within the network are identified, and the power is spread from there. This makes the calculations more efficient and the update order more intuitive. Shape and block updates are only emitted when the final power level is reached, and each wire emits no redundant updates.
Is Alternate Current compatible with Radium Reforged? And is it necessary with that mod installed? It does seem like this mod does more to reduce redstone lag than Radium Reforged does, but I’m not entirely sure.
Here’s what Radium Reforged does in relation to redstone:
Redstone Wire optimizations: Calculating the new power level of redstone wire after a block update is costly. Reducing the number of blockstate checks without any change in behavior reduces redstone dust lag by about 35%.
Block ticking optimizations: has less overhead, making things such as block update settling after generating chunks and other Redstone contraptions faster. This also reduces the amount of time it takes for a block to determine if it is ticking by schedule from O(n), where n is the number of ticking blocks, to O(1), providing a significant speedup when many blocks are being ticked.
Radium Reforged is a Forge port of Lithium, I see. Alternate Current and Lithium are compatible, so their Forge equivalents should be as well.
> And is it necessary with that mod installed?
It depends on your needs and wants. Lithium has a ~25% redstone dust optimization, on top of the general server optimizations (some of which indirectly improve redstone dust performance), but Alternate Current improves redstone dust performance by up to 2000%.
The trade-off is that Alternate Current cannot guarantee 100% behavior parity with Vanilla. Redstone dust is locational in Vanilla, so if you move your contraptions a few blocks there is a chance they will behave differently or break entirely. If and how much you encounter this depends on what kind of redstone you're into. Alternate Current fixes this by making redstone dust more consistent and thus more intuitive.
If you want optimizations that are guaranteed 100% parity with Vanilla, do not use Alternate Current.
If you want maximum performance and don't mind fixing a contraption occasionally, use Alternate Current on top of Lithium.
Forge 1.16.5 plz!!!
will it affect single player?
yes
Will this cause any issues if the "fastRedstoneDust" feature in Carpet is enabled?
It will not cause issues. If Alternate Current is enabled, it will override the carpet rule.
Server or client? Both?
server only
Any hope for forge 1.18.2?
Just curious, why does this mod use Fabric in the older versions? 1.7 for example has hundreds of thousands of Forge mods and nearly no Fabric mods.
This mod requires the use of Mixin, which the Fabric ecosystem supports by default. This made it fairly trivial to backport it to older versions. Having said that, Legacy Fabric has undergone substantial changes in recent months that leave the jars available here not functional, so I should probably archive them.
While Forge does also support Mixin for modern versions, they seem to discourage using any kind of "non API modding". This makes me reluctant to develop in Forge in general, as the type of mods I tend to make do not benefit from Forge's extensive API, but do require modifications deep in the game's code.
In reply to SpaceWalkerRS:
I think it would be beneficial to embed Mixins and use Forge for old versions instead. The Forge team in general really does not like old versions and constantly ushers users to abandon old versions and only make mods for the latest version.
I honestly would stop caring about what the Forge team wants, and focus on if this is a request you are willing to take instead.
While I appreciate that that is a good mindset to have in general, when you have limited time and energy to spend, these things start to matter. If it is a choice between one modding toolchain and another, I would much rather support the one that is being actively maintained and doesn't try to push users to newer versions.
damn so there's no forge version for 1.7.10? it's legacy fabric only?
Yes, and the releases for Legacy Fabric do not even work anymore because recent changes to their intermediaries... I am going to archive those versions since they are pretty much useless now.
In reply to SpaceWalkerRS:
aw damn. is there any reason why this wouldn't work for forge 1.7.10?
This mod needs Mixin to work. Forge does directly support Mixin for modern versions, but not older ones such as 1.7.
In reply to SpaceWalkerRS:
Mixins exist for 1.7.10!! i'm not too familiar with how it all works but most 1.7.10 mods coming out now are using mixins, for example; https://www.curseforge.com/minecraft/mc-mods/flying-cullers
Unfortunately I have limited time and energy to spend, so I'm gonna have to make choices as to which modding toolchains to develop for. Personally I would much rather support a project like Legacy Fabric, which is actively maintained, instead of Forge, which pushes users to newer versions and discourages any kind of "non API" modding.