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

Different physics behaviour in Animation BP and in the actual game #17

Open
BineeMan opened this issue Dec 13, 2023 · 7 comments
Open

Comments

@BineeMan
Copy link

BineeMan commented Dec 13, 2023

When using SPCRJointDynamics in Unreal, it seems that skirt simulation doesn't work properly in the actual game.
In the video, I am demonstrating that the skirt physics works fine in the Animation BP preview, but in the game it has a lot of glitches and artifacts. Changing simulation settings doesn't change anything. Is it possible to fix that? I am using UE 5.3.1

https://www.youtube.com/watch?v=cQHk1ZuLlYg

@spark-piyush-nitnaware
Copy link

spark-piyush-nitnaware commented Jan 29, 2024

Thanks for the bug report.
We will investigate it and try to fix it as soon as possible.
Sorry for the late reply.

@spark-piyush-nitnaware
Copy link

Hi @BineeMan ,
I tried to reproduce the bug in UE5.3.1 version, but I could see the same behavior in both the animation editor and in the play mode.
It would be much more helpful if you could share the sample project in which we can confirm this bug if it's possible for you?

@BineeMan
Copy link
Author

@spark-piyush-nitnaware Yes, of course it's possible. I've uploaded it to google drive. https://drive.google.com/file/d/1UIdkpHYJmHWJ4QtI3ONZrBT0zJxVgPbU/view?usp=sharing
Path for ABP_NierCharacter is Game\NieRAutomata\Blueprints.

@spark-piyush-nitnaware
Copy link

spark-piyush-nitnaware commented Feb 5, 2024

@BineeMan
I am still not able to reproduce the bug in the provided project.
Are there any specific settings have done in the project settings?
(Just confirming if there such settings enabled, like smooth framerate or something which may caused this bug?)
Also, are you using UE from the Epic launcher or from source code (Github source code)?
Please bear with us, as it's taking a bit of time to reproduce at our end.

@BineeMan
Copy link
Author

@spark-piyush-nitnaware
Well, it's strange. What exactly did you do in my project? Did you try the walking animation with the character with Character Movement Component? I've noticed that if character doesn't use movement from movement component (just plays animation in place), the skirt physics behaves in the same way as in Animation BP which is strange, because Character Movement Component takes movement from Root Motion. I think the reason for such behaviour can be an extra force applied from movement or Root Motion.
In addition, I've tried disabling Root Motion from "pl0000_0002_RunCycle" animation and it strated bugging right in the Anim BP so I think Root Motion is the reason. Does SPCR Dynamics work with root motion? You can do this in my project too, this animation is already plugged in.
I am using UE from the Epic launcher. Disabling smooth framerate didn't help. All the settings that I changed in my project were only related to lighting.
Thank you for your attention to my problem and sorry for late response. Your addon is very good for coth simulation and I hope that I will be able to use it.

@spark-piyush-nitnaware
Copy link

spark-piyush-nitnaware commented Feb 12, 2024

@BineeMan
Thanks for the overview.
I did nothing special which could solve the bug.
I just unzipped the rar file and compiled it, and to solve the compiler error I disabled VisualStudioTools plugin.

I checked the video again in your you tube link.
I can see that the physics simulation is bit strange in your animation BP itself, just the thing that it's not very visible but when the character in running motion its visible quite clearly.

These are the two test I did with the same project provided by you.
(In Epic launcher)
https://drive.google.com/file/d/1phvDzp7eMoI7paat-ahqa1KpifFk_JkU/view?usp=drive_link

(UE Github)
https://drive.google.com/file/d/1Coio6u407k98ckEDnwxmMCJ3cwNqTXvA/view?usp=drive_link
Note: To reduce animation speed, I changed the value of 'Play Rate' to 0.2 by selecting the SequencePlayer (pl0000_0002_RunCycle) in animation BP.
As you can see that the physics simulation in my animation BP is quite different than yours (even with PlayRate 1).

Sorry but can I ask you to check our example projects whether the bug is still there for you?
Also, if possible can you check in UE5.3.2, since UE5.3.1 is no longer available to download from Epic launcher, so probably there could be some engine side fixes (just a guess).

As for UE(5.3.2) from epic launcher the bug is still not reproducing for us.
I have asked one of my collogue to try this bug, so if any of us can reproduce it then we will solve it as soon as possible.

As for Root motion, we track the RootBone to update our child bones based on the RootBone position.

@BineeMan
Copy link
Author

@spark-piyush-nitnaware
As I see, in the first video the physics simulation looks like for me, the back part of the skirt instantaneously get in front of the character's hips, but then it restores. And in the second video it seems like it should work.
I am using UE 5.3.2 and it demonstrates the same behaviour.

However, I've noticed that FPS significantly affects to the simulation. If I have 70 fps, the the skirt twitches a lot and it looks very unnatural. But when I set low engine scalability settings, the fps increases to 120 and the simulation looks smooth and correct, exactly like in Anim BP. In the video below, I am demonstrating this.
https://drive.google.com/file/d/100KheimdZX-0s5_FDKcWug9LL9x28atE/view?usp=sharing

So I think that the key is that SPCR requires 100+ fps to properly simulate cloth physics which is a little too much for me.

And could you please send a link to those sample project you mentioned? I didn't find the download link.

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

No branches or pull requests

2 participants