Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

Can you specify penalty for going away from target block while mining?

mvrozanti opened this issue ยท 8 comments

commented

What do you need help with?

My objective final goal is to prevent baritone from distancing itself from a block that should be mined (with #mine command) that is on a y level higher than that of the players. Example: removing a lava cast efficiently

Is this currently possible?

Final checklist

  • I know how to properly use check boxes
  • I have not used any OwO's or UwU's in this issue.
commented

I don't really understand what you want to achieve, but I guess it is not possible to penalize going away from some position.
As far as I know you can only increase the cost of a node in general, but not direction-dependant

commented

Aren't those settings just related to block placement? If not, their name is misleading and the documentation also doesn't relay this behavior, in both cases.

commented

You can use sel and cleararea, sorry should have added that before.

Sel just works by creating a schematic and building that.

commented

Thanks, I'm gonna try using sel and ca and report back.

Side note: since you mentioned that, sel and cleararea don't respect blocksToAvoidBreaking setting; is this intentional?

commented

I want to achieve precisely that: removing a lava cast efficiently. The current path-finding algorithm with default settings distances itself from the top, which is a bad idea when removing a lava cast. I'm hoping the addition of a setting that specifies penalty for going away from blocks at a higher y level would fix this problem. Do you agree @ZacSharp ?

commented

For that purpose you can use buildInLayers and layerOrder to achieve the exact same effect.

commented

I'm hoping the addition of a setting that specifies penalty for going away from blocks at a higher y level would fix this problem.

It would not fix the problem, because Baritone often doesn't even walk to got down (just digs down) and as I already said, you can only increase the cost of all movements to (or from?) a node. I'm not sure what the performance impact of a per-movement cost factor would be, but it is probably not worth it.
In addition, #mine is designed to gather sparsely distributed blocks (e.g. ores), not to clear areas. For bulk block removal there is #sel, which already comes with settings to avoid the problem you are having.
I don't think their names are misleading: They affect the builder and building (as well as removing wrong blocks) is what the builder is made for.

I'd suggest using #sel replace cobblestone air rather than #sel cleararea if you care about the surrounding blocks.

commented

#sel replace combined with buildInLayers worked, thanks!

P.S.: Documentation could be updated though.