Jump to content




Advanced Mining Turtle - Ore Quarry

turtle

573 replies to this topic

#1 AustinKK

  • Members
  • 124 posts
  • LocationLeeds, UK

Posted 28 December 2012 - 06:30 AM

Hi everyone,

I know that this forum has plenty of Quarrying Mining Turtles, but I've created another one!

This turtle programs runs about 10% faster than a BuildCraft Quarry by focussing on just mining ores rather than trying to mine everything.

Speed Test and Instructions in this video (skip to 12:54 for instructions on how to download and use the program):



Code:
http://pastebin.com/3mkeUzby

Spoiler


#2 Flaeme

  • New Members
  • 1 posts

Posted 28 December 2012 - 12:46 PM

Has noone really replied to this? I plan on using it to quarry some instead of a BC quarry, looks great.

#3 Jack

  • Members
  • 19 posts

Posted 28 December 2012 - 04:48 PM

Very nice. Very well documented and explained, and very efficient. Well done.

#4 HotGirlEAN

  • Banned
  • 101 posts

Posted 28 December 2012 - 04:53 PM

Please include a pastebin link ^^;

#5 AustinKK

  • Members
  • 124 posts
  • LocationLeeds, UK

Posted 28 December 2012 - 09:02 PM

Thanks guys.

HotGirlEAN, there is a pastebin link in the original post. It is http://pastebin.com/3mkeUzby

#6 HotGirlEAN

  • Banned
  • 101 posts

Posted 28 December 2012 - 09:23 PM

Oh sorry, didn't catch that. I was distracted by the huge amount of code in my face! XD
Maybe putting it in Spoilers would be more effecient?

#7 NoStyle

  • New Members
  • 2 posts

Posted 28 December 2012 - 10:55 PM

Oh man this is awesome.
Is there a way to automatic place torches to prevent mob spawning between the layers?
What happens if he hit lava/water or a mineshaft?
Thanks for this programm

#8 AustinKK

  • Members
  • 124 posts
  • LocationLeeds, UK

Posted 28 December 2012 - 10:59 PM

Oops, yes good point HotGirlEAN :-)

(done)

#9 AustinKK

  • Members
  • 124 posts
  • LocationLeeds, UK

Posted 28 December 2012 - 11:14 PM

Hey NoStyle,

No, there is no way to place torches at the moment. I'm still considering the best way of achieving this, so I may add it. When I use the turtle I tend to do it away from my base (and use a World Anchor to keep the chunk loaded), but I guess that's not everybody wants to do.

Hitting lava/water/mineshafts are all fine. The turtle can mine items out of lava without them burning (all mining turtles can do this by default), and from water. In mineshafts, the chests will be emptied (if you configure the turtle appropriately) and it will dig out any wood/fence posts it comes across.

#10 DiEvAl

  • New Members
  • 2 posts

Posted 29 December 2012 - 06:27 AM

22:50 Challenge accepted! As a part of the challenge, I haven't and won't look at your source.

Can you make a world download?

#11 Henness

  • Members
  • 189 posts

Posted 29 December 2012 - 06:50 AM

You should check out my ore finder program i haven't tested how fast it 8s but i assume it would only take 30 min.

#12 AustinKK

  • Members
  • 124 posts
  • LocationLeeds, UK

Posted 29 December 2012 - 06:57 AM

DiEvAl,

:-)

Ok, here's the link to download the world: http://www.mediafire...afj9la87f00459y

#13 AustinKK

  • Members
  • 124 posts
  • LocationLeeds, UK

Posted 29 December 2012 - 08:40 AM

Hi Henness,

I tried the latest version of your Advanced Ore Finder on the map, but I struggled to get it to work. Not sure what I was doing wrong (really like the GUI by the way).

I've tried version 1.0, and it takes over an hour to run. Have you made some changes in the most recent version?

#14 NoStyle

  • New Members
  • 2 posts

Posted 29 December 2012 - 11:23 AM

Hey tried your program and worked fine at the beginning but after a few layer it stopped and now when i run the program it say something like "can't conect to gps" why is that? I play on a server.

Edit: I'm an idiot typed "OreQuarry 8" instead "OreQuary 8 63"

#15 abculatter_2

  • Members
  • 12 posts

Posted 29 December 2012 - 02:58 PM

I think there may be a more efficient way to mine all ores, by using the pattern used by this program:
http://www.computerc...mining-program/
And mining up and down in shafts, rather then horizontally.
Would you be able/willing to reprogram this one to use this pattern, or make a new one?

#16 Cozzimoto

  • Members
  • 215 posts
  • LocationDallas, Tx

Posted 29 December 2012 - 04:23 PM

great minds must think alike cause i made my very own quarry program that digs three layers at a time. and ive also made a unique quarry program where the turtle digs straight down and checks the 4 walls beside him and moves like the chest piece "knight" ti get 100% ground coverage. and scraps everything even those diamonds that are hiding under bedrock.

