runi95 / turtle-control-panel

A website for monitoring and controlling ComputerCraft turtle activities
12 stars 2 forks source link

More automation #14

Open SolsticeSpectrum opened 1 month ago

SolsticeSpectrum commented 1 month ago

It would be nice if you could leverage the new D algorithm or even upgrade it to A and let the turtles mine and craft items automatically You could simply input a command like get diamond_chestplate or something like that and it would automatically gather the materials needed.

It would also be nice if turtle reproduction was also automated this way so the turtle could make other ones which would help it achieve this task. If the crafting of said item was very complex, it would be really nice if it determined that it needs help.

Since the world data already contains blocks around, it can quickly tell if it has all materials necessary somewhere around. This would probably require the atlas generator to also fetch recipes.

runi95 commented 1 month ago

D Lite is already a variation of A and I think it's better suitable than A when we don't have the world rendered for the turtle yet. Since we can't guarantee that the world is already loaded in and known I'd stay with D Lite as A* is only a little bit better in that specific case.

It would be interesting to make the turtle go grab stuff you want. I see a few issues with this complexity wise:

  1. Turtles can't actually grab items directly from chests in any good way. If they chest is connected to an activated Wired Modem then the turtle can grab whatever it wants by utilizing the modem otherwise it can only grab the first item in the chest.
  2. How does the turtle know which chest has which item? It's possible to store this logic in the database, but we have no way of knowing whether someone took items out or put items into the chest since the turtle last looked at it.

What we could do is we could make a simpler version of this and say that yes, the turtle will try to craft whatever you asked it to craft, but it has to be craftable from the turtle's home? And the turtle's home needs at least one Wired Modem? How does that sound to you?

Also the fully automated reproduction system I'm still not a huge fan of as I don't really see the need to massively reproduce turtles on a large scale like that. It's already possible to create new turtles within the control panel, you just have to do the process manually within the control panel itself which is around 6 steps (or 3 if you already have a Disk Drive ready).

Maybe we could create an "Auto Craft" script that returns home and starts crafting X amount of whatever you asked it to (or infinite if you tell it to craft 0 / nothing)? Because I very much do like the idea of that! 🙂

SolsticeSpectrum commented 1 month ago

Okay that sounds good to me

runi95 commented 1 month ago

@DarkReaper231 you can also have a look at https://github.com/runi95/turtle-control-panel/issues/7 for more information on how reproduction is currently doable. It involves 10 steps where you can skip most of them if you simply leave the Disk Drive in the world after doing it once. 🙂

I should probably make a wiki for these kind of things at some point. Could include screenshots and such for help/simplicity.

SolsticeSpectrum commented 1 month ago

@runi95 I checked that but 10 steps really feels like a lot

runi95 commented 1 month ago

@DarkReaper231 I think it's important to keep in mind that some of those steps are very very basic unless you're planning on making hundreds of these turtles. And the complicated steps are also rather complicated to properly automate like the first step where you need to gather enough resources. Where should the turtle get these resources from?

Another important point to note is that if you've done all 10 steps once then the second time you create another turtle you only need to:

  1. Gather the resrouces
  2. Craft the turtle
  3. Place the turtle
  4. Reboot the turtle

And if we now automate the crafting and with gathering resources already automated to some degree with the current mining functionality. Once you have 3 turtles (1 mining, 1 crafting and 1 free for you to use) you'll be able to produce these new turtles incredibly fast by just picking up the crafted turtles, placing them down, reboot them.