dannydjdk / Tiny-Redstone

Forge mod for Minecraft that adds many tiny redstone pieces that you can put together on redstone panels to form tiny redstone circuits.
https://www.curseforge.com/minecraft/mc-mods/tiny-redstone
GNU General Public License v3.0
26 stars 5 forks source link

[Forge 1.18.2] Tiny Redstone signals travel faster depending on its direction. #119

Closed FoxyFox909 closed 1 year ago

FoxyFox909 commented 1 year ago

Placing a line of repeaters will easily allow this to be reproduced and seen. Given a regular horizontal Tiny Redstone Panel, redstone pulses will travel about twice as fast if going East (positive X), South (positive Z), Up (positive Y), and slower when traveling West (negative X), North (negative Z), and Down (negative Y).

These effects seem to happen similarly on vertical panels (it is how I discovered the Up and Down speed difference), and in ceiling panels (upside down ones) perhaps due to a transformation operation, the fast coordinate directions seem to be North and East.

This affects contraptions that rely on precise redstone timings, such as music-playing contraptions. May or may not be the same thing affecting issue #112

Demo of bug in action horizontal and vertical panels: https://youtu.be/MV9Q4rQojjM

It is fairly easy to see this behavior in slowed-down footage: https://www.youtube.com/watch?v=KB0hXZrJ3_Q

A separate instance was created to test this, with only the following mods present: image

dannydjdk commented 1 year ago

I have been able to successfully reproduce this in my dev environment. It also affects torches and other components that tick in response to inputs.

The issue is likely caused by the fact that the components tick in order from lowest index to highest. The index starts at the -x,-y,-z corner except when the panel is upside down where the whole grid flips. So, when a repeater gets a signal during a tick, before it does its own tick, it increments its tick timer during that same tick. Therefore, either ticking components need to account for whether or not they've already ticked when recording inputs received during a tick, or the output responses to ticks need to be queued to run after the tick completes.

Thanks for reporting this! I'd agree that there is a good chance that this is responsible for #112.

FoxyFox909 commented 1 year ago

I love tiny redstone. I'm adding it to whatever modpack I make/play in the future! Seems like you love your own creation, too, with that speedy response :)

I did have a feeling that it had to do with the way the ticks were calculated or something, since it was consistent and predictable behavior.

In the meantime, a (less than ideal) workaround to the bug is basically just... rerouting the redstone back so it only "travels" through the crucial repeaters/components in one direction LOL https://www.youtube.com/watch?v=SN9UylgcZwA Bug didn't stop me from trying to figure things out. This simple method is perceptually indistinguishable from regular redstone but of course kind of defeats the purpose of the mod (compacted, tiny redstone), but just sending it to prove that... I don't know... Redstone finds a way?

Anyway, good luck with tackling this one. I'd be happy to help with any testing or help in any way I can.

dannydjdk commented 1 year ago

Fix is now live for latest Tiny Redstone versions for Minecraft 1.16.5, 1.18.2, 1.19.2 and 1.19.3.

Glad you love the mod! I appreciate you nailing this one down for me. It was pretty significant, so I wanted to get it fixed as soon as possible.