stfwi / redstonepen

Minecraft mod adding a pen to draw Redstone tracks in all directions, a PLC for Redstone, and relays.
MIT License
14 stars 2 forks source link

TP function randomly failing. #25

Closed Splutty closed 1 year ago

Splutty commented 1 year ago

Several times now I've had an RLC fail to actually execute a TP function properly.

Something along the lines of G=TP1(R.CO.RE,200) would only blip for roughly the tickrate.

Copy/pasting the code into a new RLC fixed it, restarting the server fixed it, cleansing/recrafting the RLC fixed it, but for the duration of the session the original RLC would be broken on all TP functions, basically.

This a known issue? Is there any solution/workaround?

stfwi commented 1 year ago

Hey splutty, I can take a look again on the RLC this weekend. To quickly synchronize for reproducing the problem: Which version of the mod is it?

To re-ensure, the expected behaviour is a pulse or an extension of the signal? I mean, a TP ignores the input for the 200t and should stay on logical HIGH level during that time, no matter how the input changes in between. After that it accepts a rising edge again. E.g. while a TOF refreshes the 200t every time the rising edge occurs (in your code line). I presume the intended behaviour is the first (which would indicate that there is a bug in the mod).

There is an option for debugging, if you have "root permissions" (/give command). You can give yourself a minecraft:debug_stick, which Mojang uses for some of their stuff. When you wack the RLC with it, the state tooltip will contain additional information, like the PTs and ETs and states of the edge detectors, clock cache, etc. Maybe that can give us additional infos for the fix in the context of your machine/modpack. If you like you can risk a glimpse if there are some oddities visible.

Cheers, wile

Splutty commented 1 year ago

The expected behaviour is for a 200 tick (or as close as the resolution allows) after the first rising edge, not the 5 tick one I get.

And I forgot the version of course... 1.16.5-1.0.9 (Enigmatica 6 Expert 1.6.2 modpack specifically).

Next time this happens I'll op myself and smack it with a stick, see if that gives any useful info. The PT/ET states when hovering over the internal screen looked fine though (0 and 200), which made it all the more weird..

Danke.

stfwi commented 1 year ago

Hi, hmm, I retried with my current 1.16 (1.16.5-1.0.11), tried to reproduce the problem. It could be that the timing deadline fix in 1.0.10 has something to do with it. Do you have a possibility to update locally, or is your setup on a server? Mach's gut Meister, cheers,-

Splutty commented 1 year ago

I can update both client and server. Of course I haven't seen this issue since the last post...

So upgrade to 1.0.11 and report back when it happens again?

stfwi commented 1 year ago

Would be helpful, it may prevent chasing a phantom ;)

Splutty commented 1 year ago

Well. That didn't work. It ate my RLC... lol

[01:50:02] [Server thread/INFO] [minecraft/DedicatedServer]: Gave 1 [Debug Stick] to Querna [01:50:08] [Server thread/ERROR] [wi.re.ModRedstonePen/]: RLC tick exception!java.lang.NoSuchMethodError: 'long net.minecraft.util.math.MathHelper.func_226163a(long, long, long)' [01:50:08] [Server thread/WARN] [minecraft/TileEntity]: Block entity invalid: redstonepen:te_control_box @ BlockPos{x=277, y=68, z=-94}

(Not updated yet, since one of my players will need help with that..)

stfwi commented 1 year ago

Wut? func_226163_a_ is MathHelper.clamp(), that's a basic Minecraft function used all over the place (probably by all mods). Why does that bail out?. Let me double check that.

So, this was with RP version 1.0.9 , and the RLC worked normally until you wacked it with the debug stick?

Splutty commented 1 year ago

Yep. 1.0.9 still. And I don't know if it was misbehaving or if something else was wrong in my setup, that's what I was trying to figure out. But that was amusing to watch. Sorry I can't be of more help :)

Splutty commented 1 year ago

If it helps. Others in the modpack have observed the same kind of behaviour.

Splutty commented 1 year ago

Y=TP1(D.CO==2,20) does something interesting at the moment, I see TP1.ET toggle between 0 and 1, and TP1.PT at 20.

This doesn't.. Seem like normal behaviour?

(And yes, D.CO is 2 at that point)

I might just upgrade to the newer version and see if all this weird stuff goes away..

stfwi commented 1 year ago

Hi, ya, definitely update. This was fixed with the deadline scheduling. CheersOn 23 Jan 2023, at 05:15, Splutty @.***> wrote: Y=TP1(D.CO==2,20) does something interesting at the moment, I see TP1.ET toggle between 0 and 1, and TP1.PT at 20. This doesn't.. Seem like normal behaviour? (And yes, D.CO is 2 at that point) I might just upgrade to the newer version and see if all this weird stuff goes away..

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

stfwi commented 1 year ago

Hey man, to quickly double check, have you seen the problem again since updating? Cheers,-

Splutty commented 1 year ago

Haven't seen the issue, but unfortunately that doesn't really mean anything :D Hard to prove a negative.

But so far so good!

stfwi commented 1 year ago

Oky, sounds already promising. Let's keep the issue open for a few weeks or so, and close it then if no further trouble arises ;;

stfwi commented 1 year ago

"Good that", seems to be stable, let's close this one. Cheers man,-