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
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.
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
Anything with a collider needs a rigidbody. I cant remember if this counts for static scene objects.
Anything with a rigidbody that is not kinematic needs to be moved using forces. Using transform.Translate/Rotate is wrong.
Update should only contain code for Input, Animation, and Movement.
FixedUpdate should only be used for physics related code.
Anything that doesnt need to happen straight away, should be put into a sub loop (InvokeRepeating)
If you have a single Component.Find (or any similar function) in Update, remove it. I would even remove things like GetComponent from Update.
Cache everything you plan on accessing in an Update function
Use some kind of pool manager.
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.
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.
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 ??