Posted 27 January 2013 - 01:52 PM
Hello, I am new to the forums an relatively new to coding. I have some amount of experience with logic statements in general and have some familiarity with code syntax.
In my SMP server I am currently trying to hollow out a roughly 8x8 chunk mountain that is probably 10+ chunks high. On top of that I intend to line the interior surface with a block of my choosing. After spending some time using quarries and manually chiseling the interior contours, I have set out to design a turtle script to help me accomplish at least part of my task. Upon brainstorming how it would work I touched upon using a series of turtles all connected to a rednet server machine of sorts to have workers mapping out the outer contour of the mountain and workers inside reading this contour and mining appropriately. I quickly realized how over my head that would be and settled for starting small.
My current prospective program is one that would run on one mining turtle.
With T being the turtle and X being the mountain blocks,
the turtle will keep track of elevation and traverse the mountain, storing elevation for each position in an array. Upon reaching elevation 0 again, it will know to stop, turn 180 degrees and burrow in to mountain to begin lining the interior.
This is where I run in to trouble. If the slopes were all simple 1x1 stair steps, I wouldn't have a problem with simply subtracting the stored elevation with a current turtle elevation to dig and place a block under the shell block, but patterns like:
and
throw me off. Does anyone have any suggestions on an algorithm that would properly contract the voxel radius? Or even a better way of going about this project?
I had originally hoped for some way to sense more than one block in front of turtle so that I could simply mine forward until two blocks in front = air, then appropriately turn around and mine back the other way on the next row.
Thanks in advance.
EDIT: Thanks for the split, edited the formatting of my diagrams
In my SMP server I am currently trying to hollow out a roughly 8x8 chunk mountain that is probably 10+ chunks high. On top of that I intend to line the interior surface with a block of my choosing. After spending some time using quarries and manually chiseling the interior contours, I have set out to design a turtle script to help me accomplish at least part of my task. Upon brainstorming how it would work I touched upon using a series of turtles all connected to a rednet server machine of sorts to have workers mapping out the outer contour of the mountain and workers inside reading this contour and mining appropriately. I quickly realized how over my head that would be and settled for starting small.
My current prospective program is one that would run on one mining turtle.
With T being the turtle and X being the mountain blocks,
X
X X
X X
TX X
the turtle will keep track of elevation and traverse the mountain, storing elevation for each position in an array. Upon reaching elevation 0 again, it will know to stop, turn 180 degrees and burrow in to mountain to begin lining the interior.
This is where I run in to trouble. If the slopes were all simple 1x1 stair steps, I wouldn't have a problem with simply subtracting the stored elevation with a current turtle elevation to dig and place a block under the shell block, but patterns like:
X
XX
and
X
X
X
throw me off. Does anyone have any suggestions on an algorithm that would properly contract the voxel radius? Or even a better way of going about this project?
I had originally hoped for some way to sense more than one block in front of turtle so that I could simply mine forward until two blocks in front = air, then appropriately turn around and mine back the other way on the next row.
Thanks in advance.
EDIT: Thanks for the split, edited the formatting of my diagrams
Edited by