Help Performance lag when more thn 4 ropes created - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Help Performance lag when more thn 4 ropes created (/thread-4236.html) |
Performance lag when more thn 4 ropes created - kripa1415 - 03-06-2024 Is it possible to create a game similar to Twisted Tangled Game published by Rollic Games. I've tried and successfully created a few levels with just 2 to 3 ropes constructed twisted using a spline tool and created rope at runtime by generating blueprints. But the problem is Obi started to slow down when I introduced the 4th rope. Even with just 4 ropes twisted and collided, It totally stopped working even in high end devices. In that rollic game, it's not slowing down even with 40 to 50 ropes. We don't see any performance lag with either 5 or 50 ropes. How's that done ? I tried the Ultimate rope tool, which lacks collision strength and a few other limitations too. Failed! Then I tried creating my own rope using Dreamtek tuberenderer. Not even close to the Ultimate rope tool. Failed!. Then tried Rope MiniKit, that's the worst of them all. No support for rope-rope collision. So I wonder what's the possibility of at least coming close to that game ? RE: Performance lag when more thn 4 ropes created - josemendez - 03-06-2024 (03-06-2024, 06:48 AM)kripa1415 Wrote: Is it possible to create a game similar to Twisted Tangled Game published by Rollic Games. Hi, This doesn't sound right at all, performance shouldn't be a concern with such a simple setup. I mean, some of the included sample scenes have 4 ropes or more and they run at +200 fps on a fairly weak CPU. We're only starting to notice drops in performance with several dozen ropes. Have you installed the required package dependencies for Burst, as per the setup guide? Failing to do so will force Obi to fall back to a slower backend, that's particularly slow in mobile devices. Assuming that's not the case (you've installed Burst and it is enabled), the first stop when facing performance issues in Unity is the profiler. Would it be possible for you to your scene and share the profiling session with us so that we can take a closer look? kind regards RE: Performance lag when more thn 4 ropes created - kripa1415 - 03-06-2024 I've attached screenshot of the original game. Is it possible to create something like that using Obi ? 4 - 6 ropes working fine in desktop. I don't see any performance issues there. But its very slow in Mobile when ropes are twisted and tangled with collisions enabled. Yes burst by default its enabled. I didn't change any settings. It's universal render pipeline project with Burst packages installed by default. Attached screenshot for reference. I can create the below tangles somehow using a spline tool & creating obi ropes at runtime. But I don't think it can handle the collision in the same way how its done in that game. Even with just 4 - 6 ropes with solver collision parallel 20-30 iteration, when its slightly stretched, breaks collision and ropes getting untangled. collision problem secondary. Primary problem is the performance now. With 20-30 ropes, tangles and collision, will it be able to give more than 60 fps on mobile ? RE: Performance lag when more thn 4 ropes created - josemendez - 03-06-2024 (03-06-2024, 08:07 AM)kripa1415 Wrote: I've attached screenshot of the original game. Is it possible to create something like that using Obi ? Most certainly yes, that's not a lot of ropes and they're rather short. Here's 100 longer ropes at >60 fps: (03-06-2024, 08:07 AM)kripa1415 Wrote: 4 - 6 ropes working fine in desktop. I don't see any performance issues there. But its very slow in Mobile when ropes are twisted and tangled with collisions enabled. Check the ObiSolver component for any warnings stating that packages are missing, like this one: Some packages (jobs, collections) may not be installed by default. (03-06-2024, 08:07 AM)kripa1415 Wrote: I can create the below tangles somehow using a spline tool & creating obi ropes at runtime. But I don't think it can handle the collision in the same way how its done in that game. No wonder it's slow, 30 iterations is *a lot*, and parallel evaluation converges a lot slower than sequential. You should not need more than 1-3 sequential iterations under most circumstances. (03-06-2024, 08:07 AM)kripa1415 Wrote: when its slightly stretched, breaks collision and ropes getting untangled. Increasing the amount of collision constraint iterations won't help at all in this case, as the problem is the ropes are becoming overstretched: this opens gaps in between particles allowing other ropes to pass trough no matter how many collision iterations you use. Use more substeps instead to limit rope stretching, and also make sure that you interact with the ropes via forces (instead of just setting their position using a static attachment as that will ignore stretch forces). The manual contains a very in-depth explanation of what iterations/substeps are and how they affect the result. (03-06-2024, 08:07 AM)kripa1415 Wrote: quotWith 20-30 ropes, tangles and collision, will it be able to give more than 60 fps on mobile ? Absolutely, 30 short ropes should not be a problem in any hardware. RE: Performance lag when more thn 4 ropes created - kripa1415 - 03-06-2024 How to change rope constraint for a rope that is created at runtime. Attached reference Thanks for your prompt response. Yes I was getting that warning you mentioned. Installed missing package Collections and warning gone. Now burst taken over and I can see its working fine now for 4 ropes. I am going to try 20 ropes now. RE: Performance lag when more thn 4 ropes created - josemendez - 03-06-2024 (03-06-2024, 02:48 PM)kripa1415 Wrote: How to change rope constraint for a rope that is created at runtime. Attached reference rope.distanceConstraintsEnabled = true; rope.stretchingScale = 1; rope.stretchCompliance = 0; And so on. Check the API documentation for details: https://obi.virtualmethodstudio.com/api.html RE: Performance lag when more thn 4 ropes created - kripa1415 - 04-06-2024 Hi, Is it possible to create static ropes as shown in the attachment ? I want to activate and make it dynamic only after creating all ropes to make sure they are all tanged as designed in spline. |