Announcement

Collapse
No announcement yet.

Runtime SplineMesh generation performance.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Runtime SplineMesh generation performance.

    Hi

    I am currently experimenting with runtime procedural plant and tree growth.

    The SplineMesh component used is a basic triangular prism, and the growth is controlled using Timelines, with the timelines play rate controlled by a growth time variable.

    From the main stem, are branches that grow, and from branches, more branches, fruit, leaves etc. But lets say for example in my test case, I have just a stem being grown with 6 spline points, 10 meters high. I have 2 branches coming out from each spline point that each only have 2 spline points (0 and 1).

    When there's a multitude of these trees growing, performance goes from 120fps down to potentially ~6 FPS, maybe lower with more growing.
    This seems to be as a result of a whole bunch of timelines running simultaneously.

    I am new to spline meshes, and haven't really looked into much in the way of optimization techniques.
    I don't think it has anything to do with poly count, as they are very low poly. I don't think it's to do with shading, as the current material is just a basic colour. I doubt it's to do with so many meshes being created either, as it's really not that many compared to other tests I have done, and performance goes back to something much more reasonable after all of the growth is finished.

    Does anybody know a way that I could optimize this tree/plant growth? Or confirm that I am right in thinking that multiple simultaneous timelines bog down performance.

    PS: These trees MUST grow in run time, not automatically be fully grown, as the player must plant these plants and help them grow.

    Thankyou in advance.
    Developer of the party game "Metal Heads".
    www.metalheadsgame.com
    Follow on Twitter @MetalHeadsGame
    Follow on Facebook www.facebook.com/MetalHeadsGame.

    #2
    One thing you might want to try is setting up a global timeline, and set your growth based on time passed from the Global timeline. Ideally you will have a single time and your growth will start/stop based on time passed rather than independent timelines.

    IE: your plants have a growth rate of x every y seconds. ( could be your levels time of day clock)
    Last edited by NeoTactical; 03-05-2017, 10:52 PM.

    Comment


      #3
      Originally posted by TravisTBH View Post
      One thing you might want to try is setting up a global timeline, and set your growth based on time passed from the Global timeline. Ideally you will have a single time and your growth will start/stop based on time passed rather than independent timelines.

      IE: your plants have a growth rate of x every y seconds. ( could be your levels time of day clock)
      I'll take a look into this, I'm just not too sure how it'd work. I was considering using a Timer for each of the trees/plants too, I wasn't sure if that would be more efficient or not. But since it's a networked game too, I foresee pretty bad network performance occurring.
      Developer of the party game "Metal Heads".
      www.metalheadsgame.com
      Follow on Twitter @MetalHeadsGame
      Follow on Facebook www.facebook.com/MetalHeadsGame.

      Comment

      Working...
      X