Giter Club home page Giter Club logo

Comments (4)

TheDudeFromCI avatar TheDudeFromCI commented on May 17, 2024

You can turn bot.pathfinder.thinkTimeout to a higher value. The default is 40ms. Higher values will give more stable results but can cause issues since a physics tick is only 50ms. This is usually okay if you aren't running the pathfinder every frame, however.

from mineflayer-pathfinder.

1BAN avatar 1BAN commented on May 17, 2024

You can turn bot.pathfinder.thinkTimeout to a higher value. The default is 40ms. Higher values will give more stable results but can cause issues since a physics tick is only 50ms. This is usually okay if you aren't running the pathfinder every frame, however.

I have tested changing this value prior to opening this issue, however, I get the same/similar results each time. Are you not experiencing the same timeouts/incorrect paths when testing what I described above?

from mineflayer-pathfinder.

1BAN avatar 1BAN commented on May 17, 2024

Update:

For anyone who may be interested. I have "solved" this, but it's very hacky, and it should be resolved via that actual pathfinding mechanics. Essentially my hotfix is a position checker that is run every physicTick. bot.on calls a checker function I made. The way this function works is checking if the bot has a target player or location variable set. If it does, it checks if the bot is moving. If the bot is moving, then do nothing. If the bot has stopped moving and the absolute value of its position minus the target position x y or z is greater than a threshold (I have 0.6 of a block) then it will reset its goal to be that target players position and or the Vec3 coordinate position variable (that I have made, so that I may tell the bot to go to certain coordinates).

This works wonders and the bot will now tower up until reaching the specified coordinates or player (no longer stops beneath them for no reason).

Issues with this:

  • Even if you set the bot to follow the player and set dynamic to false.. it will still go to the player's updated position because the bot is still essentially "stopping" and recalculating paths, and in the checker function I re-specify the bots goal. (This could be solved quite easily but I doubt I'd bother with such a hacky fix in the first place.

  • The bot really doesn't know how to path downwards, it will either run in circles or will break and place a block continuously for no reason (even if there is a way to get down via breaking their tower). However, I don't believe this is a bug that my code introduced as I have experienced this earlier on when just playing with the pathfinding methods and the lot.

Comments:

I am sure my way of doing this is incredibly inefficient, however, at this stage it's not my intention for it to be clean, I was just messing around with it and seeing what I could do. To be honest I am just learning JS as I go and this is the first API I've ever worked with.

from mineflayer-pathfinder.

Karang avatar Karang commented on May 17, 2024

This was not a timeout issue this time but a legitimate bug in the move generation logic preventing it to plan towers of more than 1 block high. Should be fixed now.

Thanks for reporting it!

from mineflayer-pathfinder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.