CC: Tweaked

CC: Tweaked

42M Downloads

Documentation on gameplay in relation to chunks loading?

Skjolbir opened this issue ยท 4 comments

commented

Hi, can we get some documentation written up for how turtles interact with chunks?
Having just ran a test on my SMP server, I put down a turtle with the instructions to basically strip mine 500 blocks forwards, then teleported myself away 1000 blocks. Having returned moments later, the turtle had ceases the program, and seemed to restart its OS, as I was kicked back to the root directory.

Trying to figure out what if I need a limit on how many blocks my turtles will stripmine away from myself before they 'breakdown'.
I see the old CC mod had a CC peripherals+ mod that had turtle chunks loaders, but that kinda breaks the fourth wall for me, im happy to keep within loaded chunks, I just need to know how turtles interact with chunk loading. Are they like mobs, with a limit of a few hundred blocks?

commented

I think the issue with any heuristic like this is that it ends up being flawed.

For instance, while we can determine if you're close to the border of a loaded chunk, that's no good if a player teleports, or the chunk is loaded by other means (chunkloader, etc...). We can't predict when these will be unloaded, so you're back to the beginning.

Obviously it might be better than nothing, but if we add it, it's something we need to commit to supporting forever more. If we're doing that, I want to make sure we get it right.

commented

Turtles are just tile entities, so as long as they stay within loaded chucks they should be ticked as normal. There's no distance cap from a player, so a normal chunk loader should work.

Having returned moments later, the turtle had ceases the program, and seemed to restart its OS, as I was kicked back to the root directory.

Yep. Unfortunately computers restart whenever they're unloaded/reloaded. There's some work in progress to change this (#535), but it's still a long way off.

commented

So I'm literally just jumping into CC tweaked, and have a brief look at the above issues across a few github posts, so correct me if i am wrong.
From what I saw, when a chunk unloads, theres no time for the computer to register that as an event without holding up the chunk unloading.
But what if the computer registered an event before before a chunk unloads.
From what I can see here: https://minecraft.gamepedia.com/File:Spawn_chunks_range.png
, the chunks unload when they are at that 34 level right, but the 32/33 chunks are loaded, albeit with reduced functionality.

Cant we have the computer say "hey, im in a chunk quite close to the border of loaded area, I'm going to pre-emptively fire a turnOff event and do whatever I need to do to save my state for when I am in a chunk with a less perilous ticket (31 or below etc)"

commented

Very good points. Wish you the best of luck in this, and while I am here, cheers for an absolutely fantastic mod.