Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Performance lag for Endless Road generation
#1
Hi,

First of all thank you for making such a useful asset. This has been saving me a lot of time in making levels for my game.
I have a levels where the character has to run on an end less track until it completes certain objectives and the track has to keep on extending till then, As you can see in the attached picture, I am using one main spline with the basic shapes as the ground track and other two splines to create the side walls with a wall prefab.

Now whenever the character is 50 unit distance from the last point of the track spline, I extend the end point of the spline by another 50units at run time. While extending the endpoint of spline there is always an obvious lag which is difficult to ignore and affects the gameplay.

As you have already mentioned in the docs and in forum answers that extending splines at runtime are costly. Can you please tell if there is any solution or suggestions to achieve this runtime implementation without getting much performance impact. Note: The game will be running on mobile devices, so optimization is a priority.

Thanks, 
Soumya


Attached Files Image(s)
   
Reply
#2
Hi
Glad to read that you are liking the asset.
There are some general tips to improve performance available here: https://curvyeditor.com/documentation/performancetips
If applying them did not reduce cpu usage to a satisfying level, please write me again. And even if it did reduce enough the cpu usage, update me so I know that you fixed the problem.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
I was able to reduce the lag. As you can see in the above image, there were more wall prefabs being spawned. The track was straight, so scaling the wall length decreased the overall number of wall to be spawned. That helped in reducing the cpu usage while spawning them.

I have a doubt though from the performance doc.

In the recommended "Split Splines" method
"When a spline is used as an input for a Curvy Generator, the CG will update every time that spline is modified. That means that if you modify a kilometer long spline used for mesh extrusion, the whole mesh will be updated even if only the last meter of the spline is modified. A way to avoid this scenario would be to have a CG extruding the static part of the spline, and another one extruding the part that will be updated (that last meter)"

Can you please explain a bit more, this part "A way to avoid this scenario would be to have a CG extruding the static part of the spline, and another one extruding the part that will be updated (that last meter)" ?
Reply
#4
Hi
I attached a scene showing what that tip means. In the scene there is what seems to be a single tube. When you hit play, a script moves the tube's end. In reality, there are two tubes, one for each half. Each half has its separate spline. So when I am updating the end of the second half, the first half does not have to update as well. If I had a single generator associated with a single spline, updating the end of the spline will regenerate the whole tube.
Is my answer clear?


Attached Files
.zip   User2200.zip (Size: 26.95 KB / Downloads: 0)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
(04-06-2021, 08:25 PM)_Aka_ Wrote: Hi
I attached a scene showing what that tip means. In the scene there is what seems to be a single tube. When you hit play, a script moves the tube's end. In reality, there are two tubes, one for each half. Each half has its separate spline. So when I am updating the end of the second half, the first half does not have to update as well. If I had a single generator associated with a single spline, updating the end of the spline will regenerate the whole tube.
Is my answer clear?

Oh yes, I get it now what you mean. I can implement this in my case.

Thank you for helping me.
Reply
#6
Glad that I could help. If and when you feel like it, please leave a review for the asset, that helps a lot.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Performance on Mobile Hardware (Oculus Quest VR) ForemanDesigns 3 128 05-03-2021, 07:04 PM
Last Post: _Aka_
  Disabled mesh generation until a certain number of CPs are added. boriskourt 1 64 05-02-2021, 10:02 AM
Last Post: _Aka_
  Road - is it even possible? kpulka 1 308 02-07-2021, 09:43 PM
Last Post: _Aka_
  road crossings like T-Crossing or X-Crossing with Curvy? Econt 1 663 08-13-2020, 01:07 PM
Last Post: _Aka_

Forum Jump: