-
Notifications
You must be signed in to change notification settings - Fork 11
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
Gravity doesn't work properly #2
Comments
Waiting on mcp as of now to fix this. |
Could you explain what mcp is? Is this impossible to fix without it? |
Minecraft coder pack, I believe this is possible to fix without - just that I have no idea how gravity works so if you know how that works you can go ahead an implement it. Its in the movement handler I believe. |
We need to move more smoothly than currently for gravity to work. As far as I can tell, we are currently warping 1 block at a time, just at a slow enough pace so that the server treats it as a lagged connection which is moving at the normal rate. Under those conditions, I don't think it is possible to have functional gravity. In order to make gravity work, I think we'd need to set a goal-position, potentially 1 Tile at a time, and each tick have the bot move a set distance (4.317 blocks/second, or 0.21585 blocks/tick) closer to the goal-position until it reaches it. It might help to round this figure so that we reach each goal position in an integer number of ticks. This of course, would depend if we are walking diagonally (+-1, +-1) or along an axis (+-1,0) or (0,+-1). If we changed the movement code to reflect this, we could then implement applyGravity() on each tick with an acceleration of (0.08 blocks/tick) with a drag of (0.02*velocity blocks/tick) afterwards. I found these numbers on the minecraft wiki at http://minecraft.gamepedia.com/Gravity#Motion_of_entities |
This is now functional, acceleration still isn't perfect but it works. |
It bugs him out quite badly
The text was updated successfully, but these errors were encountered: