-
Notifications
You must be signed in to change notification settings - Fork 63
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
Buggy movement on snow #29
Comments
In mc-data we have a script to make sure that all blocks that have a collision shape is of type 'block' and the others are 'empty'. All transparent blocks like torch, tall grass etc.. don't have a collision shape so they have their bounding box set to 'empty'. (ex: https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.16.1/blocks.json#L12990) so its not seen as an obstacle. What we are missing however is in the movement generation of the pathfinding to consider the real height of the blocks (atm its a post-process). The same bug causes also some issues with the bot trying to jump on fences. I think it would be easier to solve when we have the modular move generation. (if we can add special conditions) |
Yeah, that's fair. I imagine the actual block collision shapes could be sampled for that purpose. It would be helpful to eventually provide that information to the movement system to allow for sub-block movements, such as knowing that it could squeeze between two fence posts. But, that's extremely far down the line. xD |
issue still happens, the bots still just jump wildly around on snow |
a decent-ish workaround would be to count a single snow layer as an empty block it wouldnt be pretty but its better than having a broken bot when in a snow biome |
Would be a solution since normal, single-layer snow has no collision. So It would work in 99% of use cases. Better 99% accurate than 0% accurate. |
maybe this is related to the soulsand bug, can you check if its fixed now @TheDudeFromCI ? |
I checked and: nope |
Found the bug. Should be fixed now. |
Oh sorry, was asleep. Thanks for testing it for me. |
https://streamable.com/mtpels still buggy but now less buggy edit: also no problem thedoodfromci |
It appears the original bug was fixed, but there are a few other existing bugs with block bounds. For the most part, though, it's a lot better. |
Ok there are 2 bugs in the video, one is reported here #65 The other is it thinks it is 1 block above the snow so it can jump on the slab. Non-blocks are a pain to handle, we need to think of a proper way to to handle them, it is too hacky right now. |
just throwing out an idea: |
@MrAlexEsisteGia All block types already contain collision shape data. You could simply retrieve the information by reading the collision shape. Pillaring over walls, for example, if the collision extends above the block. |
what about lilypads or single snow layers? or ladders, those need some entirely different code to work probably |
Single layer of snow don't have a collision shape https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.16.1/blockCollisionShapes.json#L185 Ladder and vines should have a special handling code indeed (there is an issue about it), they are actually well handled in prismarine-physics, so code may be reused. |
This makes a lot of sense. The bot thinks it's stuck in a block, (the snow) so it constantly hops forward instead of walking forward and removes snow layers on ledges before climbing up them.
I would have thought the bot would ignore them because the snow has no collision. However, pathfinder checks the bounding box of the block when handling pathfinding, not the collision shape. So even transparent blocks like snow, torches, and tall grass are seen as obstacles to the bot.
The text was updated successfully, but these errors were encountered: