2024-12-12 09:23:59|Myriagame |source:minecraft skins
introduce
The module optimizes the redstone circuit to make it run more efficient and no longer affect the operation results.
The module is committed to reducing the stutter brought by the redstone line. The implementation method is to optimize the calculation method of the redstone signal and reduce the shape and block update of the redstone line.
The side effects of these changes are the update order of the redstone line circuit is more regular and predictable, rather than being affected and chaotic by the location.
Performance
The negative effects of the redstone line on the MSPT were reduced to one -twenty -tenth of the original, and basically did not cause the difference between the calculation results of the redstone circuit and the original version.
Fewer code modifications reduce the invasion of the module to the minimum, so it is a good alternative to calculated the original redstone line.
How does this module work?
The algorithm used in this module considers the following goals during design:
Reduce the number of times of the surrounding blocks in order to confirm the strength of the redstone signal;
Reduce the number of blocks and shape updates;
The block and shape are not updated in the order of position, but in the order of certainty, the error MC-1193 is repaired.
In the original game, the redstone line always causes stuttering because it is unsuccessful to optimize the first and second points.
The redstone line circuit is recursively updated. Each redstone line is calculated separately, instead of calculating it based on other redstone lines connected to the Redstone Circuit.This means that the redstone line in the Redstone Circuit can change the redstone signal strength of more than six times before determining its final redstone signal strength.This problem is more serious in the 1.13 and lower versions. The redstone line must even update its own redstone signal strength to 1 when the redstone signal strength is updated.
In addition, each time the redstone line changes the redstone signal strength, 42 block updates and up to 22 shapes are updated.
Among these 42 block updates, there are 6 times for the redstone line itself. They are not only excess updates, but also an important reason for the stuttering of the red stone line, because these updates may cause the redstone line to make unnecessary unnecessaryRedstone signal strength calculation.There are only 24 adjacent blocks in a range of a block in Manhattan, which means that 12 of the remaining 36 block updates are repeated, so they are also doing useless work.
In the 22nd shape update, only 6 times are necessary.The other 16 updates were passed to the diagonal blocks above and below.
If the redstone line needs to change its connection, then these updates are necessary, but when it changes the strength of the redstone signal strength.
The third point is more like a game experience problem, not the redstone line stuck, but the original redstone line calculation has not been built on the problem of dealing with this problem.The recursive nature of the renewal of the Redstone Circuit, plus the update of each redstone line is affected by the update of its neighboring Redstone Line, which makes the redstone line update order in the redstone line circuit is very uniform. It looks or even random ones.Essence
The module fixes these issues in the following ways.
(1) In order to ensure that the redstone signal strength is calculated as little as possible, the module deletes the recursive update of the redstone line circuit in the original version.As an alternative, the module turned the redstone line circuit into a whole, found the redstone line that received the redstone signal from outside the circuit, and spread the redstone signal from there.There are several advantages:
Each redstone line is checked up to the redstone signal disseminated by the non -red stone line, and the redstone signal spread by other redstone lines only needs to be checked twice.
Each redstone line will only update the redstone signal strength once in the world.This is very important because calling level.setBlock needs to be calculated than calling level.getBlockState.
(2) There are two obvious methods that can reduce the number of blocks and shape updates.
Remove the useless 18 block updates and 16 shapes mentioned earlier.Therefore, each redstone thread is only updated 24 blocks and 6 -shape updates when updating the strength of the redstone signal.
The block and shape are updated when the redstone signal strength is completed only when the redstone line is calculated, not the interval calculated at each time.
These two optimizations are the best for single red stone wires, but for the entire Redstone Circuit, there can be better optimization!
As mentioned earlier, the module turns the redstone line circuit into a whole to spread the redstone signal, so it is completely redundant to transmitting blocks and shapes to the redstone line in the circuit.Excluding these updates can reduce the box and shape update by 20%.
(3) In order to make the update order of adjacent redstone lines in the redstone line circuit is certain, the module replaces the order of the redstone line based on the location to update its adjacent erythema line.Instead of replacement, the order of the redstone line updates its neighboring redstone line is based on the source direction of the redstone signal.This part of the algorithm is largely inspired by the "RedstoneWireturbo" of TheOSIB. Those who are interested in this part can read the comments published on Mojira, or refer to its implementation in Carpet.
The idea is to determine the direction of the redstone signal stream based on the relative position of the redstone line that transmits the redstone signal and the relative position of the redstone signal.For example, the only redstone signal received by the redstone line comes from the redstone line on the west, so the direction of the redstone signal flow is east.The module enables the redstone line to transmit updates to the neighboring redstone line.This not only completely eliminates the effect of the position on the redstone signal, but also the impact of the direction on it in many cases.However, unlike "RedstoneWireturbo", the module decides to retain a certain directionality under ambiguous situation, rather than introducing randomness, although this is not a technical problem.
Although these changes have repaired the sequence of blocks of a single redstone line, the overall block update order of the redstone line circuit needs to be resolved urgently.It turns out that this is not a problem, because the changes mentioned earlier: The redstone circuit will check the redstone line from the redstone signal from outside the circuit, and spread the redstone signal from there.If each redstone line can pass the redstone signal according to the direction of the redstone signal stream, it will eventually get a redstone line update order that is not affected by the position and is basically not affected by the direction.
Precautions
For Fabric versions of 1.3.2 to 1.13.2, Legacy Fabric needs to be installed in advance, which is mentioned in the module relationship.
For the QUILT versions supporting 1.0 to 1.13.2, you need to install ornithe in advance, which realizes the operation of the QUILT version below 1.14.
National Service DNF Dark Ni
2025-01-28 09:19:27The new screenshot of the be
2025-01-28 09:18:57The 15th anniversary wallpap
2025-01-28 09:18:273DM Xuanyuan Sinicization Gr
2025-01-28 09:17:57French magazine is the first
2025-01-28 09:17:27The sneak game "Republic" wi
2025-01-28 09:16:57The story between humans and
2025-01-28 09:16:27Capture "Trinity 3: Artifact
2025-01-28 09:15:27Wind direction change "Myste
2025-01-28 09:14:57DICE's new project "Dream" w
2025-01-28 09:14:27Pirate Minecraft Skins
Minecraft Skins
2024-12-10 04:11:27Pirate Minecraft Skins
Minecraft Skins
2024-12-10 04:11:26Master Minecraft Skins
Minecraft Skins
2024-12-10 04:11:25King Minecraft Skins
Minecraft Skins
2024-12-10 04:11:25Guide Minecraft Skins
Minecraft Skins
2024-12-10 04:11:24Dark Knight Minecraft Skins
Minecraft Skins
2024-12-10 04:11:23Sparta Minecraft Skins
Minecraft Skins
2024-12-10 04:11:23Moncraft Skins of the War
Minecraft Skins
2024-12-10 04:11:22Red Witch Minecraft Skins
Minecraft Skins
2024-12-10 04:11:22Golden Cavaliers Minecraft S
Minecraft Skins
2024-12-10 04:11:22