Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Softbody lags SEVERELY but only during collision
#1
Hi!

I have been using Obi Softbody for quite sometime now, and I always have a hard time optimizing the entire Obi system. I changed the backend setting to burst already, downloaded all the required packages (Burst, Collections, Mathematics and Jobs) and set all the constraint iterations to minimum parameters (if possible, 1), but the game still lags PARTICULARLY when two or more softbodies are in contact. I cannot attach a screenshot of the game, because it is still under development, but I will try my best to describe the game system.

  • Upon level start, there is one Obi solver in the scene. Multiple softbody prefabs will be instantiated as children of this solver. Upon instantiation, the softbody component is disabled to save memory and is only enabled once a certain condition is met. The softbodies are enabled one by one. I attached a screen capture of the solver (solver.png).
  • Upon meeting another condition, the softbody prefab as a whole is deleted. Including all the Obi-related components. The softbody prefab's heirarchy is included below (heirarchy.png). Center and KeyHolder are just empty transforms, while Skin (skin.png) and Player (softbody.png) are where Obi components are included. I attached a screen capture of these two as well.
  • The mesh of the softbody I am using has 3328 vertices, 3332 triangles and 2 submeshes.
  • The softbody blueprint parameters are attached below. Please refer to blueprint.png.
  • I took a screenshot of the Profiler during the time when the game lags and attached it below. During this time, the game is practically unplayable and just freezes. The weird thing about this is if you set backend to Oni, the freeze issue disappears on the editor, but freezes nonetheless when you build the game on Android. Setting backend to Burst freezes on either environments. For the screenshot, please refer to solver.png.
I can probably send the entire project to you if you have a personal e-mail address to which I can send it to. My observation is that the Burst mode is fine as long as there are no colliding softbodies. Maybe the computation for Obi just overloads with all the collisions happening? If this is the case, might the softbody be subscribed to the OnParticleCollision event? (I did not perform any subscription via script.)

I would appreciate any advice from you, as I have been struggling quite some time with this problem. Even with just 2 softbodies enabled, the game lags and I do not know what to do anymore. Also, the Jobs settings return to default everytime I open the editor and because of this, I have to set it every single time. Is this normal behavior?

Looking forward to your reply!


Attached Files Thumbnail(s)
                       
Reply


Messages In This Thread
Softbody lags SEVERELY but only during collision - by creekat - 09-09-2023, 10:49 AM