- Home /
What's a solution for epic battle?
Hi all, i have a big problem in my project, it's a epic battle with hundred soldiers. I tried to do some way in http://docs.unity3d.com/Documentation/Manual/OptimizingGraphicsPerformance.html to make it smoothly but i didn't get the good result. Maybe the GPU has too many vertices to process and CPU does so many "drawcall", but i don't know how to solve it. Do you have any ideas about this problem? Thank you.
Perhaps it's not a matter of rendering it, but other calculations that might slow it down? Any chance that you're using way too many colliders, physics objects or some other calculations that might cause problems?
Thank for comment ShadoX, you're right, i have more than 100 soldiers on a battle, each soldier has a box collider and rigidbody. I must use them to control the soldiers. About calculations, i try this to optimize scripts.
That sounds like a lot to process. Try having just one soldier on the field and keep adding more to see how much your PC can handle. I'd say that you could try grouping a couple of soldiers into one big collider ins$$anonymous$$d of having one for each character or perhaps try looking into other ways of improving this part of the game.
[edit] have a look at http://gamedev.stackexchange.com/questions/27529/essentials-for-building-a-rts some of the info might be useful :)
Answer by vexe · Aug 23, 2013 at 04:36 AM
It's hard to tell what's going on in your environment, you provided little to no information. Your question was broad. But you might try this.
Thank vexe for your link, the problem is, i can't reduce vectices and triangles of soldier model any more, so with hundreds soldier render in a frame, GPU has too many vertices to process. But the require vertices for mobile is "not more than 100 thousand vertices". I wonder if there're some way to fix it. Sorry for my bad english! :(
I think you need to provide informations about the camera position (near or far) and you scene organization. If it's a vertex problem, you can try playing with LODs or Occlusion Culling. If it's a draw call problem as @Anh said you can combine meshes or use only one material per object.
Thank for your comment - @$$anonymous$$aT, In my game, the camera position is far, i must put it far from my game area to render all gameObjects in scene. This is information of camera:
About combining meshes, i just use one material cube for soldiers and i thought it wasn't neccesary for combining meshes. About LODs and Occlusion Culling: i will research about this. So thank you again.
Your answer
Follow this Question
Related Questions
Saving HashSet using BinaryFormat 1 Answer
Google SketchUp and Unity: How to avoid performance issues? 0 Answers
How to manage memory in a 2D Platformer game? 0 Answers
iOS Game starts to stutter over time 0 Answers
Loading Movie-texture timing. 0 Answers