-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Refactor Physics3D nodes #5003
Comments
Related to #2184. I think this is too large a scope to be done for 4.0. We should only do minor adjustments from now on, or anything else will take too much time to bikeshed on. |
That's fine I understand how late this is, and will take some time to bikeshed as you pointed out. |
I think having static bodies as a separate is still very worthwhile... though I can't really remember the last time I actually used it. I just press the button that generates colliders for me. |
If this ^ makes something worthwhile, then we are doomed. |
I can't think of an engine where you DON'T have a StaticBody of some sort since it's so extremely common an use case. It saves users several clicks. |
While I still think that you are overthinking it, since they are many other nodes that you must setup first before they are proper for your use case. |
Secondly, there's one very important thing. StaticBodies are always static. They'll never not be static. Oftentimes, these nodes are unmoving, as well. It's a major open door for optimisation. |
I agree with @Mickeon regarding It'd also be more intuitive for any new Godot user who is not versed in physics or industry terms to figure out and remember |
What both of you are pointing out is that a What I am suggesting is a change that more accurately represents the interface that the Nodes are built to expose to users in the Editor. I really can not understand the requirement for not changing a enum property on a Node you add to a Scene to get the functionality you want, as there are multiple examples of this throughout the Engine. |
That is true, the argument on my end for single-use and presuming it is always static is admittedly a weak one. Though the having of I still think it's easier and more intuitive for new users to have However, having those three nodes are not a dealbreaker; I still consider this refactoring an improvement over the current organization regardless of what I suggested to potentially improve it. After considering what @Diddykonga has said in their messages; there ultimately isn't really much of ease of use boon, other than having them be potentially easier to learn as said in the prior paragraph. In regards to what @Mickeon said about optimization, is that actually possible considering that afaik |
Optimizations for RigidBodies in Static BodyMode is done currently. So you have the medium-level Nodes such as Then you have high-level Nodes such as All As for the teaching/learning aspect, I would agree although I'm not confident that |
Hmm, yeah I'd say I overall agree with that. Especially the whole
|
|
So, do we agree that |
Personally, I disagree, simply because of how basic they are, and this type of thing really should be handled via good documentation + examples. All types are covered by |
Alright. Well to be honest that is fine. I can kind of see your point of view now, and the one I'd been arguing very well could've been biased and weak for reasons currently unknown to me given I am now not finding much of a solid argument on my side, in comparison to before, at this point. So presuming no one else actually has good reasons in regards to having those other bodies then I am at present fine with just |
For High-Level Nodes, to me it comes down to how much code/effort-in-editor would it take for me to recreate that Node if it didn't exist, |
I find this proposed structure miiiiles more clear and therefore much more preferable than the current one in Godot4 Alpha14. However I do have some problems with this proposal too, especially with defaults and behaviour:
This just sounds like a very bad idea, as it is super confusing: By default you expect a I would expect
Imho,
The DYNAMIC_LINEAR makes no sense to me. If the only difference to DYNAMIC is the option to make it axis locked, why not simply expose this property to I think having a single node with very clearly defined modes which purpose does not overlap has a lot of benefits compared to the current Godot4 Alpha 14 system and even to the Godot3 system. Especially because this would allow to seamlessly switch an object from one behavior and type of user control to another.
Being able to switch between distinctive single purpose modes at any time is exactly what is missing and what is only partially working in Godot3. In Godot3 you already can switch between Which means as a designer I can't switch between intentional-driven entity control and driven by physics simulation at will. |
|
We have discussed the general state of the physics nodes in the bikeshedding meeting. We've agreed to drop the We don't plan to make any further changes to the physics nodes for 4.0. All previous discussions had a lot of people happy and unhappy about changes, so it doesn't look like there can be a universally good stack that satisfies everyone. Or at least one hasn't been found yet. Maybe in Godot 5... But for now, changing it back and forth, especially so close to beta, doesn't look like a good idea. Especially given we don't have many physics maintainers at the moment to make a good educated decision for the area. I won't close the proposal, so feel free to deliberate further, but we won't be considering more structural changes for Godot 4. |
Sad to hear, I guess I will be back for Godot 5 then. |
Been looking for the proper place to say this. As someone starting to learn directly with 4.0 this is not only very confusing (As with that, not a single node is named Not experienced enough in the engine to debate on which bodies there should or should not be, but this name definitely has to go at some point. |
I am all for going with this or a similar approach for the structure, looks very simple to understand.
I feel like just adding a separate bool that lets you lock rotation is a more intuitive approach Reading the discussion, it seems like the main problem people have with this approach is the possible unintuitiveness of the naming and proposed default settings, and that some people would prefer to have separate nodes just to save a few clicks when creating them. |
It would be nice to make the 2d physics system consistent with this 3d one |
I was considering opening a new issue, but I think my problem is encapsulated here. Another problem this setup presents is that PhysicalBone3D does not expose certain propertied or methods that exist in Rigidbody3D (for instance, apply_force() and center_of_mass are two that have come up). 'sleeping' is also missing as a property, though it must exist, because can_sleep exists. It is odd that PhysicalBone3D does not extend Rigidbody3D to me, what is the reason for that? |
See comments in godotengine/godot#44150 and godotengine/godot#58658 for rationale. We can backport individual RigidBody3D properties to PhysicalBone3D as done in godotengine/godot#82449. |
In active ragdoll games, we will really have use cases for all the rigidbody3D properties and methods. I am using apply_centra_impulse (force * delta) to approximate apply_central_force. But I also have a need for apply_central_torque, is_sleeping and get_colliding_bodies. The biggest roadblock I have right now however is the lack of signals such as body_entered. Is there perhaps a simple workaround I'm missing for that? edit - should I create a new issue for this? |
Yes, as this proposal can't be implemented without breaking compatibility (while adding new methods/signals to PhysicalBone3D can be done). |
Added #8008 |
I would like to see the following done...
|
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
The current implementation of Physics3D Nodes:
Any use of
StaticBody3D
,AnimateableBody3D
,CharacterBody3D
,PhysicalBone3D
orRigidDynamicBody3D
was a Rigid Body on the Physics Server anyways, but these classes chose to only expose certain properties of that Rigid Body, which would often cause many new users to wonder if they were separate things, often causing issues when the user seeks to have a functionality from one in the other, not knowing they are indeed the same underlying object/type.Describe the feature / enhancement and how it helps to overcome the problem or limitation
The refactor of Physics3D Nodes:
sync_to_physics
: Moved toPhysicsObject3D
to support Syncing to Physics as a core feature of all Physics Objects.StaticBody3D
: This node was incredibly simple and can be recreated with aRigidBody3D
and setting BodyMode toSTATIC
.AnimateableBody3D
: With Sync to Physics being changed to a core feature of all Physics Objects, there is no longer a purpose for this node.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The goal is the simplify the Physics Structure in Godot, and make it easy to teach and easier to understand.
Physics Objects we have for Godot:
Body
: Anything that has shapes that fills up space in the Physics World.Area
: Anything that has shapes that overlaps space in the Physics World.Body
can have two types:RigidBody
andSoftBody
RigidBody
can have four modes:STATIC
,KINEMATIC
,DYNAMIC
,DYNAMIC_LINEAR
- (LEGEND)-
PVI = Physics Velocity Integration (Updates position with velocity)
PFI = Physics Force Integration (Updates velocity with forces/user-code move)
PS = Physics Simulation (Default Physics PVI/PFI Implementation)
STATIC
: No PVI,NoPFI, Optimized to not be movedKINEMATIC
: No PVI, PFI, Moved by user-codeDYNAMIC
: PVI, PFI, Moved by PS and user-codeDYNAMIC_LINEAR
: PVI, PFI, Moved by PS and user-code, rotation locked for use with CharactersWith this proposal all users will be covered by
RigidyBody3D
and creating user-derived types/scenes from it, to implement higher-level functionality while knowing theRigidBody3D
is a proper medium-level type and fully exposes the underlying low-level interface.If this enhancement will not be used often, can it be worked around with a few lines of script?
This a core structural/implementation change.
Is there a reason why this should be core and not an add-on in the asset library?
This a core structural/implementation change.
The text was updated successfully, but these errors were encountered: