- Home /
Learning about graphics in Unity
Im looking to learn about the limitations of unity. I have been playing around with a few variables in my game and realised how much they affected the FPS. I really want a guide which will tell me what a realistic number of objects in a game is; how the size of terrain affects performance, the effect of model detail etc. This really effects how I make my game.
Thanks :)
this is always a huge problem as there is no easy solution.
truly the best thing to do is TURN ON YORU PROFILER and learn to use it really well - it is an incredible help and the only answer to this.
Thanks, I have been reading through some of the unity documentation which helps.
I would like to know about threading. I am new to this, but it seems like a good way to get a lot of draw calls done, while maintaining a decent FPS, if I have a lot of objects. So for example if I put all the draw calls into two threads. Anyone know anything about that and if its possible or am I losing my $$anonymous$$d? :P
You cannot modify the Unity Engine, sadly. The Unity engine is what does all rendering for you. Therefore, you can't change how rendering is performed.
All you can do is adjust what's in your game - the meshes, materials, number of game object, etc. - along with options that Unity exposes for you, like whether to use dynamic batching or not.
Thanks everyone for the responses.
$$anonymous$$y game is looking to create a natural environment where everything can be removed and replaced. The number of different models will be some where between 100-200. Im not exactly sure how many clones I want to make exactly, but I estimate around 50000. A fair percentage of the objects will have some form of AI so that they can mimic some form of animal behaviour.
Ive instantiated 20000 capsules into a 1000x1000 terrain with a draw distance of 100. The fps really dropped off. Looking on the profiler, the CPU shows that it is mostly doing draw calls.
Is that enough info?
Answer by Fattie · Mar 16, 2013 at 07:53 AM
ok one very first thing is you need to make sure that you have very few materials, perhaps only one or two materials.
secondly when you're dealing with 10s thousands of things, that's not going to be the scene - one way or another you'll only be drawing and operating on a limited set within a certain range. for this you'll need a whole range of techniques from LOD meshes and culling at the level of your own game logic, as well as the full range of culling offered by unity.
one tiny piece of knowledge that comes to mind which you'll have to really understand from top to bottom is using Pools in video games,
http://answers.unity3d.com/questions/321762/how-to-assign-variable-to-a-prefabs-child.html
additionally large world games are database driven, so you'll need to become expert with mysql etc.
What about if you quickly make a few small video game titles (perhaps even 2D) to learn about these concepts. (2D will serve you well as you have to deeply learn about drawcalls, materials etc in unity)
once you have a few titles like that on the app store you could then tackle a full 3D environment games (like a race game, shooter-in-a-castle or whatever) Finally you can work up to full open-world type games as you describe, I'd say
note that (again this is just one "random thought" from dozens) when you do a "huge game" like that you need a staggering amount of test equipment to constantly explore performance limits, so get ready to start buying every iOS device ever made on ebay!! :)
yet another random thought that comes to mind, you mention "terrain", if you mean the built-in terrain system which unity offers. it's an impressive and admirable system but it's more a prototyping or test system. it's perhaps fair to say it is not used in big production games that much. i believe, it's very likely that if you were making a huge-world title as you describe then unity's built-in terrain system would be totally irrelevant, I think
note that at the moment your question is "extremely general" (i.e. you mention threading in passing)
I dunno if there's anything very specific anyone can help you with here. i would suggest closing out this question and asking new specific questions and very specific issues. this could range from "threading" to LOD to culling to database to rendering issues (materials, sharing, generating textures on the fly, mesh generation, etc etc)
Hope this helps in some way.
Hey, thanks for the lengthy, detailed reply. Its good to get an idea of where my challenges lie. I think I will push on with this project as I have done a scaled down version of it that works. I suspect that my ignorance will keep me going until my computer cant. :P At the very least I will get the mechanics and maths done.
Anyway, I appreciate your efforts to help a noob :)
ask anything you want here and zillions of people will help you!
Are there any packages that you would recommend that I look at that would be better suited to my task? I suppose something which would allow me greater control of the engine. Dont worry if you feel its an "advanced package". Im keen to give anything a go and the worst that can happen is I spend time going nowhere.