cc-tweaked/CC-Tweaked

Turtle movement yields when lots of peripherals attach/detach at once

Kan18 opened this issue · 9 comments

Kan18 commented

Minecraft Version

1.19.2

Version

1.100.9

Details

Basically: when while true do print(os.pullEvent()) end is running in a tab in a turtle's multishell, and the turtle disconnects or connects to a wired modem network with a lot of peripherals (I tested with 512 for this) when moving with turtle.forward()/turtle.back(), the turtle movement call sometimes yields until terminated. I think this might be because the peripheral attach and detach events are overflowing the event queue, but I'm not sure.

Video
Same video on different link

Logs attached although it doesn't look like anything relevant to this is showing in them: logs.zip

I forget how big the event queue is, but overflowing it does seem to be a plausible explanation.

What kind of setup do you have that means you have turtles causally going past modems with over 500 peripherals connected to the network? Could you isolate your turtles from this network, perhaps using a proxy computer if they have to interact with it? The setup in the video is very artificial.

Kan18 commented

Networks with hundreds of chests are not unheard of on SwitchCraft (To be clear, this affects 1.12, 1.19, and probably other versions but I haven't tested with them) - my base has 275 peripherals. This was how I ran into this bug initially, but I later just moved the wired modem on top of the chest so that the turtle doesn't hit it.

What's a bit interesting about this bug is that I couldn't get it to reproduce if I didn't run the while true do print(os.pullEvent()) end in the REPL in another multishell tab. The other multishell tab wasn't even focused!

Minecraft Version

1.19.2

Version

1.100.9

How are you playing on mc version 1.19.2 ? CC tweaked only supports 1.19.1 as far as I can see?

Kan18 commented

🤷‍♂️ It worked

Can you let me know which release you're using?

The latest version should work on both.