Skip to content
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

Add 3D spring bone support for character hair physics simulation #8374

Open
D3ZAX opened this issue Nov 8, 2023 · 11 comments · May be fixed by godotengine/godot#84604
Open

Add 3D spring bone support for character hair physics simulation #8374

D3ZAX opened this issue Nov 8, 2023 · 11 comments · May be fixed by godotengine/godot#84604

Comments

@D3ZAX
Copy link

D3ZAX commented Nov 8, 2023

Describe the project you are working on

A 3D space action game with characters using toon shader like Guilty Gear

Describe the problem or limitation you are having in your project

For long hair characters, when they running, their hair need physics simulation to be more lively. PhysicsBone3D and other physics related node for 3D can't implement this effect naturely. If make hair swing effect in animations, it need a lot of work to not look mechanically.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add spring bone effect node make a bone in Skeleton3D node can simulate hair swing, that make games looking good, and save time to adjust character animation.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

User can add SpringBone3D node, select the Skeleton3D node and bone to use spring bone, physics simulation will take effect. When the Skeleton3D node moving, the bone will just act like swing spring.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Yes, but not so onvenient.

Is there a reason why this should be core and not an add-on in the asset library?

It's commonly used for simulate long hair characters and for other jiggle thing similar to soft body, this should be a standard feather for a good game engine.

@AThousandShips
Copy link
Member

AThousandShips commented Nov 8, 2023

Please add some more details, this:

For long hair characters, when they running, their hair need physics simulation to be more lively.

Add spring bone effect can simulate hair swing, that make games looking good.

Doesn't quite describe the problem, like how the current system isn't enough, and what is needed more specifically, like what things it is supposed to do

@Zireael07
Copy link

@AThousandShips There is NO current system for this...

@AThousandShips
Copy link
Member

There is NO current system for this...

There is no dedicated system for this, which is why I am asking for details on how this would improve things and why the current physics systems aren't enough

This is what proposals need to contain, that's the process, so please don't treat asking for that as something unreasonable...

@AThousandShips AThousandShips linked a pull request Nov 8, 2023 that will close this issue
@fire fire changed the title Need add 3D spring bone support for character hair physics simulation Add 3D spring bone support for character hair physics simulation Nov 8, 2023
@lyuma
Copy link

lyuma commented Nov 8, 2023

Some questions of note:

  1. During the development of Godot 4.0, we started to consider this style of skeleton-affecting node to be deprecated since we want to make a more dedicated animation system for IK style nodes, which at the time was called SkeletonModification3D but we opted to cut from the release due to bugs and such.
    If we decide that this type of node is useful, we should perhaps reverse our decision to deprecate SkeletonIK3D. Just saying that logically speaking these two systems ought to take similar approaches.

  2. This feature implements a small subset of the properties used in multiple springbone systems in the wild. Is the idea that this should be an extremely barebones implementation that is extensible? If so, would it make sense to have a base class which offers no functionality and then have a single example implementation like what is in the PR?

  3. Alternatively, should we make this a more maximal feature integrated that derives functionality from several different springbone systems (including kusudama style or axis constraints, per-bone properties, multiple types of force/gravity and many more).

I think it would be nice for Godot's implementation to at a minimum cover the functionality in https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_springBone-1.0

@lyuma
Copy link

lyuma commented Nov 8, 2023

Responding to @AThousandShips' questions, the proposal is written from the perspective of animation and missing some of the context, but there is a reason for this being a non-physics related proposal.

the current system

The previous SkeletonModification3DJiggle was actually removed during the development of Godot 4.0 beta, so there is no current system right now
See previous proposals:

why the current physics systems aren't enough

Physics is considered too heavyweight for what is generally considered to be part of individual character animation. Whereas a character in a game generally has one physics node (the capsule collider), a hair and garment system with spring bone animation may have upwards of 1000. Furthermore, in many games (especially competitive or network synced game) you would not necessarily want a character's hair or style of clothing to impact gameplay.

@AThousandShips
Copy link
Member

Then that exactly was what should have been in the proposal to clarify what it is and what it isn't, you can understand my confusion given the lacking information in the proposal

Especially when the title literally says physics 🙃

@fire
Copy link
Member

fire commented Nov 8, 2023

The SpringBone3D node is a versatile tool in 3D character animation, capable of simulating various types of motion. Here are some potential applications:

Applications

1. Clothing Simulation

The SpringBone3D node can be used to simulate the movement of clothing on a character. For instance, it could be employed to make a character's coat flap as they run.

2. Body Motion Enhancement

The SpringBone3D node can also add more realism to a character's body motion. It could be used to simulate the bounce of a character's muscles or fat as they move.

3. Hair Animation

One of the most common uses for spring bones is to simulate hair. The SpringBone3D node could be used to make a character's hair sway as they move their head or as wind blows through it.

Implementation Strategies

The SpringBone3D node can be implemented using various strategies, each with its own advantages and considerations. Here are two potential approaches:

1. Extensible Barebones Implementation

Starting with a barebones implementation that is extensible makes sense. A base class offering no functionality but providing a framework for extensions, like the example in the PR, could be a good starting point. This allows for flexibility and customization based on specific needs.

2. Maximal Feature Integration

Alternatively, integrating functionality from various springbone systems could provide a more comprehensive solution. However, this should be balanced against potential complexity. It would be beneficial if Godot's implementation at least covers the functionality in VRMC_springBone-1.0.

There are more advanced features like multi limit cone constraints for bones (Kusudamas).

@lyuma
Copy link

lyuma commented Nov 8, 2023

Aside from the more high level design points listed in the AI summary, one of the specific concerns I have with the implementation (note the use of singular "bone" in the proposal) is that I think this should apply to a whole bone chain, at a minimum (the tail bone / offset could end the recursion at that bone and add all bones in between)

Godot has a bit higher per-node complexity, and a single character might have dozens of bone chains for hair nodes, so that might potentially be a lot of nodes needed just to animate hair or a single garment... Permitting multiple bone chains to be animated from one node might also be useful.

@JekSun97
Copy link

I just can’t switch to a large 3D project, due to the lack of physics for clothes and hair (and terrain), we need this!

@lyuma
Copy link

lyuma commented Apr 26, 2024

There is a GDScript implementation of spring bone as part of the vrm asset: https://github.com/V-Sekai/godot-vrm
My hope is that this will become an official feature for Godot, but we do not have time to finish this in time for Godot 4.3, so you will have to make do with an addon.

Godot 4.3 just got a new "skeleton modifier" system which will make these sorts of nodes easier to write. It is likely that we will be able to build a nice spring bone node in time for Godot 4.4

@JekSun97
Copy link

There is a GDScript implementation of spring bone as part of the vrm asset: https://github.com/V-Sekai/godot-vrm My hope is that this will become an official feature for Godot, but we do not have time to finish this in time for Godot 4.3, so you will have to make do with an addon.

Godot 4.3 just got a new "skeleton modifier" system which will make these sorts of nodes easier to write. It is likely that we will be able to build a nice spring bone node in time for Godot 4.4

There is also this: https://github.com/detomon/wigglebone, if you play with the settings you can get something similar to fabric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants