- Home /
Performance with 100+ CharacterController's
Hi,
I'm making an RPG targeted for mobile devices and I made a few tests with more than 100 enemies. Each enemy has a CharacterController attached to it and I'm using Move() and SimpleMove() to steer them around. On a PC it runs smoothly, but on an iPad 3 I'm getting 15 fps at most.
I tried completely removing the CharacterController component from all enemies and moving them with transform.Translate and I'm getting 30-60 fps, but of course the player moves through enemies and the enemies move through walls.
To be sure that the problem doesn't come from the pathfinding I made a clean Unity project with 200 cubes with CharacterController and just set them to follow the player around. The result was the same - 15 fps at most. When I remove the CharacterController component I get more than 60 fps, so I think it's clear where the problem comes from. I even tried caching the transform.position, vector normalizations and other heavy calculations, even calculating them every second instead of every frame - same result.
So what is the standard way to approach this problem? I can imagine it's a common issue with every RTS and RPG out there. Please suggest some optimizations!
I am curious on how you went about solving this. Did you eventually switch to a Rigidbody+Collider system ins$$anonymous$$d of Unity's CharacterController?
Answer by TonyLi · Nov 05, 2013 at 03:53 PM
So the question is really how you can optimize Physics in iOS. Refer to this:
http://docs.unity3d.com/351/Documentation/Manual/iphone-Optimizing-Physics.html
Some people find improvement by reducing Solver Iteration Count from 7 down to 1: http://docs.unity3d.com/Documentation/Components/class-PhysicsManager.html
And just in general:
Hmm, not really. The question is about CharacterController performance, which is horrendous.
Your answer
Follow this Question
Related Questions
Inventory using a TXT file... Is it possible? 2 Answers
A node in a childnode? 1 Answer
Multiplayer in Action RPG, best approach? 2 Answers
100 animated enemies == 400 draw calls? 1 Answer
2D rigidbody movement & walls 2 Answers