Skynet Turtles [Theory]

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Ace5000

New Member
Jul 29, 2019
53
0
0
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.
 

Ace5000

New Member
Jul 29, 2019
53
0
0
I have no idea if it's possible. I'm just learning LUA. If it ever happens, I assure you will tell you. But I will be doing all I can to write this as soon as possible.
 

MadDogTen

New Member
Jul 29, 2019
30
0
1
That sounds epic. If you do ever get it done, You should make a time lapse video of it.

I wish you good luck.
 

eculc

New Member
Jul 29, 2019
163
0
0
Well...The only limitation I can think of would be that you have to designate numbers of turtles dedicated to each task.

unless...well, I suppose you could make the number of each type of turtle a percentage of the total turtle population.

in theory, you could have the programming turtle save the mothership program onto adisk, and each turtle would read their own part of that program to perform their specific function. Though, the best way to do it would involve rewriting the turtle's programming to account for new locations -- storage areas, charging stations, etc.

I guess what it comes down to is, can turtles program other turtles?
 

Ace5000

New Member
Jul 29, 2019
53
0
0
Turtles can, in theory, program other turtles through wireless computers and redstone pulses interpreted as binary. it takes the binary, turns it into a text (command) and sends it. At least, I believe that is how it works. Also, is there any way for a turtle do recognize what types of blocks it is using and are around it?
 

Tylor

Well-Known Member
Nov 24, 2012
500
120
68
Last time i checked, turtle will not activate until some player right-click it at least once after placing. So, no Skynet.

...well, unless you have some people in pods forced to right-click new-made turtles. Woah, it all make sense now.
 

Ace5000

New Member
Jul 29, 2019
53
0
0
Last time i checked, turtle will not activate until some player right-click it at least once after placing. So, no Skynet.

...well, unless you have some people in pods forced to right-click new-made turtles. Woah, it all make sense now.
Wireless computers, redstone signals. I believe that works just fine. Maybe?
 

zemerick

New Member
Jul 29, 2019
667
0
1
Last time i checked, turtle will not activate until some player right-click it at least once after placing. So, no Skynet.

...well, unless you have some people in pods forced to right-click new-made turtles. Woah, it all make sense now.

Last time I tried they self replicated fine. I had a queen turtle grab a turtle from a chest, place it, copy a startup program and a main task program. It then rebooted the turtle to run the startup. This was a bit before ftb though.
 

Fuubar

New Member
Jul 29, 2019
60
0
0
Entertainingly enough I just posted a similar idea within minutes of this post (in the City Factories and Grey Goo Machines thread).

For programming, It is probably easier to have your initial turtle contain the programs you want the rest of your turtles to use. The starting turtle can then just craft a disk drive and disk then copy over the programs you want (or write them with io.open and file:write). A CC computer will automatically run the "startup" program from an adjacent disk drive on boot.

For resource identification with vanilla CC. As far as I know the only item identification system that turtles have is comparing and counting. I've just realized that you could notionally use logic to try and identify base (mined) items based on their recipes, behaviors, and locations. Crafted items are then easy. This can be simple for an individual item but becomes very complex when you consider the fact that you need to identify every item your turtle could possibly encounter. Personally, I'd just set up an initial item id station with an array of chests containing one item, it requires pre-programming to identify that the item in the chest at x,y,z contains an iron ingot but it is easier.

Here are some examples to try and explain my idea of identification using logic. You could code common conditions into a comparison table and then run test functions until the combined results match an item in the comparison table. A "not previously identified" item check is inherent in each set of conditions below:

