Unity 3d PC game with low fps on a high end system..pls guide

Hello all,

One of our game is kind of a racing game in a village environment so there are lots of plants and because of that the fps is very low and unplayable at 20 fps…

One of my main question is … there are multiple terrains which will get deleted when the player crosses it…so i have like four terrains the problem is when i run the game its around 2000 draw calls…but if i disable the last three terrains the fps is good and the draw calls is around 1500…those terrains are rendering even when they are not seen by the camera…

Please help…the whole project is stuck up because of this fps issue…the systems when are running are more that 2000$ all the high end processors and graphics cards

Pls suggest in any way…

thank you

Could be so many factors but most of them are probably not script related so you may have better luck in the gossip section where general discussion about game design goes on all the time. If you’re confident you have covered all the basics of performance tips and tricks and have all your settings the way they should be then support may be your best bet.

You should atleast give the basic camera settings like far clipping and terrain settings so those interested in helping you won’t have to go through asking all those obvious questions.

Also post a link to a web player version for people to play cause performance issues can sometime be from just placing too many plants grass and high poly models. It’s better to test your game on low end pc’s instead of high end cause that’s what the majority of people have. It doesn’t hurt to have some gui to show how thing are performing in the build as well.

Hi, aCat4mIndia
Did you use CombineChildren script? If not it will help you to reduce drawcalls.

hi, Patico…

sorry for the late reply…the project is under serious condition…so was little busy…

I think i tried the combine children…and the near and far clip of the camera…its around 800 only.

i think its a bug… the terrain no seen by the camera is still taking drawcalls…i am confused …can you suggest anything for this particular problem

Try using some sort of occlusion culling, and take a screenshot of your stats window of the game running in unity, so we can see what stats you have.

completely disagree.

In my current development scene, which granted is relatively basic, but still has at times 3000 draw calls 1 Million+ Tris, fps only gets as low as 50fps on my gaming rig (i7, 6970 gfx).

Before I optimized my scripts, the same scene would be crawling… sub 10 fps.

During some of my earlier tests - spawning cars to drive around, I could only get to around 20-30 before fps was un-acceptible. Post optimizations I could get 100 vehicles with 30+ fps still.

Coding things in the wrong way can absolutely destroy performance, especially physics.

ie. try moving a non-convex mesh collider and watch your frames melt away.

My standard list of performance checks

  1. Anything with a collider needs a rigidbody. I cant remember if this counts for static scene objects.
  2. Anything with a rigidbody that is not kinematic needs to be moved using forces. Using transform.Translate/Rotate is wrong.
  3. Update should only contain code for Input, Animation, and Movement.
  4. FixedUpdate should only be used for physics related code.
  5. Anything that doesnt need to happen straight away, should be put into a sub loop (InvokeRepeating)
  6. If you have a single Component.Find (or any similar function) in Update, remove it. I would even remove things like GetComponent from Update.
  7. Cache everything you plan on accessing in an Update function
  8. Use some kind of pool manager.
  9. Be careful with particle systems that use mesh renderers as opposed to billboard. This caught me out one time. I had 4-5 particle systems using some mesh to render. Destroyed my FPS.

If you at least abide by the above guidelines, you will at least ensure your scripts are relatively optimized.

If you can get hold of Pro and use the profiler. Do it.

Yerp the profiler is the best tool in the box. :smile:

It does not. Basically, if you move something then give it a Rigidbody, if you do not, don’t.

Do you by any chance have any scripts using the print(blabla);? They can slow your fps, I know it’s a rookie mistake, but thought I’d ask, just in case.

Very true!

Debug.Log is a killer.

thanks for the discussion guys…am able to review the things here and verify them with my project,… i’ll do let you guys know if there is any change…

i seemed to find one thing weird…there are four separate terrain in which i remove each one of them after the player crosses the area…but the problem is the camera seems to have high draw calls when all the terrains are enabled and not visible to the camera…

If i disable the other three terrains the draw calls reduces to < 1000 and is much better… it seems the camera is still rendering the terrain not seen by it…or something…any solution for this ??