-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix KinematicBody3D having a duplicate locked_axis variable #45175
Conversation
34ddaaa
to
bad60c4
Compare
#25798 was fixed with #38852, but never backported to 3.2; so this change is not required. Personally, I think keeping the Ultimately, the real problem is the lack of proper syncing between the server and the scene, but that shouldn't be the reason for bypassing that line of separation. |
@madmiraal Then perhaps we should delete the variable in I was aware of #38852 when I made this PR (removing the extra code in |
The scene-server architecture of Godot requires it. The architecture allows changes to scenes (user interaction) and changes within the server to run in separate threads. Changes are then synced separately. Currently, there is no multi-threading in 3D and the multi-threading in 2D has issues; so it's generally not used. Therefore, it appears as if there is no need to have multiple copies, but that's not actually the case. This need for separation becomes more obvious, when you consider the more complex scenario of multi-user networked game, where the server runs separately from the players. As I said before:
|
@madmiraal There's no reason to keep two separate variable that are not in sync. If you keep the two variables, calling The performance hit of these calls to the physics server is negligible compared to the cost of a |
bad60c4
to
285d2e5
Compare
285d2e5
to
492c023
Compare
492c023
to
5e3a1d3
Compare
5e3a1d3
to
2003fd1
Compare
Forgive me as I'm not really very familiar with the physics, but unless there were good reason to do otherwise I'd tend to agree with @madmiraal . Godot is chocked full of this paradigm, 2 copies of variables, one client side and one on the server, and as I understand it this is the multithread paradigm. Once you violate it you may be at risk of stalls, or desynchronization, depending on how the queue is implemented. This probably needs @reduz to have a look at and confirm one way or the other. That said I'm more familiar with visual server, and there, pretty much all the runtime functions are void (one way) aside from creating RIDs which are handled separately, and debug functions which aren't intended to be used generally. The physics server does seem to have more functions available which return values, so maybe the situation is different. |
2003fd1
to
e81f01f
Compare
0b5f0ef
to
8ec382a
Compare
8ec382a
to
47838c7
Compare
47838c7
to
ad42950
Compare
758182b
to
104622f
Compare
104622f
to
6a43fd5
Compare
2a942e6
to
a46ae4e
Compare
a46ae4e
to
d96cbcd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronfranke Sorry I was probably not clear enough, but I've changed my mind after comments from @madmiraal and @lawnjelly, so the easiest for now is to make a simpler fix like in #38852 even it's not ideal for synchronization between the node and the server state.
@pouleyKetchoupp Thanks for the feedback. This PR is for master so I closed it, but I updated #45176. |
Simply put, KinematicBody3D had two different
locked_axis
variables, which caused incorrect behavior any time they were out of sync. It's a much better idea to only have one variable to track this (like RigidBody3D does), so I deleted the duplicate one.This fixes #25798 in master, and is the master version of #45176.