-
Notifications
You must be signed in to change notification settings - Fork 20
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
MoveAndSlide() #8
Comments
while kinda true you can still use MoveAndSlide() just fine. as a work around you can just use some simple math to cancel out the delta before making the call. and re apply it after.
notes all together it seems to be quite robust for my case. (making a multiplayer fps game) using this template. also this work around have been known for a while so def give it a try |
Thanks @inFamousOne , I did see that comment but didn't really quite understand how to implement it. I had a bit of a work around for processing the inputs, I would queue the in coming states and the dequeue them on the physics process so that Trying that solution you posted (and even with my little work around) I still get a pretty inconsistent positioning after reapplying inputs. It could well be that I'm just missing an important step that I'm not seeing. I'm running the client side simulation on a different CharacterBody3D, a "ghost" of what the server see's basically. But its always next to the player and not on the same position. You can see on this image. The server position is correct, but after I apply the outstanding inputs on the client its always off and I'm not really sure why. In this image I've only just spawned in, no movement inputs have been applied, so I'm not sure how the simulation things it should be at a different positions. PS: I am using Jolt in my project. |
The solution I proposed should fix it based on the current implementation as of the master branch. in your case there could be a number of things that could be causing this issue. such as the ghost collision layer is actually colliding with the "active" players. the spawning being set incorrectly for the ghost. corrections not being applied after a deviation was found ect. Its hard to say with out seeing the code. I would just recommend maybe starting from the current solution which is to check for them as they are incoming and trying out the work around I suggested and going from there. |
Hi All, If any of you manage to make that work and want to share it I will be more than glad! |
@grazianobolla Sure! if you would like I can make a pr using the solution from my first comment. |
Yeah I would love that, I will take a look at it and we can discuss it. Thank you @inFamousOne |
@grazianobolla feel free to review the pr when you can. also @brogan89 you my take a look to see how I handled using move and slide if you would like |
Thanks so much @inFamousOne . That was very helpful to see the changes. I noticed a couple things I did wrong in my project! I'm just using the ghost for visual reference on client now. I think the core of the issue was not storing the clients state along with the input, that seems to the main part that I think. |
Fixed by PR #9 |
The current issue with the player movement. It's updating the position and not using
MoveAndSlide()
which is should soIsOnFloor()
can return correct results.The larger issue is that it kills rollback as you can't pass in a custom delta for deterministic physics simulation. There is an issue currently in discussion about it here: godotengine/godot-proposals#2821
Looks like there is already a PR for the feature: godotengine/godot#84665
So really the rollback wont be very accurate for
CharacterBody3D
movement until this feature is in main.The text was updated successfully, but these errors were encountered: