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

Skynet Turtles [Theory]

Started by ace5000, 18 December 2012 - 02:17 PM
ace5000 #1
Posted 18 December 2012 - 03:17 PM
I originally posted this on the FTB forums, but this seems like a much more efficient place to theorize the feasibility of the project.

So, I was beginning to learn the very basics of turtle capabilities today, and without going into any significant knowledge of them, I propose the following:

The "Skynet Initiative" consists of turtles that originate from a single, one-command "mother" turtle, and eventually expand into an intentionally limited amount of self-sustaining, self-replicating turtles capable of nearly every task.
Let's say you have a program, "Skynet.exe", that, when ran, begins a cycle. You place down a single crafty mining turtle with a stack of coal, and run the program. The turtle searches around, finds a tree, chops it and all of it's leaves down, returns, places the saplings uniformly, places a chest, stores it's excess materials, designates a "home" block for itself, and begins mining. The turtle first gains enough materials to create a generator and a macerator, as well as a furnace for charcoal. It then creates the macerator, and powers it with the generator, and begins gaining materials to craft another, say, 6 turtles, as well as a computer which it sends binary using placed and broken redstone. This computer programs the new turtles to do various tasks together in order to advance the growing turtle militia. We'll say three mine, one manages inventories and creation of blocks (from crafting to sorting to distribution), two build the machines and buildings and pipes required to power the machines and turtles, and the last manages the creation and programming of other turtles. Eventually, you have a gigantic number of turtles doing everything. Mining, creating hybrid solar arrays, building obsidian towers, managing a preset border with melee turtles, hunting, fueling, checking… Ruling the world. These turtles never stop. They will eventually stop expanding, but at that point, they are self-sustaining monsters capable of everything.
I have no idea as to the limitations of this, but I would love to have input on the matter from all of you. That is why I post this here.
theoriginalbit #2
Posted 18 December 2012 - 03:30 PM
ok might i just say wow, have fun, thats gunna be some serious code and some serious AI. EDIT: But when its done it would be cool!

