Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How do I boost my game performance?

Discussion in 'Editor & General Support' started by eric56379, Mar 1, 2015.

  1. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    Hi, I am making a game and it's going really slow on computers. My computer can run much better graphics than my game perfectly fine, but with my game, it lags a lot. If you want an example, go here: http://www.giantyeargames.com/forest-demo-scene.html

    Please tell me some tips or just plain old how to speed it up.

    Many thanks!
    -Eric N.
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    I haven't seen the demo but here's some general tips:

    • Don't instantiate/destroy game objects a lot
    • don't use really high polygon models
    • don't use expensive (as in cost a lot of processing power) lighting and shadows
    • don't use huge textures, especially read write enabled ones
    • use texture compression
    • if certain scenes lag, break em up into smaller scenes and transition between them
    • If you have unity pro, use the profiler to find slow script areas
    • if you don't have pro, consider asset store options, benchy is what I've been using, to find slowdowns
    • reduce characters count, reduce particles count, reduce anything you can get away with
    • find a good balance between performance and visual quality
    Good luck!
     
  3. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    Hi,

    I forgot to mention in the post. I have pro. And all that is lagging right now is just the environment. There is some coding involved. And the only thing making it so slow is just the movement of trees and grass.
     
  4. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Use the profiler, it might give you some ideas as to whats wrong.
     
  5. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    The biggest CPU user for the game is the Camera. How would I fix that to speed it up?
     
  6. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Take a screen shot of the profiler when a deep scan has run, with the worst lag spike showing. Show said screen shot to The forum. Somebody will know what's going on maybe.
     
  7. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    This is what I got. (see attachment)

    Mostly vSync is causing the issue.
     

    Attached Files:

  8. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Ahh that's just the delay for vsync. You seem to be getting between one to two hundred frames per second. Can you do things in the game that cause slowdowns while recording?
     
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks for that. I can see Unistorm is a fairly useless asset then. Spewing that much gc allocs per frame is entirely unacceptable for optimised middleware.

    As mentioned above waitfor at high framerates generally can be ignored. For low framerates, it's usually a bottleneck like fill rate.
     
  10. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    Whenever I record, Unistorm actually is the only thing that makes it just go a little slower. It's just when it rains though.
     
  11. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Lol well... I guess that's just the overhead of using that plugin. I imagine if you look through some settings within that whole thing, there must be a way to tweak the rain quality, or density... Something to make the rain less intensive. I couldn't help ya, might need to contact the Dev who made that plugin if you get poor performance specifically from it.
     
  12. eric56379

    eric56379

    Joined:
    Mar 11, 2014
    Posts:
    89
    Unistorm isn't slowing down the game. It's the environment of the game. All of the tree movements, grass and water. Unistorm runs just fine.