Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathfinder doesn't avoid lava #141

Open
RJWadley opened this issue Apr 10, 2021 · 5 comments
Open

Pathfinder doesn't avoid lava #141

RJWadley opened this issue Apr 10, 2021 · 5 comments

Comments

@RJWadley
Copy link

Seems to me like the pathfinder gladly walks into lava as if it were ignoring it.

To recreate this, grab the basic GPS example from mineflayer, create a small lava lake, stand on the other side, and say come.
Pathfinder walks straight through the lava lake rather than around.

@aesthetic0001
Copy link

aesthetic0001 commented Apr 10, 2021

u mean movements.blocksToAvoid.add(BLOCK_ID) (this was a reply to something u9g said before he deleted ._.)

@Karang
Copy link
Collaborator

Karang commented Apr 10, 2021

That could be a bug with the physic simulation. The path plan to jump over lava but the simulation find that it can swim and reach the other side. Could be useful to visualize with pviewer what the bot is thinking. Thanks for reporting.

@RJWadley
Copy link
Author

That seems consistent with what I'm seeing. There are some situations where it does try to avoid lava fine, such as flowing lava above-ground.

On a related note though, it will still accidentally touch the corner of flowing lava or fire since it's cutting the corner. To fix this the bot would need to take corners with lava/fire significantly wider than regular corners.

@etiaro
Copy link
Contributor

etiaro commented May 5, 2021

#149 Not a perfect fix, but it shows where the problem is. It's not with pathfinding but with completing that path. With that fix it(almost always) jumps over lava correctly
EDIT: it still doesn't correctly jump over 1-block-wide lava, tries to run over like on parkour but ofter fails due to lava damage

@SeanMcCord
Copy link
Contributor

There are some movements generated that violate the rules because they don't check all the blocks the bot will occupy. For example when a bot moves diagonally and down one block it does not check the final block for safety.

Here is a video demo: https://youtu.be/0xLNvio0cNA
Here is the line for that specific issue.

} else if (this.getBlock(node, dir.x, -2, dir.z).physical || blockD.liquid) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants