cabaletta / cabaletta/baritone

Better area mining (impove #sel)

Open
#1,791 7 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
9.2k
Forks
2.1k
Avg merge
4d 3h
Merged PRs (30d)
3

Description

### [It's a bit long but I explain how you could implement that using existing features]
**A more advanced mining method for larger areas (better than #sel)**
##Details
Currently, the "classic" #sel method for an area is to get in the approximate corner of the selection and stop moving, mining blocks in reach doing like a hole straight down. After the bot dug to the last y-level it will move the side and continue to dig in hand reach and will make some kind of tunnel at the lowest level of the selection. After clearing all the bottom part of the selection, he'll find a path to the top and restart the process (mine down then over) until the area is cleared, leaving different path on the side on the selection. I think this is due to the code that manages the most efficient mining method: no movement, only head movements. In the code of the game (can be experienced in-game) when the player moves or is being moved, the mining time is longer (by not a lot but on a large number of blocks, it makes the difference). By standing still, the player has the maximum mining speed.
Now that the current mining method used by Baritone, I'll explain my suggestion of layer by layer digging.
In the most known digging servers (servers that digs millions of blocks to make big holes) use a method of 45° left or right, 45° down and left(or right) sprint at the same time as a forward sprint ( that makes diagonal sprinting). Experienced players can reach easily 33kblocks/h dug (overworld terrain (caves, dirt & gravel and other) and 45k/h in the nether roof (almost no lava). To use this method, it requires preparation: speed 2 and haste 2 beacons (haste only for ow) to reach max speed. Using that method, you mine 2 layers of the terrain at a time ( at most 20blocks/sec (max speed) mined). Although this method is recognized by many the best one, it's hard to execute properly. The "main" difficulty comes from the angle that the player needs to look to mine the most blocks by block sprinted but also to not left behind "random" blocks that you missed because of the wrong angles by humans. Using a bot for this makes this much easier since you can see the yaw of the player to an exact direction (as done on many other programs on baritone that digs stuff). Sprinting diagonally and looking at a perfect angle and mining at the same time, I don't think baritone does it in a program currently but the bot can sprint in all directions even when the player (human) looks away ("free look"). I don't know if the bot sprint diagonally or not when he wants to go diagonally (he can do forward sprinting with the camera rotated, not sure). In a request like #goto portal, you can interact with blocks while the bot walks (breaking, placing and opening GUI). Now we know that the bot can walk in a specific direction and mining blocks can be separated. The bot "could" (not 100% sure) force a view angle to have perfect orientation for digging.
For the speed and haste, this can be easily "bypass" using speed &/or speed mine (for ex on wee client) or as a timer (most clients have it(makes you do everything faster)).
To make things easier (the goal is to apply that to a really large area (maybe even more than render distance) to dig. You could enter (maybe similar to WorldEdit) the corners using a tool( as a debug stick for ex a pickaxe) setting an area to dig. Using different client or timer the speed values could change (if you change mining speed then it won't be instant mining then useless to use this method) Baritone could detect the speed of the player and adjust the movement speed with the mining speed & angle. The bot will need to stop or at least slow down a lot while mining ores (most of the time multiple at once or blocks that are slower to mine (infected blocks, obsidian and grave & dirt (or just change tool)).
I don't have footage of the method now but I'll record a bit to be better to understand when I have more time.

##Settings
1 - A setting with the number of layers to dig at once (most useful is 2 and 1 because 2 is most efficient and 1 could be used for the last layer of the area) but 3 and more "could" be available tho much less efficient and looking way less legit.

2 - Another setting that could autodetect the speed of the player(if possible) or not, if so, input the speed values ( forward, side, diagonal and back ) to make it possible.

3 - Maybe a setting "collect materials" to collect every item or not and a sub-setting with possibly a list of the items to keep ( for ex keep diamonds but don't collect cobblestone)

4 - A setting for the "tool" item to select or just in the command of the type
#perimeter [corner1 x y z ],[corner2 x y z ] [number of layers (1-5)] [collect 0 or 1 or 2 (0 = don't collect any, 1 = collect all, 2 = collect listed items]

That's how I see the command for the perimeters kinda like this but it can be in "gamerules" like #collect items false/true/choose or #dighigh 1/2/3/4/5 things like that.

## Context
I am not even sure if it's possible but seeing the capabilities of the bot today, I think so. The context would be to make a hole to make a base or put a farm into or just to look cool. You would have to get the setting #assumewalkonwater and #assumewalkonlava true or false (probably false for lava) because liquids could conflict the mining method and speed. (remove all liquids)
The main goal is to make a better #sel mine using specifics configuration(best configs) for the best efficiency of digging.

I'll add footage of the method when I will have time.
Contact me via discord Dryhb#7685 for more info or other.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.