One limitation will be that the turtle doesn't know what any blocks are, so you will need at least one wood, and iron ore and coal ore, etc so it can know what its looking for when its searching for materials. also there is a limit to how far rednet can broadcast. other than that I don't see any major limitations. and even these limitations have ways around them, e.g. give the turtle the stuff so it knows, and when a turtle cant talk to the main computer (or at least when it thinks it can't, maybe have it remember the distance from the computer and check if its out of range, distance is the 3rd parameter returned from rednet.receive( ) ) have it relay the message back through a closer turtle, and/or place down a computer to act as a "repeater" of sorts closer to "boost' the signal.

to answer a probable question you may have later: no a turtle cannot directly load a program onto a computer or another turtle, however there is a work around.

1. Have it place a disk drive
2. Have it place a disk in the drive (requires 1.4.x obviously) that has a startup file that installs a startup file to the root directory (through using file open, write and close)
3. Have it place the computer or turtle beside the disk drive
4. Have it use peripheral.call("front", "turnOn") to turn on the computer/turtle
5. Collect the disk
6. Collect the drive
7. Done
ace5000 #3
Posted 18 December 2012 - 03:43 PM
ok might i just say wow, have fun, thats gunna be some serious code and some serious AI. EDIT: But when its done it would be cool!

One limitation will be that the turtle doesn't know what any blocks are, so you will need at least one wood, and iron ore and coal ore, etc so it can know what its looking for when its searching for materials. also there is a limit to how far rednet can broadcast. other than that I don't see any major limitations. and even these limitations have ways around them, e.g. give the turtle the stuff so it knows, and when a turtle cant talk to the main computer (or at least when it thinks it can't, maybe have it remember the distance from the computer and check if its out of range, distance is the 3rd parameter returned from rednet.receive( ) ) have it relay the message back through a closer turtle, and/or place down a computer to act as a "repeater" of sorts closer to "boost' the signal.

to answer a probable question you may have later: no a turtle cannot directly load a program onto a computer or another turtle, however there is a work around.

1. Have it place a disk drive
2. Have it place a disk in the drive (requires 1.4.x obviously) that has a startup file that installs a startup file to the root directory (through using file open, write and close)
3. Have it place the computer or turtle beside the disk drive
4. Have it use peripheral.call("front", "turnOn") to turn on the computer/turtle
5. Collect the disk
6. Collect the drive
7. Done

Thank you so much for the help. I am sure I will end up needing a lot of it, once I know a bit of what I'm doing :P/>
ViperSRT3g #4
Posted 18 December 2012 - 04:03 PM
Oh this sounds bad assssss, interested to see this project progress. I'd love to contribute, but I only started working with Lua and turtles just the other day. Sadface.
Lyqyd #5
Posted 18 December 2012 - 05:41 PM
The beginning stages of this sound like a challenge that was posed a while back. I'm sure the topic is somewhere in General still, maybe a few pages down.
Orwell #6
Posted 18 December 2012 - 06:00 PM
I was thinking of that one too: http://www.computercraft.info/forums2/index.php?/topic/4462-competition
digpoe #7
Posted 19 December 2012 - 08:54 AM
I suppose the easiest way do do this is:
mother computer places turtle, with a disk drive next to it with a startup program in it.
mother computer uses "peripheral.call("front", "turnOn")" command to turn on the turtle.
turtle does jobs.
mother computer repeats cycle.
Orwell #8
Posted 19 December 2012 - 09:06 AM
to answer a probable question you may have later: no a turtle cannot directly load a program onto a computer or another turtle, however there is a work around.

1. Have it place a disk drive
2. Have it place a disk in the drive (requires 1.4.x obviously) that has a startup file that installs a startup file to the root directory (through using file open, write and close)
3. Have it place the computer or turtle beside the disk drive
4. Have it use peripheral.call("front", "turnOn") to turn on the computer/turtle
5. Collect the disk
6. Collect the drive
7. Done
I suppose the easiest way do do this is:
mother computer places turtle, with a disk drive next to it with a startup program in it.
mother computer uses "peripheral.call("front", "turnOn")" command to turn on the turtle.
turtle does jobs.
mother computer repeats cycle.

TheOriginalBIT said exactly the same earlier in this thread.. And that's just a really, really small part of the problem.
digpoe #9
Posted 19 December 2012 - 09:16 AM
to answer a probable question you may have later: no a turtle cannot directly load a program onto a computer or another turtle, however there is a work around.

1. Have it place a disk drive
2. Have it place a disk in the drive (requires 1.4.x obviously) that has a startup file that installs a startup file to the root directory (through using file open, write and close)
3. Have it place the computer or turtle beside the disk drive
4. Have it use peripheral.call("front", "turnOn") to turn on the computer/turtle
5. Collect the disk
6. Collect the drive
7. Done
I suppose the easiest way do do this is:
mother computer places turtle, with a disk drive next to it with a startup program in it.
mother computer uses "peripheral.call("front", "turnOn")" command to turn on the turtle.
turtle does jobs.
mother computer repeats cycle.

TheOriginalBIT said exactly the same earlier in this thread.. And that's just a really, really small part of the problem.
Oh, I didn't read it fully. But mine in a way is slightly different, as if you watch Direwolf20's Season 3 SMP series one of the episodes he goes to an age where there's a turtle placing other turtles and turning them on, pretty much in the cycle I did it.
Orwell #10
Posted 19 December 2012 - 09:24 AM
to answer a probable question you may have later: no a turtle cannot directly load a program onto a computer or another turtle, however there is a work around.

1. Have it place a disk drive
2. Have it place a disk in the drive (requires 1.4.x obviously) that has a startup file that installs a startup file to the root directory (through using file open, write and close)
3. Have it place the computer or turtle beside the disk drive
4. Have it use peripheral.call("front", "turnOn") to turn on the computer/turtle
5. Collect the disk
6. Collect the drive
7. Done
I suppose the easiest way do do this is:
mother computer places turtle, with a disk drive next to it with a startup program in it.
mother computer uses "peripheral.call("front", "turnOn")" command to turn on the turtle.
turtle does jobs.
mother computer repeats cycle.

TheOriginalBIT said exactly the same earlier in this thread.. And that's just a really, really small part of the problem.
Oh, I didn't read it fully. But mine in a way is slightly different, as if you watch Direwolf20's Season 3 SMP series one of the episodes he goes to an age where there's a turtle placing other turtles and turning them on, pretty much in the cycle I did it.
Well, repeat TheOriginalBIT's step 3 and 4 continuously and you have the exact same thing. My point is that this bit is quite obvious and that the other parts definitely aren't. Try making a turtle with AI that gathers all resources to create new ones AND keeps itself fueled, etc…
ChunLing #11
Posted 19 December 2012 - 12:43 PM
There is a valid difference here. Namely that the easier (and that does count for something) solution digpoe suggested is more appropriate for a turtle manufacturing station, since the turtles can all be placed, fueled and turned on in the same spot and they will then move off on their own.

True, I decided against bothering to make the suggestion myself, but it is not an invalid suggestion just because I didn't make it.
PixelToast #12
Posted 19 December 2012 - 12:47 PM
i did this awhile ago lol
http://www.computerc...3-turtle-swarm/
you can also use the peripheral command getID or whatever to communicate through rednet
theoriginalbit #13
Posted 19 December 2012 - 03:07 PM
There is a valid difference here. Namely that the easier (and that does count for something) solution digpoe suggested is more appropriate for a turtle manufacturing station, since the turtles can all be placed, fueled and turned on in the same spot and they will then move off on their own.

True, I decided against bothering to make the suggestion myself, but it is not an invalid suggestion just because I didn't make it.

digpoe's solution may be "easier" but that means the "mother computer" must always remain stationary, even from the start, since thats its only function. however the OP stated that i would not always be deploying new ones in the start, therefore that my solution would be "easier" since the way i do it, the "mother computer" can just stop what its doing and make one right away, and not have to remember where it left the disk drive and go to it, and then remember where it was after it places the new turtle and go back to what it was doing, now THAT seems to me like the more complicated way than just stopping, putting down some stuff, picking it back up and continuing.
Orwell #14
Posted 19 December 2012 - 03:50 PM
I was just saying that when u use TheOriginalBIT's steps like this:
1, 2, 3, 4, 3, 4, 3, 4, …, 5, 6, 7
Then it's the same thing. But it hardly matters. Still, I think it's hardly worth discussing compared to all other stuff that comes with this challenge.
ChunLing #15
Posted 19 December 2012 - 04:06 PM
That ignores the fact that to do this you'll need to set up an inventory array, which is not very portable. The OP also mentioned setting up pipe networks and such, which would be even less portable.

TOB's solution is valid for programming a fixed location computer, like a GPS node (I have a program that uses just this strategy, in fact). But it doesn't make digpoe's solution invalid for programming turtles being created at a central location.
NabsterHax #16
Posted 19 December 2012 - 04:18 PM
Hello, just signed up to reply to this. I have already thought about this idea for a little while and come up with some problems and potential solutions.

To begin with, I believe you would need 2 turtles with some starting fuel to begin with. One mining turtle which you will need to collect resources, and one crafting turtle which you will need to craft.

One of the massive problems with this idea is that turtles don't know what the different blocks are. They can differentiate blocks, but nothing more. However, I believe it is possible for turtles to figure out what kind of block they have by using a combination of crafting, and other little tests until you rule out all other blocks.

A few weeks ago I tried to create a program that could seek out trees, cut them down and identify the blocks as wood logs.

To start, I made a bit of code that let the turtle scoot along the ground, up and over any obstacles. At any point, if it found an overhang (such as leaves sticking out of a tree), it would try to break the block above it. If the block ends up in the inventory, the turtle knew it wasn't a leaf block, and that it wasn't underneath a tree. If, however, no block was returned then the block broken was likely to be a leaf and the block in front of the turtle was probably a tree log. The turtle would then attempt to cut down the tree, ensuring that each block it picked up was the same as the previous block. (This was about as far as I got code-wise)

Now, so far everything has revolved around chance. The turtle could have found some logs, or it could have broken some ice, and found a load of dirt. To know for sure, we can use the crafting turtle. Passing the materials over, the crafting turtle will first attempt to turn logs into planks, and the planks into sticks, or a chest, or some other item. Now, how many items do you think when crafted alone return 4 items, which when arranged in a stick recipe also return 4 more? Not many (or any), I'm guessing. If, at each stage of crafting we keep at least one block for reference, we now know for sure that we had logs.

That's the basic idea, and I think it can be applied to many items in minecraft. Sand and gravel are the only items that have gravity, and gravel doesn't smelt in a furnace. (Now you know sand, glass, gravel, and then flint). Every item has some sort of unique property that can be tested by turtles, and then each item can be stored in a specific order in specific chests for later reference when a turtle needs to find out what an item is.

Still, plenty of problems to solve of course, but if it was easy then it wouldn't be fun. ;)/>
ChunLing #17
Posted 19 December 2012 - 04:54 PM
Latest version of CC has crafty mining turtles, so you really can start with just one turtle.

I'd recommend digging a + shaped shaft straight down and then another coming up, so that you have plenty of cobblestone to attempt making a furnace (you can guess that your most abundant resource at that point will be cobblestone, and you can find out a lot by messing about with a furnace). On the way down you can also probably figure out if you're going through dirt (because it will compare to what's in the inventory). Once you test refuel to find out if you've got some coal (which is a good bet), you can have a sample of stone and dirt, which will help a lot in efficiently mining out other things. It will also help when you start logging, since you can easily tell when you've finished off a tree.

But that may be a minor enough advantage, you'll have dirt soon enough anyway if you go looking for trees.
NabsterHax #18
Posted 19 December 2012 - 05:24 PM
Latest version of CC has crafty mining turtles, so you really can start with just one turtle.

Ah, I didn't know this, been using the version in FTB so far.

Edit: I just downloaded a new version and I can't see any mining crafty turtles.
Edit 2: Never mind, I found it using the creative tab. Just didn't appear in NEI.
immibis #19
Posted 19 December 2012 - 09:28 PM
If the turtles were allowed to use something like the Turtle Item Analyzer addon, this would become a lot more practical.
theoriginalbit #20
Posted 20 December 2012 - 12:04 AM
At any point, if it found an overhang (such as leaves sticking out of a tree), it would try to break the block above it. If the block ends up in the inventory, the turtle knew it wasn't a leaf block, and that it wasn't underneath a tree.

Grass only has a random chance for seeds, so grass might confuse it a little.
NabsterHax #21
Posted 20 December 2012 - 10:45 AM
At any point, if it found an overhang (such as leaves sticking out of a tree), it would try to break the block above it. If the block ends up in the inventory, the turtle knew it wasn't a leaf block, and that it wasn't underneath a tree.

Grass only has a random chance for seeds, so grass might confuse it a little.

There are a lot of things that can confuse it. That's why the crafting check is needed.

And of course, an addon would make this much easier, but I feel that would be cheating.
Ira Ludius #22
Posted 07 June 2013 - 03:31 PM
At any point, if it found an overhang (such as leaves sticking out of a tree), it would try to break the block above it. If the block ends up in the inventory, the turtle knew it wasn't a leaf block, and that it wasn't underneath a tree.

Grass only has a random chance for seeds, so grass might confuse it a little.
Ira Ludius #23
Posted 07 June 2013 - 03:33 PM
Oops. Anyway, in the latest version of CC, telling a turtle to move into a block with grass in it will destroy the grass.
Engineer #24
Posted 07 June 2013 - 04:59 PM
If the turtles were allowed to use something like the Turtle Item Analyzer addon, this would become a lot more practical.
It would be more practical, however it takes a lot of the challenge away. I mean, the real problem is analyzing blocks, all the other things are kind of easy. Not saying it is not a challenge to make the digging work properly and the fuel problem. But analyzing items is a huge challenge. Especially if it is going to sort items!
GopherAtl #25
Posted 07 June 2013 - 09:47 PM
since this old thread has been bumped anyway, I might add that the difficulty of this has gone up tremendously with the new wireless modem recipe requiring an ender pearl. While the rest is incredibly difficult, this added step might well be impossible, at least on a scale sufficient to supply all turtles in your resulting swarm with modems, which means you would have to fall back on disk sharing to communicate and depend entirely on move tracking within each turtle for positional awareness.
Bomb Bloke #26
Posted 08 June 2013 - 05:12 AM
Just throwing it out there, but there's an Ender Ender in my world. Redstone is harder for me to get than ender pearls are.
Engineer #27
Posted 08 June 2013 - 07:38 AM
Just throwing it out there, but there's an Ender Ender in my world. Redstone is harder for me to get than ender pearls are.
But turtles do not know that. Turtles arent able for the most part to not obtain an Ender Pearl
Bomb Bloke #28
Posted 08 June 2013 - 10:23 AM
Aren't able to obtain ender pearls, I guess you mean?

Good point, I was forgetting the context of the thread. I'm now wondering if enabling the CC "fake player" would cause mobs to spawn near them when all "real" players are offline, and whether there's any way of getting turtles to cross dimensions.
Mercam #29
Posted 08 June 2013 - 07:38 PM
Aren't able to obtain ender pearls, I guess you mean?

Good point, I was forgetting the context of the thread. I'm now wondering if enabling the CC "fake player" would cause mobs to spawn near them when all "real" players are offline, and whether there's any way of getting turtles to cross dimensions.


Just checked, turtles cannot 'move' into ender/nether portals. Perhaps a mod could take them to other dimensions but I'm unaware of any other methods currently to get to other dimensions.

As for obtaining an ender pearl you could, (albeit programming would be a pain), create a function that would build an underground 'dark room' that would force endermen to spawn in, and then warrior turtles could every period of time come in and kill all mobs in the room, and then suck the items up an deliver them, of course that assumes the mobs spawn next to turtles in the first place… now a world anchor may, or may not cause mobs to spawn in the nearby area. I get the feeling without a true player entity no.
Orwell #30
Posted 08 June 2013 - 07:46 PM
Since portals can transport items now, you can make a turtle on one side break your transported turtle above a portal. The transported turtle falls into the portal, falls outside of the other portal. It then gets sucked up by a third turtle and will be placed and turned on by it.
Engineer #31
Posted 08 June 2013 - 09:52 PM
Since portals can transport items now, you can make a turtle on one side break your transported turtle above a portal. The transported turtle falls into the portal, falls outside of the other portal. It then gets sucked up by a third turtle and will be placed and turned on by it.

That would also be impossible. Because it will land on that platform in the end, and everything on there gets deleted when something an entity enters. Also, a modem is not an option here, since it cannot cross dimensions.
GopherAtl #32
Posted 08 June 2013 - 10:46 PM
This scheme is workable with nether and mystcraft portals, but only if a player goes first and sets up the receiving station. A turtle dropped through in item form obviously can't place itself.

And mobs only spawn in certain proximity to players. When I said only might be impossible for a swarm of autonomous turtles to collect pearls, I meant there may be mods somewhere that make it possible. It is absolutely impossible with vanilla+cc without at least some form of player assistance.