Jump to content




Turtle mining swarm

turtle wireless

147 replies to this topic

#21 HibachiTime

  • New Members
  • 1 posts

Posted 12 February 2014 - 09:42 AM

Will this program work with vanilla ender chests? I'm looking at using this program for feed the beast tech world 2 which does not use the ender chests that you appear to be using in your showcase video.

#22 joebodo

  • Members
  • 69 posts

Posted 12 February 2014 - 12:15 PM

Another new version is added to the OP (v0.60). I made the resume logic a bit more fail safe. Also, some tweaks to the UI, movement logic, and logging were added. I have been running tests with 20 mine workers and the resume logic is working very well.

Edit: Forgot to mention that there is a setup program now. The setup program configures the startup file according to the role that is selected (the OP is updated with new instructions).

Edited by joebodo, 12 February 2014 - 12:17 PM.


#23 HeffeD

  • Members
  • 61 posts

Posted 12 February 2014 - 12:21 PM

I've now witnessed several resume cycles where mining turtles are left behind.

I've seen instances in which the turtle sits there at the bottom of its borehole, broadcasting the idle status message. The turtles that have been picked up continue mining, and eventually leave the idle turtle behind. You can terminate the script and either reboot or run the script to try again.

I've also seen instances where the turtle unpacks the script components, then exits the script, (no error message) leaving you at the command prompt.

In one odd instance, I located the stalled turtle and it was broadcasting the idle message, so I needed to terminate and restart. It took three tries before the turtle started broadcasting the alive status and the mining boss came to pick it up. However, before picking up the turtle, it broke both of the spot loaders, (dropping them to the ground, much like it does when encountering any obstacles while moving...) then picked up the miner and deployed it. I gathered up the spot loaders and put them back in the mining boss' inventory, and I'm currently monitoring this instance to see what happens next.

Edit: Woops, was typing this post when you posted your latest, joebodo. I'll abandon this test and start fresh with the new version. :)

Edited by HeffeD, 12 February 2014 - 12:23 PM.


#24 joebodo

  • Members
  • 69 posts

Posted 12 February 2014 - 12:57 PM

View PostHibachiTime, on 12 February 2014 - 09:42 AM, said:

Will this program work with vanilla ender chests? I'm looking at using this program for feed the beast tech world 2 which does not use the ender chests that you appear to be using in your showcase video.

I tried using the default ender chests in a 1.5 world without luck. A quick test to see if this will work in your world is this:

Place down a turtle and add some items to slot 1. Place the chest above the turtle. In the turtle console, do these steps:
> lua <enter>
lua> turtle.dropUp() <enter>

If the items go into the chest, then using them should be fine.

#25 HeffeD

  • Members
  • 61 posts

Posted 12 February 2014 - 02:23 PM

With the latest version, turtles can still be left behind after a resume attempt. I had to locate the wayward turtle and found that it was at the command prompt after switching to the swarm directory. No error message. It's almost like this is a general ComputerCraft issue and nothing to do with your code. It's a bit like it started running the startup script, then just gave up without completing the startup directives. I would definitely expect some sort of error message instead of just sitting at the command prompt if it was a problem with your code... :wacko:

Your latest version also relabels the turtles. This is a good idea, but would it be possible to use a shorter name? As it is now, when you check the status on the mining boss, you just see a list of: "mineWorker_", which isn't very descriptive. I'd like to see the number of the turtle as well. This of course may be due to the fact that I run Minecraft windowed, so perhaps my GUI scale is different than yours. (Does the GUI scale in ComputerCraft?)

#26 joebodo

  • Members
  • 69 posts

Posted 12 February 2014 - 03:45 PM

View PostHeffeD, on 12 February 2014 - 02:23 PM, said:

No error message. It's almost like this is a general ComputerCraft issue and nothing to do with your code.

I wasn't sure if anyone else experienced this but me. From what I see, it appears to be a bug in rednet.broadcast. It doesn't happen very often, but upon doing the broadcast, the program just exits :(

I think i can work around this issue. I should be able to post a new version tonight that will contain the work-around.

View PostHeffeD, on 12 February 2014 - 02:23 PM, said:

As it is now, when you check the status on the mining boss, you just see a list of: "mineWorker_", which isn't very descriptive. I'd like to see the number of the turtle as well. This of course may be due to the fact that I run Minecraft windowed, so perhaps my GUI scale is different than yours. (Does the GUI scale in ComputerCraft?)

Oops ! I'll post this fix tonight as well. I believe the size of the console is the same regardless of GUI size.

#27 joebodo

  • Members
  • 69 posts

Posted 12 February 2014 - 10:18 PM

View PostHeffeD, on 12 February 2014 - 02:23 PM, said:

With the latest version, turtles can still be left behind after a resume attempt...

Another version is added to the OP (v.07). I really like this one. There are some major changes to the way rescues / deploying / pickups are done. It was way too random before - now there is some precedence as to what needs to be done first.

I'm just hoping I didn't make any silly mistakes :) ...