#17 abculatter_2

  • Members
  • 12 posts

Posted 29 December 2012 - 05:47 PM

View PostCozzimoto, on 29 December 2012 - 04:23 PM, said:

great minds must think alike cause i made my very own quarry program that digs three layers at a time. and ive also made a unique quarry program where the turtle digs straight down and checks the 4 walls beside him and moves like the chest piece "knight" ti get 100% ground coverage. and scraps everything even those diamonds that are hiding under bedrock.

Could you post it, please?

#18 Cozzimoto

  • Members
  • 215 posts
  • LocationDallas, Tx

Posted 29 December 2012 - 05:55 PM

its not quite finished in the matter that i want to ad some rednet stuff to have the little worker report to a console. and maybe a few other things

#19 abculatter_2

  • Members
  • 12 posts

Posted 29 December 2012 - 07:07 PM

Mkay, that's fine. Just post it whenever it's ready.

#20 AustinKK

  • Members
  • 124 posts
  • LocationLeeds, UK

Posted 29 December 2012 - 11:36 PM

Hey abculatter_2, Cozzimoto,

I tried the pattern that you are talking about (and great minds must think alike, because I called it the "Knight's Tour" as well!).

I've got a version somewhere, but didn't finish it because I was specifically trying to make something faster than the BuildCraft Quarry, but couldn't see how the Knight's Tour could be the optimal mining approach. I'll break down my logic so you can see where I'm coming from:

In my tests I get the following times to perform turtle actions:

Move (forward/back/up/down): 0.4s
Turn (right/left): 0.4s
Dig (up/down/front): 0.4s
Detect (front/up/down): 0.05s
Compare (front/up/down): 0.05s

The key point is that moving, digging and turning the turtle take the same amount of time. Also, they take much longer than doing a detect or a compare. To optimise the mining speed I therefore tried to reduce the number of moves/digs/turns.


Note that the speed to detect/compare is pretty negligible, and therefore in most cases can be ignored. So when I was designing the most efficient mining pattern I was focussing on minimising the number of move/turn/dig actions that the turtle performed. All of these take the same amount of time, so I will just call them "actions".

It is however interesting to note that for any one block, if you do a 1xdetect() and then 7xcompare(), you might as well have dug the block as it would have taken the same amount of time. Therefore if you, on average, need to do more than 7 compares and 1 detect before deciding whether to dig a block, you might as well just dig it. In my video, I'm checking against 5 items each time (the 4 noise blocks and the chest), however it is designed to "fail fast", so that if it finds a match, then it doesn't need to check the rest. It is for this reason that the turtle mines quickest if you put the noise blocks in the order that they are most likely to be found (you should definitely always put stone in the first inventory slot, the rest are less important).


So focussing purely on the turtle's actions (i.e. move/turn/dig), assuming that the turtle is in a solid section of the world (so that it has to dig to go any direction), then you get the following timings assuming that the Knight's Tour is vertical (it is more efficient than doing it horizontally where you would have to turn 4 times to get back to facing in the same direction):

Knight's Tour: 1 x dig, 1 x move, 3 x turn (checks 5 blocks - the one that was moved into and the surrounding 4). This is a total of 2.0s
Mine every 3rd Layer: 1 x dig, 1 x move (checks 3 blocks - the one that was moved into and the 2 that are above and below). This is a total of 0.8s

Therefore the Knight's Tour takes 0.4s per block and the mine every 3rd layer approach takes 0.27s per block.

This isn't the full story because if the Knight's Tour was mining vertically then it wouldn't need to turn at the end of every row like mining every 3rd layer does. This adds two additional turns to each row. The timing impact of this depends on the size of the area being mined - in my example where an 8 x 8 area is being mined, this is effectively an additional turn every 12 blocks checked. So, you need to add .03s per block to allow for this. Note, the impact of this becomes smaller as the mining area becomes larger.

Therefore the time per block for a Knight's Tour is 0.4s per block compared to a total of 0.3s per block when mining every third layer.


By comparison, if the turtle were in an area with no blocks (and hence can move without digging), then the timings would be as follows:

Knight's Tour: 1 x move, 3 x turn (checks 5 blocks). This is a total of 4 actions = 1.6s
Mine every 3rd Layer: 1 x move (checks 3 blocks). This is a total of 1 action = 0.4s

When you add in the additional turn at the end of each row, you get 0.32s per block for the Knight's Tour and 0.17s for mining every third layer.


In theory you should also add the amount of time that the turtle takes to get from one mining row to the next and also to return to the start. Also, checking each block against items in the inventory has some impact. However, all programs will need to do this to some extent, so neither effect the overall timings significantly.

In both instances, based on my calculations, the Knight's Tour isn't the optimal approach.

I would be interested if anyone else has a different view.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users