Dirt - probably below the turtle at start, doesn't craft in a circle (in case you started on stone).
Cobblestone - dig down from dirt until you get a new type of block, crafts in a circle (In case of lucky ore strike).
seeds - not a block, not placable, mined from above grass (mine the block to check if it is dirt since i think turtles differentiate between grass and dirt)
flowers - not a block, placable, mined from above dirt - (I'm not sure how to differentiate color but you may be able to use valid/invalid recipes starting from bonemeal and cactus green)
Wood - surface block (follow dirt until you run into something that isn't dirt or stone) and crafts into four resulting items
gravel - falls when placed in air - doesn't smelt (id wood and cobble first to make/fuel a furnace)
flint - place and mine a gravel until you get something new.
coal - not placable, results in 4 items when crafted above a stick.
Iron ore - placable, smelts, smelting product works in a door shaped recipe and a shovel recipe.
Diamond - doesn't smelt, works in a shovel recipe, works in jukebox recupe
redstone - multiple from one mining operation, crafts into noteblock.

I just realized I got very carried away with examples, but I find it to be an interesting concept.
 
  • Like
Reactions: duckfan77 and Tylor

Tylor

Well-Known Member
Nov 24, 2012
500
120
68
Practical or not, idea of turtles playing/experimenting with stuff to determine what it is is really fun.
 

eculc

New Member
Jul 29, 2019
163
0
0
Experimenting with turtles in general is interesting. I was thinking about trying to create a program that digs out a free-form ore deposit by digging out the blocks around itself and comparing them to blocks already in its inventory (to determine both if there is an ore deposit and in what directions said ore deposit is from the turtle's location). of course you could just have the turtles dig out a chunk or so instead, but this way you could have your turtles mine more efficiently, much like a player would when making a branch mine.

a possible way to work with procedural programs would be to give the turtles combinations of commands and locations (in the form of XYZ coordinates) and having programs assign these combinations to 'queue' tasks for the turtle to do.
 

Ace5000

New Member
Jul 29, 2019
53
0
0
Entertainingly enough I just posted a similar idea within minutes of this post (in the City Factories and Grey Goo Machines thread).

For programming, It is probably easier to have your initial turtle contain the programs you want the rest of your turtles to use. The starting turtle can then just craft a disk drive and disk then copy over the programs you want (or write them with io.open and file:write). A CC computer will automatically run the "startup" program from an adjacent disk drive on boot.

For resource identification with vanilla CC. As far as I know the only item identification system that turtles have is comparing and counting. I've just realized that you could notionally use logic to try and identify base (mined) items based on their recipes, behaviors, and locations. Crafted items are then easy. This can be simple for an individual item but becomes very complex when you consider the fact that you need to identify every item your turtle could possibly encounter. Personally, I'd just set up an initial item id station with an array of chests containing one item, it requires pre-programming to identify that the item in the chest at x,y,z contains an iron ingot but it is easier.

Here are some examples to try and explain my idea of identification using logic. You could code common conditions into a comparison table and then run test functions until the combined results match an item in the comparison table. A "not previously identified" item check is inherent in each set of conditions below:

Dirt - probably below the turtle at start, doesn't craft in a circle (in case you started on stone).
Cobblestone - dig down from dirt until you get a new type of block, crafts in a circle (In case of lucky ore strike).
seeds - not a block, not placable, mined from above grass (mine the block to check if it is dirt since i think turtles differentiate between grass and dirt)
flowers - not a block, placable, mined from above dirt - (I'm not sure how to differentiate color but you may be able to use valid/invalid recipes starting from bonemeal and cactus green)
Wood - surface block (follow dirt until you run into something that isn't dirt or stone) and crafts into four resulting items
gravel - falls when placed in air - doesn't smelt (id wood and cobble first to make/fuel a furnace)
flint - place and mine a gravel until you get something new.
coal - not placable, results in 4 items when crafted above a stick.
Iron ore - placable, smelts, smelting product works in a door shaped recipe and a shovel recipe.
Diamond - doesn't smelt, works in a shovel recipe, works in jukebox recupe
redstone - multiple from one mining operation, crafts into noteblock.

I just realized I got very carried away with examples, but I find it to be an interesting concept.
You sir, are my new favorite person ever.
 

Tylor

Well-Known Member
Nov 24, 2012
500
120
68
a possible way to work with procedural programs would be to give the turtles combinations of commands and locations (in the form of XYZ coordinates) and having programs assign these combinations to 'queue' tasks for the turtle to do.
This is actually how my excavating program works - I make a "digging plan" first. But I do it so turtle can stop at any moment to return to chest, and then continue from same spot.
 

dowster

New Member
Jul 29, 2019
1
0
0
each turtle could have a full copy of the code, but receive it's "role" from the master. This way we end up with one really big program, but it is easy to just re-purpose turtles without having to have them transfer code. I've only used CC on Tekkit so i haven't had the pleasure of the updates... yet.
 

voidreality

New Member
Jul 29, 2019
117
0
0
Code can easily be transfered to a turtle with a disk via the startup file. And a reboot command can be given from another turtle by wrapping the drone turtle as a peripheral. Simple setup.

Control turtle places drone turtle next to disk drive with a startup file. Control turtle wraps the drone as a peripheral. Control turtle reboots the drone. Drone runs the startup file and begins world domination.

/disk/startup
Code:
print("hello world, i'm a drone")

control turtle
Code:
-- place the turtle from slot 1 next to a disk drive
turtle.select(1)
turtle.place()
-- wrap the turtle and reboot
local drone = peripheral.wrap("front")
drone.turnOn()
drone.reboot()

drone turtle
Code:
"hello world, i'm a drone"