#28 judos

  • New Members
  • 1 posts

Posted 14 February 2014 - 07:23 AM

Hi,

The Video is amazing. I'll try this program asap. :D
One question: How do you get the turtle to check all four blocks around them if they mine 1x1 straight down to bedrock? I've looked in the turtle API but it says nothing about comparing blocks on the left,right,back -side of the turtle. And in your video I don't see a turtle turning around. So how does that work to make sure you find all ores? :unsure:

Cheers,
judos

#29 HeffeD

  • Members
  • 61 posts

Posted 14 February 2014 - 12:02 PM

View Postjudos, on 14 February 2014 - 07:23 AM, said:

One question: How do you get the turtle to check all four blocks around them if they mine 1x1 straight down to bedrock? I've looked in the turtle API but it says nothing about comparing blocks on the left,right,back -side of the turtle. And in your video I don't see a turtle turning around. So how does that work to make sure you find all ores? :unsure:

The turtles do turn. Both on the trip down, and the trip up. Between the two, they get almost all of the ore. (There are a few ore blocks left along the chunk edges)

Joebodo, still having turtles abandoned on restart with v.07. No errors, just a turtle sitting there saying "mineWorker started..." I tried rebooting several times, (same result: mineWorker started...) but the mining boss wouldn't come and pick it up. I finally broke it and took it to the surface. This time it was picked up, which makes me think it could have been a range issue. Although I didn't think to check how deep the miner was, I'm guessing it was below layer 10 and the turtle was near the front of the chunk being mined, with the mining boss at the back. So it was easily over 64 blocks. I know the transmission range increases with height, but since the mining boss was only at layer 74, the range increase is probably not very much.

Edit: I just went back and checked the hole. The turtle was at layer 3. (I use thermal expansion and have it configured to flatten the bedrock layer, so there is only a single layer of bedrock at layer 1)

I don't know how to get around this issue without going to extreme lengths like placing a satellite at max world height or having the mining boss go up into the air to listen for miners... Seems like a lot of effort for a rare case. (if the issue was indeed range...)

Edited by HeffeD, 14 February 2014 - 12:10 PM.


#30 joebodo

  • Members
  • 69 posts

Posted 14 February 2014 - 08:53 PM

View Postjudos, on 14 February 2014 - 07:23 AM, said:

And in your video I don't see a turtle turning around. So how does that work to make sure you find all ores? :unsure:
That was my first YouTube video. I had another clip where it showed the miners corkscrewing down, but I couldn't figure out how to edit the video :)

View PostHeffeD, on 14 February 2014 - 12:02 PM, said:

Edit: I just went back and checked the hole. The turtle was at layer 3. (I use thermal expansion and have it configured to flatten the bedrock layer, so there is only a single layer of bedrock at layer 1)

I reproduced this problem. I put a turtle at layer 3 and experienced what you saw. It appears that when turtles are below layer 6, rednet distance is shortened (or non-existent). To fix this, I move the miner up a few blocks upon restart if I know that he has mined down. Tests so far seem to show this working fine. I'll post a new version once I'm done testing this (hopefully tonight).

Thanks for the good clues.

Edited by joebodo, 14 February 2014 - 08:55 PM.


#31 HeffeD

  • Members
  • 61 posts

Posted 15 February 2014 - 04:27 PM

View Postjoebodo, on 14 February 2014 - 08:53 PM, said:

To fix this, I move the miner up a few blocks upon restart if I know that he has mined down.

Well that's a pretty simple fix. :) I don't know why I didn't think of that...

#32 joebodo

  • Members
  • 69 posts

Posted 15 February 2014 - 05:19 PM

View PostHeffeD, on 15 February 2014 - 04:27 PM, said:

View Postjoebodo, on 14 February 2014 - 08:53 PM, said:

To fix this, I move the miner up a few blocks upon restart if I know that he has mined down.

Well that's a pretty simple fix. :) I don't know why I didn't think of that...
Ha ha, reminds me of when I didn't think to suck things out of the chests before breaking them :D

BTW, I new version is in the OP.

#33 sjkeegs

  • Members
  • 75 posts

Posted 16 February 2014 - 03:33 PM

View Postjoebodo, on 14 February 2014 - 08:53 PM, said:

