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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

maximizing performance of game

Discussion in 'Editor & General Support' started by KKS21199, Jul 30, 2013.

  1. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139
    Hello guys, i am currently developing a game with mecanim system and some advanced public sharing scripts. I want to know if it can run on android or not.

    I want to know how to maximize the performance on different platforms and what things i shud not use so i can maximize it ?

    Plssss :!:
     
    Last edited: Aug 1, 2013
  2. XGundam05

    XGundam05

    Joined:
    Mar 29, 2012
    Posts:
    473
    For the most part, testing and profiling is the only way to know for sure. A good rule of thumb: Don't optimize until you have to (otherwise known as, If it ain't broke, don't fix it).
     
  3. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139
    bcz i am 14 and i don't to put in all my efforts into the colliders and waste my time now...(then if it makes it slow i am deaddd.
     
  4. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139
    you shud get it i think
     
  5. XGundam05

    XGundam05

    Joined:
    Mar 29, 2012
    Posts:
    473
    No offense, but you would prefer to waste your time on optimizations that may or may not be needed? Not to mention, premature optimization can lead to other issues, and can even cause a drop in performance. For mobile, just keep your models low/mid poly and you should be okay for the most part. That and try to avoid too many OnGUI calls.

    I don't get what you're getting at here.
     
  6. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139


    but does too many scripts affect the performance ?

    Like one script will call another script in for some functions
     
  7. runner

    runner

    Joined:
    Jul 10, 2010
    Posts:
    865
    Thought i would butt in in ask, what premature optimization would look like is it Really just a waste of time? After all, we are Targeting mobile.

    You should be reasonable and not do to many lookups such as GetComponent() in the Update() coroutine but place the GetComponent() in the Start() routine, (As a example), Doing 100 SendMessages/Sec on a Update() would also.drag down performance. So good Unity programming methodology does wonders. So it's not how many scripts but how they are utilized.
     
  8. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139
    Thanks. but how about the number of colliders in the scene area. I use them to know where the player is and i am sure that no matter what goes wrong there will be 16 colliders. They will be destoyed and also created again and again...
     
  9. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    That sounds stupid. Why destroy them? Why not move them?
     
  10. KKS21199

    KKS21199

    Joined:
    Nov 22, 2012
    Posts:
    139
    i don't know how to move them, and i need a random genration

    see this, i removed the max limit which means it won't destroy but ontinue to generate,


    models used in this video are from ruin run starter kit....scripts are mine

    If i start moving things, it won't be randomly arranged but it will be repeadted again and again.



    Just say me does the number of collider and trigger affects the speed
     
  11. runner

    runner

    Joined:
    Jul 10, 2010
    Posts:
    865
    the Tile obstacles "mesh renderer" have the shadow castors enabled, and the receive shadows (turn them off)

    also you have i assume the mecanim animator controller script also attached too those level geometry prefab's . that references nothing anyway. remove the script from the prefab. So now when it gets instantiated (cloned) it will be abit more pre-optimized.

    Note: mecanim is for the player characters and enemy things not for static scenery blocks.

    You could also turn on static for the mesh's but they are spawned on the fly so i doubt that would help much in the optimization since the static flag is used in camera culling or is it beast? , I could very well be wrong .. check the framerate too be sure.