PrismarineJS / mineflayer-pathfinder

Pathfinding plugin that gives bot the ability to go from A to B
MIT License
214 stars 68 forks source link

Bot fails to follow simple path requiring a forward walk + jump #339

Open andrewkchan opened 2 months ago

andrewkchan commented 2 months ago

I'm running into a pathfinding issue where the bot is getting stuck trying to follow a path out of a hole which requires walking forward and jumping once, then turning around and jumping again.

Screenshot of the bad path (visualization on left, ingame on right): image

Video of bot attempting to follow the path (it repeatedly resets path due to futility check. in the video it never gets unstuck, but occasionally i have seen it eventually get unstuck): https://drive.google.com/file/d/11bZj7sXIyTU4t1emwfZBx7uexVw9wtcv/view?usp=sharing

Repro:

  1. Download and unzip world.zip into a dedicated server directory.
  2. Disable any server anti-cheat and start the server.
  3. Then create a bot and run the code:
    bot.chat("/tp -2.3 61.029567977792745 7.606471465025178");
    var table = bot.findBlock({ matching: bot.registry.blocksByName.crafting_table.id, maxDistance: 128 })
    await bot.pathfinder.goto(new pathfinder.goals.LookAtBlock(table.position, bot.world))
IceTank commented 2 months ago

I think this is an issue in prismarine-physics. I think in newer versions the player collision in prismarine-physics is to small. This causes the bot to phase into blocks from the view of the server. And if that happens the server resets the players position to prevent him from phasing into blocks. Some people had success by increasing the player hitbox in the X and Z direction.

IceTank commented 2 months ago

Current prismarine-physics code is a port of the 1.8 Minecraft physics system. And I think sometime between 1.12 to 1.16 it broke.

andrewkchan commented 2 months ago

Thanks, that's helpful. I have downgraded to 1.16 and it actually seems to work better (I was not able to test on the above case - seems I attached a corrupt world).

Is prismarine-physics abandoned?