I reproduced this problem. I put a turtle at layer 3 and experienced what you saw. It appears that when turtles are below layer 6, rednet distance is shortened (or non-existent). To fix this, I move the miner up a few blocks upon restart if I know that he has mined down. Tests so far seem to show this working fine. I'll post a new version once I'm done testing this (hopefully tonight).

Thanks for the good clues.

Modem communication distance is a minimum of 64 blocks at layer 64 and up to 384 at maximum altitude. This range can be reduced by weather conditions (Thunder). So any turtle at sea level will only be able to contact another turtle at level 1 if it is directly below it. Distance is computed x2 + y2 + z2 = dist2. It should be pretty simple to figure out how far up they need to go up to regain contact.

This actually reminded me that I need to take thunder into account in one of my programs (I'd forgotten that bit)

Wiki Page -> http://www.computerc.../Wireless_Modem

#34 joebodo

  • Members
  • 69 posts

Posted 16 February 2014 - 07:10 PM

View Postsjkeegs, on 16 February 2014 - 03:33 PM, said:

So any turtle at sea level will only be able to contact another turtle at level 1 if it is directly below it.

This was my understanding as well, but testing showed otherwise (cc 1.5.7). I can provide more details if you are interested.

#35 sjkeegs

  • Members
  • 75 posts

Posted 17 February 2014 - 09:28 AM

View Postjoebodo, on 16 February 2014 - 07:10 PM, said:

I can provide more details if you are interested.
Please do,

#36 joebodo

  • Members
  • 69 posts

Posted 17 February 2014 - 10:01 AM

View Postsjkeegs, on 17 February 2014 - 09:28 AM, said:

View Postjoebodo, on 16 February 2014 - 07:10 PM, said:

I can provide more details if you are interested.
Please do,

Turtle 1 is at level 120
Turtle 2 is at level 3 directly below Turtle 1 (F3 shows feet at 3)

Turtle 2 is broadcasting a ping type message (rednet.broadcast)
Turtle 1 is listening for ping type messages

Turtle 1 receives nothing unless turtle 2 is above level 6 (was either 6 or 7)

Really bizarre - totally different from my understanding of how rednet works. If it only happened to me, then I would think it was a world issue, but it's also happening to HeffeD. It appears to be easily reproducible.

#37 joebodo

  • Members
  • 69 posts

Posted 17 February 2014 - 10:14 AM

View PostHeffeD, on 02 February 2014 - 03:07 PM, said:

I've been trying to determine what your script does when a turtle encounters a dungeon chest, or a storage minecart in a mineshaft. It appears that it just breaks them and doesn't attempt to suck up the loot?

Should collect everything now!

View PostHeffeD, on 02 February 2014 - 03:07 PM, said:

Another comment that I feel could improve the script would be to allow the user to set boundaries. I think it's great that you can start the mining process and basically just let it go until it hits the far lands, but I tend to like to mine certain areas. Like extreme hills biomes. So it would be great if you could tell it you wanted to mine a 4x4 chunk area, for example. In order to keep the chunks loaded, (using spot loaders) you could serpentine through the area.

Finally got this working (took me awhile). You can now specify how the number of chunks to mine It will create concentric circles around the starting point until it reaches that number. Kinda like this:

10 11 12 13
 9  2  3 14
 8  1  4 15
 7  6  5

I should have this posted by tonight - just a bit more testing needed.

Edited by joebodo, 17 February 2014 - 10:14 AM.


#38 HeffeD

  • Members
  • 61 posts

Posted 17 February 2014 - 03:27 PM

View Postjoebodo, on 17 February 2014 - 10:14 AM, said:

I should have this posted by tonight - just a bit more testing needed.

Sounds great! Looking forward to trying it out. :)

Oh, and on the topic of rednet range, weather is never an issue with me. I think the rain in Minecraft is annoying, so I have weather disabled.

#39 joebodo

  • Members
  • 69 posts

Posted 17 February 2014 - 04:39 PM

View PostHeffeD, on 17 February 2014 - 03:27 PM, said:

View Postjoebodo, on 17 February 2014 - 10:14 AM, said:

I should have this posted by tonight - just a bit more testing needed.

Sounds great! Looking forward to trying it out. :)

Oh, and on the topic of rednet range, weather is never an issue with me. I think the rain in Minecraft is annoying, so I have weather disabled.

how ? HOW ?

#40 HeffeD

  • Members
  • 61 posts

Posted 17 February 2014 - 08:52 PM

View Postjoebodo, on 17 February 2014 - 04:39 PM, said:

how ? HOW ?

The Optifine mod allows you to turn off the weather.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users