Cannot reliably track turtles rotation
Closed this issue ยท 6 comments
Minecraft Version
1.20.1
Version
Last
Details
Currently, it is possible to track turtle's movement (up down forward backwards) using the fuel value (it will only go down if we moved, we can then find last value and movement direction like LAMA does and calculate our new position). BUT, while we can track theses moves accurately because of fuel count, we cannot track rotation.
Now here is an idea that will enable us to validate our current rotation with what we do have in memory/storage.
Every turtle has a turnID, or rotationHash. Basically, all we need is something that will invariably change when using turtle.turnLeft() or turtle.turnRight().
Here is a simple overflowing 2 bits counter in lua that will tell us a lot more about our current vs past rotation setting. (It'd be best to have it in java for persistence)
counter = (counter + 1) & 0x3 -- mask to 2 bits (0x3 = binary 11)
This being implement on the mod-side in a read-only way would be a nice way to make computercraft turtle reliable at moving, simply, while programming to retain accurate position will be the costs versus establishing unreliable gps networks.
I will admit i was under impression that turtle turn operations always succeeded once called? Have you encountered cases where it didn't?
I believe what issue is referring to is the fact that if turtle was interrupted just between turning and saving this state on the disk, there is no way to recover from this without gps and turtle movements
I will admit i was under impression that turtle turn operations always succeeded once called? Have you encountered cases where it didn't?
Well, just like SirEdvin said, we cannot teliably track turtles if they get shutdown after saving our the new rotation and before turning (that order is better because saving to file takes more time than turning.
I'll look into the alternatives like directionnal block nbt or using gps only to find out the orientation not the position.
using gps only to find out the orientation not the position.
That operation usually requires a gps.locate call, doing a movement, and second call, then comparing positions you got to deduce which direction you are facing (you moved in direction you are facing)
using gps only to find out the orientation not the position.
That operation usually requires a gps.locate call, doing a movement, and second call, then comparing positions you got to deduce which direction you are facing (you moved in direction you are facing).
I think no one likes the unreliable and slow gps that has to have chunkloaded atennas and preplaced antenna stations, and has no range at all (not including ender modems, as they should be an upgrade not a necessity).
I mean, theses turtles are such advanced tech, with so much potential, does't seem that bad to have the same workaround for turn than there is for move().
LAMA is currently not reliable for turns.
If it places a directional block it may get interrupted at any time, making this overly complicated, we have to track an item's quantity at reload to verify if we just placed a block, and also we're using a full item slot only to gather info on our direction.
Remember, we may get interrupted any time.
Now using that gps to find out the facing direction we may just walk out into an unloaded chunk.
GPS CANNOT be used to find out direction it seems, because of this simple reason.
The only way to reliably track turtle locations is to place a block and magically get the information out of thin air, something that should have to be computed or inferred by a normal computercraft mechanic, not this kind of bypass where the information is read out a json ?
Additionally, inspired by another post, I believe inspecting a block should give you relative information about the block's orientation, not absolute, this would make computing the most important.
Now if inspecting a block were to return relative directions, we'd have no natural reliable way of finding out our facing direction. (Appart from placing a second turtle that could answer if the chunks are loaded before moving to the new location, then gps, or some more goofy stuff).
Now there's talks of making the lua VM states persistent, which would result in the same, as we would be able to store the direction in memory persistently.