This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
matejdro's profile picture

[1.3] turtle.isInLoadedChunk()

Started by matejdro, 02 June 2012 - 10:30 PM
matejdro #1
Posted 03 June 2012 - 12:30 AM
I guess it would save a lot of headaches. Simple check that would prevent turtles from wandering of into unloaded chunks.
Cloudy #2
Posted 03 June 2012 - 12:40 AM
This bug is fixed in the next version - if turtles hit an unloaded chunk they just won't move into it. Better than providing that function.
Luanub #3
Posted 03 June 2012 - 01:24 AM
I think it would just be best to just have them load the chunks, or work in unloaded chunks. Buildcraft and IC2 machines keep running when you leave the chunks, it shouldnt be to hard to do it with CC too.

It defeats the purpose of using the turtles to automate certain functions. One of the main benefits of using the turtle is to automate it so you can do something else. Its kind of hard to do that though if when you get to far away they stop working. You pretty much have to baby sit them so they keep working.

I've also had problems with request systems where the main computer that receives the request ends up with the chunk unloading and ends up not receiving the request. It was fairly simple to work around but you really shouldn't have to.

My computer at home stays on with the programs working if I'm a block away, a mile away, a state away, I can even be in another country and it doesn't matter, why do CC computer shut down?
PixelToast #4
Posted 03 June 2012 - 01:39 AM
if you load the chunk then you could have a turtle going on forever using up alot of memory
Luanub #5
Posted 03 June 2012 - 01:54 AM
if you load the chunk then you could have a turtle going on forever using up alot of memory

The chunks the turtle leaves would unload, only the chunk the turtle/computer is in would be loaded which is allot less then what one player loads.
kazagistar #6
Posted 03 June 2012 - 02:39 AM
Turtles can automatically collect the materials to make more turtles. You could just leave one turtle and a turtle factory running on a server, and the whole server would grind to a standstill in days as the turtles multiplied until the factory was constantly running at max capactity, then run off exploring in various random directions.
D3matt #7
Posted 03 June 2012 - 06:17 AM
Turtles can automatically collect the materials to make more turtles. You could just leave one turtle and a turtle factory running on a server, and the whole server would grind to a standstill in days as the turtles multiplied until the factory was constantly running at max capactity, then run off exploring in various random directions.
If crashing a server is your goal, there are a lot easier (and less obvious) ways to do so. I'd be more concerned about the CPU and RAM usage of the turtles themselves than the chunks being loaded by them, anyway. At least make it an OPTION.
Cloudy #8
Posted 03 June 2012 - 07:58 AM
I just thought I'd point out that IC2 and BC machines do not keep running when the chunks are unloaded.

I will look into turtles loading chunks as they go, and computers staying active - but it will be a configuration option. Not every server owner will want that behavior.
Luanub #9
Posted 03 June 2012 - 11:44 AM
You sure they dont? I move liquids through unloaded chunks and my bc engine generator seems to produce power even though I'm far enough away that its in an unloaded chunk. I work from pretty far locations sometimes especially when I'm "drilling" for oil.

Maybe it's just part of the "magic" portion of those mods that Dan doesn't want to implement into CC not sure…
matejdro #10
Posted 03 June 2012 - 11:44 AM
This bug is fixed in the next version - if turtles hit an unloaded chunk they just won't move into it. Better than providing that function.

Good to hear that.

I have lost way too many turtles (and diamonds) when there was a bug in my script and turtle just wandered off into random direction and then disappeared when chunk was unloaded.
Pinkishu #11
Posted 03 June 2012 - 01:26 PM
You sure they dont? I move liquids through unloaded chunks and my bc engine generator seems to produce power even though I'm far enough away that its in an unloaded chunk. I work from pretty far locations sometimes especially when I'm "drilling" for oil.

Maybe it's just part of the "magic" portion of those mods that Dan doesn't want to implement into CC not sure…

Quite sure at that, thats why the BC pipes Addon has a Chunkloading block for example
And servers warn you about that your engine might not get cooling water if the pumps are in an unloaded chunk
Teraminer #12
Posted 03 June 2012 - 02:08 PM
Turtle + Teleport Tether = Mobile Chunk Loader
matejdro #13
Posted 03 June 2012 - 02:22 PM
Turtle + Teleport Tether = Mobile Chunk Loader

You still have to place teleport tether every 45 or so blocks, which adds quite complexity to your program.
Pinkishu #14
Posted 03 June 2012 - 02:34 PM
Turtle + Teleport Tether = Mobile Chunk Loader

You still have to place teleport tether every 45 or so blocks, which adds quite complexity to your program.

if you call that complex xD
matejdro #15
Posted 03 June 2012 - 02:50 PM
Not complex in terms of programming but in terms of usage (you have to keep supplying it with teleport tethers). Or maybe complex was not proper word. Maybe "not as convenient" would be better :)/>/>

But main point of this post is when your script is buggy and turtle decides to go into random direction in straight line. Then it would eventually run out of teleport tethers and wander into unloaded chunk.
D3matt #16
Posted 04 June 2012 - 10:02 AM
[derp]
Teraminer #17
Posted 04 June 2012 - 06:17 PM
I ment the turtle is a teleport tether ( loads chunks ) would be distractive
matejdro #18
Posted 05 June 2012 - 08:58 PM
After some testing, I have found out that even with teleport tethers, turtle will still reboot when I disconnect (so chunk near me will unload). Not sure if this is bug in Bukkit port, but teleport tethers appears to work fine otherwise (I have IC2 factory in nether and it's producing matter even when nobody is in the nether)
Teraminer #19
Posted 06 June 2012 - 11:36 AM
Nobody in the Nether and it works (SSP or SMP)?
matejdro #20
Posted 06 June 2012 - 04:56 PM
smp - bukkit.

But only IC2 and BC machines works. Turtles don't.
Cloudy #21
Posted 06 June 2012 - 05:41 PM
After some testing, I have found out that even with teleport tethers, turtle will still reboot when I disconnect (so chunk near me will unload). Not sure if this is bug in Bukkit port, but teleport tethers appears to work fine otherwise (I have IC2 factory in nether and it's producing matter even when nobody is in the nether)

That's weird - the turtle shouldn't be unloading at all unless the chunk is being unloaded. I'll look into it when I'm back.
matejdro #22
Posted 07 June 2012 - 10:46 AM
Scratch that. Apparently teleport tethers do not work when they are intersecting (probably bug). I had one teleport tether in nether, but shitload of them in mining area where turtle was mining, so that was probably the issue.
matejdro #23
Posted 08 June 2012 - 06:39 AM
(sorry for double post)

I think that even with protection, a method that would detect if block in front of you is loaded or not, would be useful. Especially in enviroments, where number of loaded chunks is static (like World Anchor or Teleport Tether).

Imagine going somewhere away, placing World Anchor, starting turtle and then walking away. Using this method, turtle could automatically detect where World Anchor boundaries are and it will stay inside those boundaries.